One of the functions of my app is to create a Shopify Order, depending on certain info it receives it will either create the order as fulfilled, partially fulfilled or not fulfilled, the creation of an order, and even when creating a new order as fulfilled works perfectly.
The problem comes in when I want to fulfil an existing order after it has already been created (but wasn’t created as fulfilled, so either not or partially fulfilled).
The documentation itself is not very clear at all in regards to fulfilment of an existing order and the internet is a vast variety of different way of doing it, some with API endpoints that aren’t even listed on the Shopify docs.
it seems order fulfilment has changed dramatically over the past 2 years, so its a lucky packet of info out on the internet.
I have also noticed there seems to be ways to fulfil separate items on an order, or the entire order as a whole, but like it said the docs are not very clear surround this.
I basically just want to fulfil the entire order (not individual items) and then add a tracking number to the order,
so basically selecting “Other” as the tracking company, and the number will be the Purchase order number, nothing fancy.
If someone can please point me in the right direction, or advise on the data I need to post to the API & also which API endpoint it would be greatly appreciated
If additional information is required please feel free to ask & I will supply it to the best of my ability.
Would this Create a fulfillment with a tracking number of a Shopify unsupported tracking carrier, and therefore with a tracking url provided example be what you’re looking for here?
// Session is built by the OAuth process
const fulfillment = new shopify.rest.Fulfillment({session: session});
fulfillment.line_items_by_fulfillment_order = [
{
"fulfillment_order_id": 1046000853
}
];
fulfillment.tracking_info = {
"number": "MS1562678",
"url": "https://www.my-shipping-company.com?tracking_number=MS1562678"
};
await fulfillment.save({
update: true,
});
This is written in node.js but you can see how it would be structured with curl, Ruby or PHP on our docs here. There’s also other examples from the docs that you can modify to work with your preferred use case.