A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
This my code below:
var req = await unirest.post(`${process.env.BASE_URL}/admin/api/2023-01/fulfillments.json`)
.headers({
'X-Shopify-Access-Token': process.env.API_KEY
})
.send({
"fulfillment": {
"message":"Fulfilled Donation.",
"line_items_by_fulfillment_order": [
{
"fulfillment_order_id": item.fulfillment_order_id,
"fulfillment_order_line_items": [
{
"id": item.id,
"quantity": item.quantity
}
]
}
]
}
})
However it returns the error:
{ errors: { fulfillment: 'Required parameter missing or invalid' } }
Doesn't make sense as I've done as instructed via the dev docs here.
Hi There,
What is in "Item"? The only thing I can think of is something in your data is not right.
Cheers,
Gary
The fulfillments resource is in the past-tense e.g. fulfillments that have already happend. You cant use data from the fulfillments endpoint to fulfill an order. You need to use the fulfillmentorder endpoint.
e.g.
/admin/api/2023-04/orders/450789469/fulfillment_orders.json
Then from that you fill in your post request.
Cheers,
Gary