Solved

Order fulfillment API command sent but didn't receive any response from shopify end

khossain
Excursionist
18 2 4

Dear Experts,

 

After upgrading API version from 2022-04 to 2022-10, the Order fulfillment command executed but no response received from shopify.

 

End point: https://***********************/api/2022-10/orders/50162****/fulfillments.json

 

payload:

{
"fulfillment":{
"location_id":350715****
,"tracking_number":"6487****"
,"tracking_company":"FedEx"
}
}

 

Could you please help me what's wrong with my command. It has been working since 1 year without any issue but using new API version no response received from shopify

 

Thank you,

Kamal Hossain

Accepted Solution (1)
khossain
Excursionist
18 2 4

This is an accepted solution.

The issue is fixed:

 

What I did for the successful execution:

 

first I sent GET request to pick the fulfillment order ID:

admin/api/2022-10/orders/5016212****/fulfillment_orders.json

 

Second... after having the fulfillment order ID I sent a POST request using the following Endpoint along with payload and the response is success

 

Endpoint:

p_end_point := '/admin/api/2022-10/fulfillments.json'

Payload:

 

lv_mutation_payload := '{
  "fulfillment": {
    "line_items_by_fulfillment_order": [
      {
        "fulfillment_order_id": 6000406****
      }
    ],
    "tracking_info": {
      "number": "648721838***",
      "company": "FedEx"
    }
  }
}';

 

Thank you Liam for your help providing the correct documentation.

View solution in original post

Replies 9 (9)

Liam
Shopify Staff
2731 299 769

Hi Kamal,

 

Are you getting no response at all back from Shopify - or an error message (eg: 404?) 

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

khossain
Excursionist
18 2 4

Hi Liam,

 

The response is null and at my end no error is logged. Only one changed I have made is...the API version upgraded 2022-04 to 2022-10. After changing none of the fulfillment worked.

 

Thank you,

Kamal

 

khossain
Excursionist
18 2 4

Hi Liam,

 

I debugged the process separately and I found the response code "HTTP response status code: 404"

 

My regular package process storing response as NULL but to be confirmed I executed separately out of package and found the response as mentioned above.

 

is that something the API version 2022-10 , the payload and endpoint structured is different? the same process working good in 2022-04

 

please advise

Thank you.

Kamal

Liam
Shopify Staff
2731 299 769

Hi again Kamal,

 

There were recent deprecations on some endpoints on the Fulfillment API which could be affecting this - especially if the same is working correctly on an earlier version. 

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

khossain
Excursionist
18 2 4

Thank you Liam. I actually could not understand what steps do I need to take to perform the execution successfully.

 

I changed the endpoint and payload as mentioned below but no luck. Could you suggest me what the correct format to call for both endpoint and payload.

 

Endpoint:

p_end_point := '/admin/api/2022-10/fulfillments.json';

 

Payload: 

lv_payload := '{
  "fulfillment": {
    "line_items_by_fulfillment_order": [
      {
        "fulfillment_order_id": 499691
      }
    ],
    "tracking_info": {
      "number": "6368790",
      "company": "FedEx"
    }
  }
}';

 

Thank you,

Kamal

 

khossain
Excursionist
18 2 4

I changed the endpoint to the following

Endpoint:

 

admin/api/2022-10/orders/4996917***/fulfillment_orders.json

 

  Then the returned fulfillment order id I passed through the payload:

 

 

lv_mutation_payload := '{
  "fulfillment": {
    "line_items_by_fulfillment_order": [
      {
        "fulfillment_order_id": 5980286***
      }
    ],
    "tracking_info": {
      "number": "636879022269",
      "company": "FedEx"
    }
  }
}';

 

 and then I am receiving the following status:

 

HTTP response status code: 422

 

 

could you please advise

 

 

Thank you,

Kamal

 

khossain
Excursionist
18 2 4

The correct response I traced in my log as mentioned below:

 

 

422-{"errors":["Fulfillment order 59802869*** has an unfulfillable status= closed."]}

 

khossain
Excursionist
18 2 4

This is an accepted solution.

The issue is fixed:

 

What I did for the successful execution:

 

first I sent GET request to pick the fulfillment order ID:

admin/api/2022-10/orders/5016212****/fulfillment_orders.json

 

Second... after having the fulfillment order ID I sent a POST request using the following Endpoint along with payload and the response is success

 

Endpoint:

p_end_point := '/admin/api/2022-10/fulfillments.json'

Payload:

 

lv_mutation_payload := '{
  "fulfillment": {
    "line_items_by_fulfillment_order": [
      {
        "fulfillment_order_id": 6000406****
      }
    ],
    "tracking_info": {
      "number": "648721838***",
      "company": "FedEx"
    }
  }
}';

 

Thank you Liam for your help providing the correct documentation.

Liam
Shopify Staff
2731 299 769

Great to hear Kamal!!

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