Happening now | Shopify Community AMA: SEO Basics with 2H Media | Ask your questions now!

Receiving 422 error when using fulfillment.json

Receiving 422 error when using fulfillment.json

netCentrix
New Member
4 0 0

we have a custom app on a store and are migrating to the newest method of updating shipments (fulfillment.json)

 

We have checked our app's permissions but each time we attempt a shipment, we get a 422.

 

url we are hitting:  https:/[domain].myshopify.com/admin/api/2023-07/fulfillments.json

 

Below is an example of what we are sending:

 

{
"fulfillment":{
"message":"The package was shipped",
"notify_customer":true,
"tracking_info":{
"number":"1Z9XY993YW98456905",
"company":"UPS"
},
"line_items_by_fulfillment_order":
[
{
"fulfillment_order_id":5724701819015,
"fulfillment_order_line_items":
[
{
"id":11732955168903,
"quantity":1
},
{
"id":11732955201671,
"quantity":1
}
]
}
]
}
}

 

Any other things we should check?  we are getting fulfillment_order_id from another call  (I verified its the same value that the shopify portal uses when clicking on Fulfill Item

 

Thanks!

 

Replies 3 (3)

chetancrao
Shopify Partner
42 5 5

Hello @netCentrix,

 

Thank you for reaching out to the Shopify community.

 

I understand that you are currently experiencing difficulties in fulfilling orders using the API. In order to assist you further, I kindly request you to review the following checklists:

 

To provide visual clarity, I have attached a screenshot of the response for your reference.
Screenshot 2023-07-17 at 12.39.50 PM.png

  • Create Fulfillment Order API: Once you have obtained the necessary fulfillment_order_id and fulfillment_order_line_item_id, please verify that you are utilizing the correct API endpoint to create the fulfillment order. The API details are as follows:

    Endpoint: https://{your-shopify-url}/admin/api/2023-07/fulfillments.json
    Request Method: POST

Upon verification, please provide the response in detail produced by Shopify and the HTTP status code associated with this API call.

 

I kindly request you to attempt the suggested solutions and assess whether they prove helpful in resolving the issue you are facing with creating fulfillment for your orders.

 

Should you have any further inquiries or require additional assistance, please do not hesitate to reach out.

 

Thank you.

Cheetos || Recurpay Subscriptions

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
AbhiVirtuzo
Visitor
1 0 0

Hi.

 

I have a working API 

https://{your-shopify-url}/admin/api/2023-07/orders/{order_id}/fulfillment_orders.json

 

This is working fine and providing below response

{
    "fulfillment_orders": [
        {
            "id"6533298028839,
            "shop_id"76127109415,
            "order_id"5605737890087,
            "assigned_location_id"83415892263,
            "request_status""unsubmitted",
            "status""open",
            "supported_actions": [
                "create_fulfillment",
                "hold"
            ],
            "destination"null,
            "line_items": [
                {
                    "id"14488532189479,
                    "shop_id"76127109415,
                    "fulfillment_order_id"6533298028839,
                    "quantity"1,
                    "line_item_id"14348804718887,
                    "inventory_item_id"47698783076647,
                    "fulfillable_quantity"1,
                    "variant_id"45647587868967
                }
            ],
            "international_duties"null,
            "fulfill_at""2023-10-31T04:00:00-04:00",
            "fulfill_by"null,
            "fulfillment_holds": [],
            "created_at""2023-10-31T04:12:21-04:00",
            "updated_at""2023-10-31T04:12:21-04:00",
            "delivery_method": {
                "id"599686086951,
                "method_type""none",
                "min_delivery_date_time"null,
                "max_delivery_date_time"null
            },
            "assigned_location": {
                "address1""XXXXX",
                "address2""",
                "city""XXX",
                "country_code""XX",
                "location_id"83415892263,
                "name""XXXX",
                "phone""XXXX",
                "province""XXX",
                "zip""XXXX"
            },
            "merchant_requests": []
        }
    ]
}

 

Then I am using this endpoint

https://{your-shopify-url}/admin/api/2023-10/fulfillments.json 

with below parameters 

{
  "fulfillment": {
    "location_id"83415892263,
    "notify_customer"false,
    "line_items_by_fulfillment_order": [
      {
        "fulfillment_order_id"6533298028839
      }
    ]
  }
}
 
But we are getting below response
{
    "errors""Not Found"
}
 
Any help will be appriciated.
JovanniGuerra
Visitor
2 0 0

Sorry but I am getting the same error, have you been able to fix it?