REST API - How to update order fulfillment_status

Solved
Highlighted
Shopify Partner
12 2 2

As I'm not sure if I'm going about this the right way let me first give some context to my question.

 

I want to update the fulfillment_status or some other status of the order during it's lifecycle i.e. it's journey from purchase to delivery. Is there a way to update an order's intermediate fulfillment or other status to something similar to "being picked" or "pending" or "awaiting stock" prior to it being marked as "fulfilled"?

 

In my case I have downloaded my recent unfilfilled orders that have been paid and the fulfillment_status-null. I have then either fulfilled those orders or am in the process of doing so pending the arrival of stock or the next delivery collection from our warehouse site etc i.e. the order fulfillment_status is updated to "fulfilled" or "partial" respectively in these two scenarios (though I'd prefer a different status to partial if possible).

 

I have tried to update the fulfillment_status of the order but it hasn't done anything and the value remains "null" as per the example below (I've also tried updating the fulfillment_status to partial also without success):

 

PUT /admin/api/2019-07/orders/450789469.json
{
  "order": {
    "id": 450789469,
    "fulfillment_status": "fulfilled"
  }
}

 

Am I doing the update correctly or is there a better/alternative way of managing the order life cycle? For example is there another orders field that can be used for a pending fulfillment/shipment status?

 

I also notice that there is a fulfillments endpoint but it requires a fulfillment_id which is empty in my orders i.e. orders.fulfillments array is empty.

 

Ghulam

0 Likes
Highlighted
Shopify Partner
12 2 2

I managed to update the fulfillment_status of my order using the fulfillment endpoint by creating a new fulfillment for the order as below.

 

POST /admin/api/2019-07/orders/#{order_id}/fulfillments.json
{
  "fulfillment": {
    "location_id": 1234567,
    "tracking_number": "pending"
  }
}

 

I wanted to update the fulfillment.status to "pending" but instead it incorrectly (?) updated the status to "success" and the orders.fulfillment_status is now "fulfilled".

 

To experiment I also updated the fulfillment.status of another order (by creating a new fulfillment) to "open" and while it correctly updated the status to "open" and the orders.fulfillment_status is still "null".

 

Is this a bug in the API or am I making a mistake somewhere?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1129 82 179

This is an accepted solution.

Hey @gdastgir , 

 

It looks like you tried to set the tracking number to pending in the call that you linked - that won't have any effect, you'd want to set a status. The 'open' and 'pending' fulfillment statuses are usually only seen when a fulfillment service is involved in a fulfillment as well, but it appears that API clients can set a status of 'open' too. 

 

It will only be seen as a status on the fulfillment object that is created on the order though, and not as a fulfillment status on the order itself. So if that is information that you wanted to provide to a user somewhere, you can get it from the fulfillment on an order - just not the order's fulfillment_status based on what I've seen. I would only expect the values of fulfillment_status listed here to apply to the order's fulfillment_status field, but if you find any values that are not documented by all means please let me know. 

0 Likes
Highlighted
Shopify Partner
12 2 2

This is an accepted solution.

Hi Josh

 

thanks for your reply. In my previous post I made a copy and paste typo and in reality I was updating the status field to 'pending' and not the tracking_url field :)

 

In my tests I've found the exact same behaviour you describe i.e. API clients can set status to 'open' which create a fulfillment for the order.

 

For now as we are still launching our store we will not create an 'open' status fulfillment but will create a final fulfillment with the relevant tracking info only once the order has been shipped as this seems to me to be a more logical use of fulfillments and simpler.

 

As we do our own in-house fulfillment and have no plans on using a 3rd party fulfillment provider then I assume there is absolutely no reason to use Fulfillment Service.

 

Ghulam

0 Likes
Highlighted
Excursionist
11 0 6

Hi, I am testing it with postman but the order is still unfilled. Can you help?

 

URL: /admin/api/2020-04/orders/2339376562257/fulfillments.json

 

Here is my added raw data:

 

Screenshot 2020-06-05 at 21.06.19.png

 

but I am getting following response

 

Screenshot 2020-06-05 at 21.04.18.png

0 Likes
Highlighted
New Member
4 0 0

try clean your postman cookies

0 Likes