Solved

migration to fulfillment order

rah_shop
Shopify Partner
5 1 4

This documentation for Fulfillment Order - https://shopify.dev/docs/api/admin-rest/2023-01/resources/fulfillmentorder - states that "Fulfillment orders are created automatically when an order is created.".  So I should expect to see something returned when making a call to

 

/admin/api/2023-01/orders/{order_id}/fulfillment_orders.json - correct?

 

Whenever I make a call to it though, I get back an empty array.  Why would that be?

 

{
    "fulfillment_orders": []
}
Accepted Solution (1)
rah_shop
Shopify Partner
5 1 4

This is an accepted solution.

So it turns out these 2 permissions were missing

 

"read_merchant_managed_fulfillment_orders"
"write_merchant_managed_fulfillment_orders"

 

Once these were added, then it worked.  So in the end I had to add these 6 new perms

 

"read_third_party_fulfillment_orders"

"write_third_party_fulfillment_orders"
"read_assigned_fulfillment_orders"
"write_assigned_fulfillment_orders"
"read_merchant_managed_fulfillment_orders"
"write_merchant_managed_fulfillment_orders"

View solution in original post

Replies 4 (4)

ShopifyDevSup
Shopify Staff
1317 216 456

Hi @rah_shop 👋

 

To start, I would recommend checking whether your app has all appropriate permissions. When the fulfillment order is created, it will be assigned a specific location, and it's likely that your app doesn't have permissions to view fulfillment orders at that particular location. 

 

Hope that helps!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

rah_shop
Shopify Partner
5 1 4
Thanks - I had already made this call (steps 1 and 2) before doing all this
(per the docs). Note though - I didn't do anything re step 3 (Opt in to
fulfillment orders as a fulfillment service - since I don't have any
fulfillment services that are in the system since the fulfillment service
is specified as manual). I just need to create the fulfillment via the API
as I have been doing prior to the migration but am stuck just because the
fulfillment order is returned as an empty list.


{
"requested_scopes": [
"write_assigned_fulfillment_orders",
"read_assigned_fulfillment_orders",
"read_third_party_fulfillment_orders",
"write_third_party_fulfillment_orders"
]
}

and then got this response

{
"access_scopes": [
{
"handle": "write_fulfillments"
},
{
"handle": "write_inventory"
},
{
"handle": "write_orders"
},
{
"handle": "write_products"
},
{
"handle": "write_script_tags"
},
{
"handle": "write_themes"
},
{
"handle": "write_assigned_fulfillment_orders"
},
{
"handle": "read_assigned_fulfillment_orders"
},
{
"handle": "read_third_party_fulfillment_orders"
},
{
"handle": "write_third_party_fulfillment_orders"
},
{
"handle": "read_fulfillments"
},
{
"handle": "read_inventory"
},
{
"handle": "read_orders"
},
{
"handle": "read_products"
},
{
"handle": "read_script_tags"
},
{
"handle": "read_themes"
}
]
}
rah_shop
Shopify Partner
5 1 4

This is an accepted solution.

So it turns out these 2 permissions were missing

 

"read_merchant_managed_fulfillment_orders"
"write_merchant_managed_fulfillment_orders"

 

Once these were added, then it worked.  So in the end I had to add these 6 new perms

 

"read_third_party_fulfillment_orders"

"write_third_party_fulfillment_orders"
"read_assigned_fulfillment_orders"
"write_assigned_fulfillment_orders"
"read_merchant_managed_fulfillment_orders"
"write_merchant_managed_fulfillment_orders"

agrinder-nhs
Visitor
1 0 0

The API documentation states that there are multiple scopes and to reference each endpoint to see what scopes are needed, but there are no references to them all in the documentation.

 

In the end I needed the following scopes for our fulfillment app:

Fulfillment services

View or manage fulfillment services

write_fulfillments
read_fulfillments
 
Merchant-managed fulfillment orders

View or manage fulfillment orders assigned to merchant-managed locations

write_merchant_managed_fulfillment_orders
read_merchant_managed_fulfillment_orders
Orders
 

View or manage orders, transactions, fulfillments, and abandoned checkouts

write_orders
read_orders
 
Third-party fulfillment orders

View or manage fulfillment orders assigned to a location managed by any fulfillment service

write_third_party_fulfillment_orders
read_third_party_fulfillment_orders