Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

New fulfillment orders api question

Solved

New fulfillment orders api question

mmmmmm1
Tourist
9 0 7

Sent the following questions to support via email, no answer after 1 week.

 

Anyone can help?

 

1. permission. in Step 2: Update your app's permissions, my app currently does not ask these permissions "read_fulfillments" or "write_fulfillments", however, it asks "read_orders" and "write_orders" permissions, so for existing installations, do I automatically get "read_merchant_managed_fulfillment_orders" and "write_merchant_managed_fulfillment_orders"?
 
what is the purpose of Step 2: Retrieve inventory levels?  your REST Admin API's GET inventory_items does not return inventory at all.
In create fulfillment call, why cannot you make fulfillment_order_line_items optional if the seller is doing a full fulfillment?  Your order fulfillment api is really hard to use, we have to make many calls to get inventory and variant etc, I don't see why you cannot have a default to fulfill everything so that we don't need to pass you fulfillment_order_line_items.
 
Thanks
Accepted Solution (1)
aveshopstech
Shopify Partner
33 1 31

This is an accepted solution.

Hey @mmmmmm1, I had similar questions regarding permissions is a post I made, which I think I've now figured out. Like you, our app also does not have any specific [read/write]_fulfillments permissions, but it does have [read/write]_orders permissions, and we've been able to manage fulfillments this way up to this point.

 

Regarding migration, the first step is to identify what permissions you need, but the migration guide is not very helpful on when you'd need which permission. There seems to be several different permissions that may or may not be needed depending on what "type of app" you are. The Shopify API access scopes documentation page provided a bit more information that helped me better understand these.  The options, according to the migration guide, include:

  • [read/write]_merchant_managed_fulfillment_orders
    • Needed when managing FulfillmentOrder resources assigned to merchant-managed locations. (I Think this is our scenario.)
  • [read/write]_third_party_fulfillment_orders
    • Needed whtn managing FulfillmentOrder resources assigned to a location managed by any fulfillment service. Meaning, if the fulfillment service isn't yours, but the location is managed by a fulfillment service, then you'd need this.
  • [read/write]_assigned_fulfillment_orders
    • Needed for access to FulfillmentOrder resources assigned to a location managed by your fulfillment service. In other words, I think this is only required if your app is registered as a fulfillment service on merchant stores.

So, assuming your app is like mine and has NOT registered a fulfillment service on merchant stores, and you're just managing fulfillment orders created for inventory in a merchant-managed location, then I think the [read/write]_merchant_managed_fulfillment_orders is all you need.

 

After a little testing, I found that, as stated by docs, you cannot request granular access scopes for the [read/write]_assigned_fulfillment_orders permission without already having the [read/write]_fulfillments permission. However, I WAS able to request granular access scopes for the [read/write]_merchant_managed_fulfillment_orders permission! So, you should be able to write a small script to call the REST endpoint to request granular access scopes for [read/write]_merchant_managed_fulfillment_orders for each of your connected merchants in order to add that permission. Then, your app can access the fulfillment orders endpoints, so long as you're only managing fulfillment orders for inventory in merchant-managed (not fulfillment-service-managed) locations.

View solution in original post

Replies 6 (6)

Michael_AG
Shopify Staff
47 8 11

In create fulfillment call, why cannot you make fulfillment_order_line_items optional if the seller is doing a full fulfillment?  Your order fulfillment api is really hard to use, we have to make many calls to get inventory and variant etc, I don't see why you cannot have a default to fulfill everything so that we don't need to pass you fulfillment_order_line_items.

 

Hi Mmmmmm1,

 

line_items_by_fulfillment_order[<id>]["fulfillment_order_line_items"] is optional. Please have a look at the api docs. Thanks for your notice, we will update the migration guide page to make it more clear.

 

fulfillment_order_line_items: (array) The fulfillment order line items and the quantity of each which should be fulfilled. If this property is undefined, then all of the fulfillment order line items of the associated fulfillment order are fulfilled.

 

https://shopify.dev/docs/api/admin-rest/unstable/resources/fulfillment#post-fulfillments

https://shopify.dev/docs/api/admin-graphql/unstable/input-objects/FulfillmentV2Input#field-fulfillme...

 

To learn more visit the Shopify Help Center or the Community Blog.

mmmmmm1
Tourist
9 0 7

Thanks Michael.

 

What about question 1 regarding the permissions?  what is answer for that?

mmmmmm1
Tourist
9 0 7

I did a test, so it is no go.  I got no permission error.

 

