Can't get fulfillments to work

Shopify Partner
3 0 0

I have tried everything per docs to get this working. I have created a fulfillment provider, assigned it to my single-variant product, I am able to use all other end points of your API but I can't for the life of me get a fulfillment created nor completed because it responds vaguely "Required parameter missing or invalid"

 

My orderID is correct, the line_items ID exists, the service is listed on the GET endpoint 'inklocker-delivery' and I have hardcoded the location ID for it. 1) It would be nicer to have more verbose errors. 2) I see no reason it shouldn't be working as it exactly how the docs prescribe the post object and all values do exist and appear valid.

 

I post to: 

https://inklocker-api-test.myshopify.com/admin/orders/893807329368/fulfillments.json

 

json post object: 

"fulfillment": {
"location_id": 15092285528,
"status": "success",
"line_items": [
{
"id": 2019930210392
}
]
}

0 Likes
Highlighted
Shopify Partner
1838 174 613

Hmm... I have absolutely no problem fulfilling orders using the endpoint.

 

I can only suggest you

  • Triple check the location_id and line_item id for given order id
  • Going to assume the JSON body you pasted also has the outer curlies when you do post it (it would throw a different error anyway)
  • Post your X-Request-Id from the response header so that Shopify staff can inspect the issue if they read this
I turn coffee in to code - since 1998
0 Likes
Highlighted
Shopify Partner
3 0 0

When I create the order the location_id is null. However this product has been assigned the custom fulfillment service I created which has a location_id and I use this ID when creating the fulfillment for the order_id posted above. Yeah the outer curly braces are present, I use the same posting format for other endpoints using POST just fine.  

X-Request-Id 0fab81c0-575f-43dd-80ba-6118bd50637e
0 Likes
Highlighted
Shopify Staff
Shopify Staff
297 32 63

Hey there,

 

In our logs I'm seeing that there is another key, transformedRefOrder, surrounding your JSON body. 

 

Can you double check to ensure that your JSON body follows the identical structure documented here:

{
  "fulfillment": {
    "location_id": 905684977,
    "tracking_number": null,
    "line_items": [
      {
        "id": 466157049,
        "quantity": 1
      }
    ]
  }
}
0 Likes
Highlighted
Shopify Partner
3 0 0

OK thanks Zameer! that indeed fixed the null fulfillments issue however now I'm seeing fulfillments with fulfillment_status set to null

and I'm following the doc for completing a fulfillment which I believe should update to 'shipped' or 'success' no? 

 

- Peter

0 Likes
Highlighted
Shopify Staff
Shopify Staff
297 32 63

Hey Peter,

 

Once you've created the fulfillment, you're seeing a status of "pending" because the line items use an external fulfillment service. 

 

It is up to the fulfillment service to then change the status to "open" or "success", once it's completed the necessary processing on it's end.

 

You can read more about this in our FulfillmentService and Fulfillment documentation.

0 Likes