Fulfillment Webhook & fulfillment_orders_opt_in

Tobias_HK
Visitor
1 0 0

I'm using the Fulfillment Webhook & a created fulfillment_service, to handle orders that need to be fulfilled.

 

I have setup the "Fulfillment creation" Event to notify me if a fulfilment request is made.

 

First i setup the fulfillment_service i created with "fulfillment_orders_opt_in = false".

But this way it looks like im unable to mark the fulfillment as done and add a tracking url.

This only works with the old depreciated function "admin/api/2022-01/orders/order_id/fulfillments/fulfilment_id/complete.json", but i can't use this in the future.

 

I searched in the forum for this and the solution mentioned is to set "fulfillment_orders_opt_in = true".

If i do so, i'm able to call the "/admin/api/2022-10/fulfillment_orders/fulfillment_order_id/fulfillment_request/accept.json" and after this to update the Tracking url.

 

But this way, the "Fulfillment creation" Webhook is not working. I tested the "Order fulfillment" & "Fulfillment update" Webhooks too, but none of them works.

 

Is there a way to set this up to :

1) Receive a Webhook Call, when the Fulfilment is requested.

2) To Update the order with the Tracking Information with an API Call

 

PS This is how i setup the Service : 

{
"fulfillment_service": {
"id": 632310658,
"name": "api_test",
"email": null,
"service_name": "api_test",
"handle": "api_test",
"fulfillment_orders_opt_in": true,
"include_pending_stock": false,
"provider_id": null,
"location_id": 702608204,
"callback_url": "https:\/\/www.myurl.de\/index.php?route=api\/shopify_custom_hook",
"tracking_support": true,
"inventory_management": true,
"admin_graphql_api_id": "gid:\/\/shopify\/ApiFulfillmentService\/632310658",
"permits_sku_sharing": false
}
}

 

And the URL https://www.myurl.de/index.php?route=api/shopify_custom_hook/fulfillment_order_notification is accessible

 

Thanks and Regards

Reply 1 (1)

ShopifyDevSup
Shopify Staff
1357 225 475

Hi @Tobias_HK 👋

There appears to be some confusion around fulfillment service workflow. Fulfillment apps need to set up an endpoint on a callback URL where Shopify will send the notifications for fulfillment requests. This is a different notification from the `fulfillments/create` webhook topic and requires different access scopes. 

Once your endpoint receives the fulfillment request, you can retrieve assigned fulfillment order requests using the `assigned_fulfillment_orders` endpoint and accept the requests using the `fulfillment_request/accept` endpoint

 

Then you can create the fulfillment and update the tracking info using `fulfillments` endpoint

I'd recommend reviewing this guide that outlines the entire workflow for fulfillment service apps. 

 

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