So this is definitely a design flow.  My app (currently, before migration) is able to call the old fulfulment api  to complete orders without read_fulfillments and write_fulfillments permissions (my app has access to read_orders and write_orders permissions).  I am also not able to request additional permission per migration doc, this is what I get when I try to request the required permissions:

 

requested_scopes": "Missing required scopes: \"write_assigned_fulfillment_orders\" requires \"write_fulfillments\"."
 
So for sellers who have installed my app, I will have to ask them to re-authorize the app in order to make it to work, this is ridiculous!  Shopify, please give  read_fulfillments and write_fulfillments to sellers who already have read_orders and write_orders.
 
Thanks
aveshopstech
Shopify Partner
33 1 31

This is an accepted solution.

Hey @mmmmmm1, I had similar questions regarding permissions is a post I made, which I think I've now figured out. Like you, our app also does not have any specific [read/write]_fulfillments permissions, but it does have [read/write]_orders permissions, and we've been able to manage fulfillments this way up to this point.

 

Regarding migration, the first step is to identify what permissions you need, but the migration guide is not very helpful on when you'd need which permission. There seems to be several different permissions that may or may not be needed depending on what "type of app" you are. The Shopify API access scopes documentation page provided a bit more information that helped me better understand these.  The options, according to the migration guide, include:

  • [read/write]_merchant_managed_fulfillment_orders
    • Needed when managing FulfillmentOrder resources assigned to merchant-managed locations. (I Think this is our scenario.)
  • [read/write]_third_party_fulfillment_orders
    • Needed whtn managing FulfillmentOrder resources assigned to a location managed by any fulfillment service. Meaning, if the fulfillment service isn't yours, but the location is managed by a fulfillment service, then you'd need this.
  • [read/write]_assigned_fulfillment_orders
    • Needed for access to FulfillmentOrder resources assigned to a location managed by your fulfillment service. In other words, I think this is only required if your app is registered as a fulfillment service on merchant stores.

So, assuming your app is like mine and has NOT registered a fulfillment service on merchant stores, and you're just managing fulfillment orders created for inventory in a merchant-managed location, then I think the [read/write]_merchant_managed_fulfillment_orders is all you need.

 

After a little testing, I found that, as stated by docs, you cannot request granular access scopes for the [read/write]_assigned_fulfillment_orders permission without already having the [read/write]_fulfillments permission. However, I WAS able to request granular access scopes for the [read/write]_merchant_managed_fulfillment_orders permission! So, you should be able to write a small script to call the REST endpoint to request granular access scopes for [read/write]_merchant_managed_fulfillment_orders for each of your connected merchants in order to add that permission. Then, your app can access the fulfillment orders endpoints, so long as you're only managing fulfillment orders for inventory in merchant-managed (not fulfillment-service-managed) locations.

mmmmmm1
Tourist
9 0 7

Thanks @aveshopstech !  In did I can request [read/write]_merchant_managed_fulfillment_orders!  Thanks a lot!

 

PS. I realize shopify is going downhill.  a few years ago, when I needed help, shopify support usually resolves my problem in a couple of days if not sooner.  Now, you will find yourself lucky if they can even resolve the problems for you.  My first post was replied 2 weeks after, and only answered half of my question.  I used to recommend Shopify to my customers (over bigcommerce), not anymore.  There is no L3 partner support (L1/L2 just ask you to post in forums), they want us to use community forums so we support each other.

 

 

Michael_AG
Shopify Staff
47 8 11

Hi,

 

Thank you for your questions. You helped us to understand what parts of documentation should be improved. A reworked FulfillmentOrder resource documentation will be released in a few days and will cover your questions. 

 

> access scopes

 

Apps having read/write_fulfillments access scopes can request some or all of read/write_[assigned_fulfillment_ordersmerchant_managed_fulfillment_ordersthird_party_fulfillment_orders].

Apps having read/write_orders access scopes can only request some or all of read/write_[merchant_managed_fulfillment_orders, third_party_fulfillment_orders]. We will include it in the docs. Thank you.

 

If your app registered a fulfillment service, it would request read/write_fulfillments access scopes and then need read/write_assigned_fulfillment_orders. However, as I understand, your app is not a fulfillment service, so it does not have assigned fulfillment orders, and then it would not make any use of the read/write_assigned_fulfillment_orders access scope.

 

Aveshopstech's answers are correct.

 

> your REST Admin API's GET inventory_items does not return inventory at all.

 

Please specify what does not work. What query do you perform, and what response do you receive? We are not aware of any problems with this endpoint. 

To learn more visit the Shopify Help Center or the Community Blog.