422 Error Creating Fulfillment for Order

Highlighted
New Member
2 0 1

I'm using the shopify-api-node module to POST an order fulfillment (docs)
422 http error is thrown when creating a fulfillment for one specific order for a merchant. I have the order JSON saved should that be of assistance. Here is a snippet from the thrown error:

{ HTTPError: Response code 422 (Unprocessable Entity)
    at stream.catch.then.data (/Users/{localusername}/Projects/{projectname}/node_modules/got/index.js:386:13)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
  name: 'HTTPError',
  host: undefined,
  hostname: 'wholelattelove.myshopify.com',
  method: 'POST',
  path: '/admin/orders/998723125302/fulfillments.json',
  protocol: 'https:',
  url: undefined,
  statusCode: 422,
  statusMessage: 'Unprocessable Entity'


The order consists of 3 items. 1 is physical. 2 are digitial. Thus, the line items are grouped into was looks like two separate "unfulfillments":

 

unfulfilled-status.png



 

 

 

 

 

 

 

 

 

 

 

 

Everything else in the order json appears fine, so it is puzzling why this order failed. Is it possible for the Shopify support team examine logs for this order? I can supply an order ID.

0 Likes
Highlighted
New Member
2 0 0

I am having the same issue, any isight would be helpful, as this just started today, and hasn't been an issue for the last month.

 

The response that I get back is a 422 Unprcoessable Entity, with the body of the response as:

 

{
"errors": {
"base": [
"An error occurred, please try again"
]
}
}

0 Likes
Highlighted
Shopify Staff
Shopify Staff
486 42 107

Thanks for the report @bansavage , @bterry   Order IDs will definitely help, if you could post them here that would be great.  Another thing to help us troubleshoot would be the X-Request-ID you receive in response from your API call that fails.

Developer Experience @ Shopify
0 Likes
Highlighted
New Member
2 0 0

Sure, here are some of my orders:

 

1297580228672  
1297480548416
1297543987264
1297443946560
 
My store front is:  legacytouch.myshopify.com
 
Thanks,
Bill
0 Likes
Highlighted
Shopify Staff
Shopify Staff
486 42 107

This does look like an issue, and we are investigating.  We are going to implement a change shortly that we believe will fix these 422 errors.  It looks like they are occurring in situations where your apps are attempting to create a fulfillment with some lines items that are marked as require_shipping: true and others with require_shipping: false.

 

Let me know if you are still encountering this issue moving forward as hopefully this change will prevent the error from re-occurring.

 

EDIT: This was fixed 07-17-2019

Developer Experience @ Shopify
0 Likes
Highlighted
New Member
1 0 0

@Ryan wrote:

This does look like an issue, and we are investigating.  We are going to implement a change shortly that we believe will fix these 422 errors.  It looks like they are occurring in situations where your apps are attempting to create a fulfillment with some lines items that are marked as require_shipping: true and others with require_shipping: false.

 

Let me know if you are still encountering this issue moving forward as hopefully this change will prevent the error from re-occurring.

 

EDIT: This was fixed 07-17-2019


Hi Ryan,

We're currently facing this error, still: base - An error occurred, please try again

The order got error has only one time with require_shipping: false. Could you please help to identify why it happened?

0 Likes
Highlighted
New Member
1 0 0

I am suffering the same problem but with a single item on a test website:

Result

422 Unprocessable Entity

{

"errors": 
  "Cannot create fulfillment for the fulfillment order."
 

}

 

Create Fulfillment Request
 
{
  "fulfillment": {
    "message": "The package was shipped this morning.",
    "notify_customer": false,
    "tracking_info": {
      "number": "AA1234567890NZ",
      "company": "New Zealand Post",
    },
    "line_items_by_fulfillment_order": [
      {
        "fulfillment_order_id": 2613406630044,
        "fulfillment_order_line_items": [
          {
            "id": 7383807459484,
            "quantity": 1
          }
    ]
      }
    ]
  }
}

 

Fulfillment Order

 

"fulfillment_orders": 

  {
"id": 2613406630044
"shop_id": 49548099740
"order_id": 2819188228252
"assigned_location_id": 56569495708
"fulfillment_service_handle": "pachealth-fulfillment"
"request_status": "submitted"
"status": "open"
"supported_actions": 
  "create_fulfillment"
 
"destination": {
...
}
"line_items": 
  {
"id": 7383807459484
"shop_id": 49548099740
"fulfillment_order_id": 2613406630044
"quantity": 1
"line_item_id": 6151601488028
"inventory_item_id": 38438906921116
"fulfillable_quantity": 1
"variant_id": 36389564711068
}
"outgoing_requests":  ...
"assigned_location": {
...
}
 
}
0 Likes