Development discussions around Shopify APIs
I am really new to the Shopify API and I am now facing the task of connecting an API with an external vendor. I have managed to set up the API with running some JS on via the App "Cloud Hooks" however I am facing some issues when trying to post the fulfillment details to shopify.
Currently I'm just testing the post and can't seem to get it working. All I get is a generic 400 Bad Request without further information.
I'm sure doing such a thing should be pretty common for some veteran shopify devs. Could someone give me a hand? I tried casting the non string values to strings and still had the same response.
Thanks and kind regards,
PS: The authentication worked fine so that shouldn't be the issue.
Btw, I tried it like this initialy.
Also both the order number and the line_item_id where taken from actual orders off of my store.
I've used this endpoint extensively, although not recently.
Assuming your IDs for the order and order_items are correct, I'd check if fulfillments already exist on the order. Store settings can have a fulfillment created early in the lifecycle automatically, which you would need to "complete" rather than create a new fulfillment. Alternatively, you could cancel the existing fulfillment to allow you to create a new one.
Thanks for your swift response!
So I've checked the order json and the fulfillments array is still initial and the I checked the order id by pasting it out of my code to the header and the line_item.id seems to be correct aswell:
Am I correct in thinking this endpoint should be used for partially fulfilling / for completely fulfilling depending on if all items are addressed or not? Or am I using the wrong endpoint. As I have quite a few different suppliers I want to use this endpoint to add the tracking info to only the line items that are from one vendor and add the shipping info that a receive as a response. Would this cause the order to be set to partially fulfilled / fulfilled respectively or have I misunderstood the endpoint?
Thanks in advance!
Your concept of partially fulfilling orders is correct.
Take a look at the `location` concept, as described in the note at the top of this doc:
I don't see a location_id in your request, which matches some of the example code. Elsewhere, the docs show it as required:
You might want to check out an app called Trackr.
It is an order tracking app that provides real-time information from more than 900 carriers globally. The app allows you to add an order tracking page to your store so that the customers can follow their parcel journey themselves by simply filling in their order information. And if you ever run into any trouble, their support time is very fast and effective. 🙂
As a business owner, have you ever wondered when your customer's first impression of yo...By Skye Jun 6, 2023
We're excited to announce improvements to the threaded messaging experience in our communi...By TyW May 31, 2023
Thank you to everyone who participated in our AMA with Klaviyo. It was great to see so man...By Jacqui May 30, 2023