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
https://shopify.dev/apps/fulfillment/fulfillment-service-apps