Hi everyone,
I’m facing an issue with fulfilling orders using the Shopify API. Here’s the flow I’m trying to implement:
Step 1: Fetch the Fulfillment Order ID for a specific order.
Step 2: Use this Fulfillment Order ID to create a fulfillment via the API.
However, I’m encountering difficulties in either retrieving the Fulfillment Order ID or correctly creating the fulfillment. Below is the flow I’m following:
Fetching the Fulfillment Order ID using this endpoint:
GET
[https://store-url/admin/api/2024-10/orders/](https://store-url/admin/api/2024-10/orders/)${numericOrderId}.json,
The response seems correct, but when I
Creating the Fulfillment using this endpoint:
POST
[https://store-url/admin/api/2024-10/](https://store-url/admin/api/2024-10/)${numericOrderId}/fulfillments.json,
fulfillmentData,
{
headers: {
‘X-Shopify-Access-Token’: accessToken,
‘Content-Type’: ‘application/json’,
},
},
{
“fulfillment”: {
“location_id”: “gid://shopify/Location/123456”,
“line_items”: [
{
“id”: 123456
}
]
}
}
I’m providing the location ID and fulfillment order ID, but the request doesn’t seem to go through successfully. Here’s the structure I’m using:
Has anyone faced this issue before or can offer any guidance on what might be wrong with the request format or data?
Thanks in advance!