422 Error Creating Fulfillment for Order

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”:

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.

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”
]
}
}

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.

Sure, here are some of my orders:

1297580228672
1297480548416
1297543987264
1297443946560

My store front is: legacytouch.myshopify.com

Thanks,
Bill

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?

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”,
“url”: “http://www.nzpost.co.nz/tools/tracking?trackid=AA1234567890NZ
},
“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”: {


}

}

I found the problem is that you have to first accept the fulfillment request from your fulfillment service before creating the fulfillment.

Check out the acceptFulfillmentRequest mutation here. I don’t believe it’s possible to accept a fulfillment request through the REST API, but could be wrong.

2 Likes