REST Admin API - Unable to request/accept fulfillment using fulfillment service app

REST Admin API - Unable to request/accept fulfillment using fulfillment service app

agaonkar
Excursionist
33 0 3

I am trying to use the Fulfillment Service app to fulfill a given order.

Steps tried:

1. Created a fulfillment service app via REST Admin API (POST admin/api/2023-10/fulfillment_services.json)

This created a location on Shopify.

 

2. Created a new product and stocked the inventory in the above location (Fulfillment service app)

 

3. Create an order using the above product

 

4. Requested for Fufillment from Orders page from the UI which was successful

 

5. Tried to accept the fulfillment using the REST Admin API (POST admin/api/2023-10/fulfillment_orders/fulfillment_order_id/fulfillment_request/accept.json)

This action gives the below error

{
    "errors": [
        "The fulfillment order is not assigned to the requesting fulfillment service."
    ]
}
I am not sure what is going wrong or if there is any setting missing.
 
Also the following API gives me no results
GET admin/api/2023-10/assigned_fulfillment_orders.json?assignment_status=fulfillment_requested
{
    "fulfillment_orders": []
}
 
However I am able to fetch the fulfillment order for my order using GET admin/api/:version/orders/:order_id/fulfillment_orders.json
 
Also I am able to request fufillment via the UI but from the REST Admin API I get the below error.
POST admin/api/2023-10/fulfillment_orders/fulfillment_order_id/fulfillment_request.json
{
    "errors": [
        "Cannot request fulfillment for the fulfillment order."
    ]
}
 
Can someone please help me in understanding how can we link the fulfillment order with the fulfillment service app and how the flow works. I have gone through all the documents but could not find much information.
 
Replies 2 (2)

Liam
Community Manager
3108 340 871

Hi Agaonkar,

 

Based on the error message that you're seeing, it seems like the fulfillment order hasn't been assigned to the fulfillment service you created. Here's a few things you can check for troubleshooting:

  1. Ensure that you are using the correct fulfillment service. When creating a product, you can assign it to a specific fulfillment service. You should ensure that the product you're trying to fulfill is indeed assigned to the fulfillment service that you created.

  2. Check if the fulfillment service app is properly configured. You should make sure that your app is registered as a fulfillment service. You can do this by going to the "App setup" page in your Shopify Partner dashboard and checking that your app is listed under "Fulfillment services".

  3. Check the fulfillment order's status. You can only accept fulfillment requests that are in the "fulfillment_requested" status. If the order has a different status (like "cancelled", "fulfilled" or "in_progress"), you won't be able to accept the fulfillment request.

Test out the above and let us know if you're still seeing issues. 

Liam | Developer Advocate @ 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

agaonkar
Excursionist
33 0 3

Hi Liam,

Thanks for the quick reply.

Regarding point 1, when I try to do that I still see fulfillment_service:"manual" in the Products response. Please see below.

agaonkar_0-1699269654775.png

Also I have assigned my fulfillment service to the product in the following manner.

agaonkar_1-1699269876121.png

 

Is there any other way of doing this step?

 

Regarding point 2, I created the fulfillment service app using the REST Admin API admin/api/2023-10/fulfillment_services.json. This created a location on shopify store.

agaonkar_2-1699270301894.png

 

 

 

Also I do not see this in the Partner Dashboard -> App setup" page in your Shopify Partner dashboard and checking that your app is listed under "Fulfillment services".

I do see my app which we use for authentication. Is there any other app we need to create.