Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hello,
I'm trying to fulfil a specific product with the http request in flow.
This is what I currently have that doesn't seem to be working:
Here is the code in the Body:
{
"query": "mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {
fulfillmentCreateV2(fulfillment: $fulfillment) {
fulfillment { id }
userErrors { field message }
}
}",
"variables": {
"fulfillment": {
"lineItemsByFulfillmentOrder": {
"fulfillmentOrderId": "{{order.id}}",
"fulfillmentOrderLineItems": {
"id": "gid://shopify/FulfillmentOrderLineItem/6604087001287","quantity": 1
}
}
}
}
}
This is the error I am getting:
The request was unsuccessful {"status":400,"response_body":"Bad Request","verb":"POST","url":"https://regalrose.myshopify.com/admin/api/2024-01/graphiql.json","request_body":"{ \"query\": \"mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment { id }\n userErrors { field message }\n }}\",\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/Order/5635452141767\",\n \"fulfillmentOrderLineItems\": {\n \"id\": \"gid://shopify/FulfillmentOrderLineItem/6604087001287\",\"quantity\": 1\n }\n }\n }\n }\n}"}
Any help would be appreciated. Thank you.
Solved! Go to the solution
This is an accepted solution.
Your URL is incorrect. It ends in graphql.json not graphiql.json
You may also have to remove white space from your body fields, as newlines can cause the JSON to be invalid. Here's an example that works:
{ "query": "mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) { fulfillmentCreateV2(fulfillment: $fulfillment) { fulfillment { id } userErrors { field message } } }", "variables": { "fulfillment": { "lineItemsByFulfillmentOrder": [{% for fo in order.fulfillmentOrders %}{ "fulfillmentOrderId": "{{fo.id}}"}{% unless forloop.last %}, {% endunless %}{% endfor %}]}}}
This is an accepted solution.
Your URL is incorrect. It ends in graphql.json not graphiql.json
You may also have to remove white space from your body fields, as newlines can cause the JSON to be invalid. Here's an example that works:
{ "query": "mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) { fulfillmentCreateV2(fulfillment: $fulfillment) { fulfillment { id } userErrors { field message } } }", "variables": { "fulfillment": { "lineItemsByFulfillmentOrder": [{% for fo in order.fulfillmentOrders %}{ "fulfillmentOrderId": "{{fo.id}}"}{% unless forloop.last %}, {% endunless %}{% endfor %}]}}}
Thank you for your help. I copied your code and changed the url and the request went through fine.
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025