Error while creating Fulfillment via API

Error while creating Fulfillment via API

Isourse_Tech
Shopify Partner
1 0 0

Using the fullfillment API , to create fullfillment but getting :

422 Unprocessable Content
{
    "errors": [
        "Fulfillment payloads fulfillment order must be greater than 0"
    ]
}
 
Request :
{
  "fulfillment": {
    "location_id": 78882865367,
    "tracking_number": "123456789",

        "line_items_by_fulfillment_order": [
          {
            "id": 14073330565335,
            "quantity": 1
          }
    ]
  }
}
Reply 1 (1)

PageFly-Amelia
Shopify Partner
576 162 232

This is Amelia from PageFly - Landing Page Builder App

To troubleshoot and resolve this issue, please follow these steps:

  1. Include Fulfillment Order ID:
    Ensure that the line_items_by_fulfillment_order array contains the fulfillment_order_id for each line item. This ID is crucial for the API to process the fulfillment correctly.

  2. Correct Request Format:
    Make sure your request includes the fulfillment_order_id. Here’s an example of how your request should be structured:

    json

 

 

{
  "fulfillment": {
    "location_id": 78882865367,
    "tracking_number": "123456789",
    "line_items_by_fulfillment_order": [
      {
        "fulfillment_order_id": 1234567890,  // Replace with the actual fulfillment order ID
        "line_items": [
          {
            "id": 14073330565335,
            "quantity": 1
          }
        ]
      }
    ]
  }
}​

 

 

Please review this AI-generated code and use it carefully. For more information, refer to the FAQ.

3. Retrieve Fulfillment Order ID:
If you don't have the fulfillment_order_id, you'll need to retrieve it first. Make a GET request to the Fulfillment Orders endpoint using the following format:

 

 

GET /admin/api/2023-10/orders/{order_id}/fulfillment_orders.json

 

 


This will return a list of fulfillment orders for the specified order, allowing you to obtain the fulfillment_order_id.

 4. Consult API Documentation:
Refer to the Shopify Fulfillment API documentation for detailed information regarding the required parameters and request structure.


Hope that my solution works for you.

Best regards,

Amelia | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.