FROM CACHE - en_header

Struggling with Fulfillment Orders

Solved
neilzilla
Tourist
3 1 1

I've used webhooks and created apps many times before, but I'm struggling to get my head around fulfillments, either the documentation is wrong or I'm missing something.

 

I'm creating an app to handle print on demand products,  I've authed my app with the store and registered it as a Fulfillment service.  I can set product variants to be handled by my app, but this is where I'm struggling.

I added the callback url for my fulfillment service, and I understand the callback url will have /fulfillment_order_notification appended to it, to call when a fulfillment is requested.  So I have an endpoint at:

https://myexampleurl.com/integrations/shopify/fulfillment_order_notification (https://myexampleurl.com/integrations/shopify being my callback url)

This never gets called, so I gave up on it.  Instead I'm calling:

/admin/api/2021-07/assigned_fulfillment_orders.json?assignment_status=fulfillment_requested&location_ids[]=1234567 (1234567 being an example)
 
Which is fine, I get a list of fulfillment order requests.
Whenever I try and accept these I get a 422, and no other errors.  I did note in the list of my requests, it show supported actions, with the only one being 'create_fulfillment'.  For what it's worth, it also lists 'outgoing_requests' with the kind 'legacy_fulfill_request'.  If this means anything, I have no idea as there's zero documentation on this from what I've found.
 
But that's it, I get a 422 trying to accept request and I get an error of 'Cannot create fulfillment for the fulfillment order.' when I try to create a fulfillment order.
 
Am I misinformed as to how this works?  I've been trying to follow what's stated here but I've went so far off the simple looking steps I'm starting to give up
Accepted Solution (1)

Accepted Solutions
neilzilla
Tourist
3 1 1

This is an accepted solution.

as it turns out I was missing 

fulfillment_orders_opt_in: true
when registering my app for fulfillment

View solution in original post

Replies 4 (4)
GrahamS
Shopify Staff (Retired)
Shopify Staff (Retired)
193 36 51

Hey @neilzilla ,

Can I ask you to pass us an x-request-id from a call that returned a 422? The newer the better. We can take a quick look to see if there is anything obvious in the call that is causing that error to return.

Graham S | API Support @ Shopify
- Was my reply helpful? Click Like to let me 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

neilzilla
Tourist
3 1 1

3d5f758d-9ca9-49f9-936f-a1a133942608 is the x-request-id
I've noticed the message:

The fulfillment service has not registered for fulfillment order based fulfillments

 

But my app has the following scopes, I can't find any more to add to test:

read_products,
write_products,
read_orders,
read_checkouts,
read_customers,
read_fulfillments,
write_fulfillments,
read_assigned_fulfillment_orders,
write_assigned_fulfillment_orders,
read_third_party_fulfillment_orders,
write_third_party_fulfillment_orders,
read_merchant_managed_fulfillment_orders,
write_merchant_managed_fulfillment_orders
neilzilla
Tourist
3 1 1

This is an accepted solution.

as it turns out I was missing 

fulfillment_orders_opt_in: true
when registering my app for fulfillment
rustcity
Shopify Partner
13 2 1

thx i had run into this issue...