Version: 2024-10
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation fulfillmentOrderSplit($fulfillmentOrderSplits: [FulfillmentOrderSplitInput!]!) { fulfillmentOrderSplit(fulfillmentOrderSplits: $fulfillmentOrderSplits) { fulfillmentOrderSplits { fulfillmentOrder { id lineItems(first: 10) { edges { cursor node { id totalQuantity } } } } remainingFulfillmentOrder { id lineItems(first: 10) { edges { cursor node { id totalQuantity } } } } } userErrors { field message } } }\",\n \"variables\": {\n \"fulfillmentOrderSplits\": [\n {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/1046000796\",\n \"fulfillmentOrderLineItems\": [\n {\n \"id\": \"gid://shopify/FulfillmentOrderLineItem/1058737504\",\n \"quantity\": 2\n }\n ]\n }\n ]\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation fulfillmentOrderSplit($fulfillmentOrderSplits: [FulfillmentOrderSplitInput!]!) {\n fulfillmentOrderSplit(fulfillmentOrderSplits: $fulfillmentOrderSplits) {\n fulfillmentOrderSplits {\n fulfillmentOrder {\n id\n lineItems(first: 10) {\n edges {\n cursor\n node {\n id\n totalQuantity\n }\n }\n }\n }\n remainingFulfillmentOrder {\n id\n lineItems(first: 10) {\n edges {\n cursor\n node {\n id\n totalQuantity\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"fulfillmentOrderSplits\": [\n {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/1046000796\",\n \"fulfillmentOrderLineItems\": [\n {\n \"id\": \"gid://shopify/FulfillmentOrderLineItem/1058737504\",\n \"quantity\": 2\n }\n ]\n }\n ]\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation fulfillmentOrderSplit($fulfillmentOrderSplits: [FulfillmentOrderSplitInput!]!) {\n fulfillmentOrderSplit(fulfillmentOrderSplits: $fulfillmentOrderSplits) {\n fulfillmentOrderSplits {\n fulfillmentOrder {\n id\n lineItems(first: 10) {\n edges {\n cursor\n node {\n id\n totalQuantity\n }\n }\n }\n }\n remainingFulfillmentOrder {\n id\n lineItems(first: 10) {\n edges {\n cursor\n node {\n id\n totalQuantity\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"fulfillmentOrderSplits\": [{\"fulfillmentOrderId\"=>\"gid://shopify/FulfillmentOrder/1046000796\", \"fulfillmentOrderLineItems\"=>[{\"id\"=>\"gid://shopify/FulfillmentOrderLineItem/1058737504\", \"quantity\"=>2}]}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<[{\"fulfillmentOrderId\"=>\"gid://shopify/FulfillmentOrder/1046000796\", \"fulfillmentOrderLineItems\"=>[{\"id\"=>\"gid://shopify/FulfillmentOrderLineItem/1058737504\", \"quantity\"=>2}]}],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation fulfillmentOrderSplit($fulfillmentOrderSplits: [FulfillmentOrderSplitInput!]!) {\n fulfillmentOrderSplit(fulfillmentOrderSplits: $fulfillmentOrderSplits) {\n fulfillmentOrderSplits {\n fulfillmentOrder {\n id\n lineItems(first: 10) {\n edges {\n cursor\n node {\n id\n totalQuantity\n }\n }\n }\n }\n remainingFulfillmentOrder {\n id\n lineItems(first: 10) {\n edges {\n cursor\n node {\n id\n totalQuantity\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"fulfillmentOrderSplits\": [\n {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/1046000796\",\n \"fulfillmentOrderLineItems\": [\n {\n \"id\": \"gid://shopify/FulfillmentOrderLineItem/1058737504\",\n \"quantity\": 2\n }\n ]\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation fulfillmentOrderSplit($fulfillmentOrderSplits: [FulfillmentOrderSplitInput!]!) {\n fulfillmentOrderSplit(fulfillmentOrderSplits: $fulfillmentOrderSplits) {\n fulfillmentOrderSplits {\n fulfillmentOrder {\n id\n lineItems(first: 10) {\n edges {\n cursor\n node {\n id\n totalQuantity\n }\n }\n }\n }\n remainingFulfillmentOrder {\n id\n lineItems(first: 10) {\n edges {\n cursor\n node {\n id\n totalQuantity\n }\n }\n }\n }\n }\n userErrors {\n field\n message\n }\n }\n}"
input: { "fulfillmentOrderSplits": [ { "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/1046000796", "fulfillmentOrderLineItems": [ { "id": "gid://shopify/FulfillmentOrderLineItem/1058737504", "quantity": 2 } ] } ] }
response: { "data": { "fulfillmentOrderSplit": { "fulfillmentOrderSplits": [ { "fulfillmentOrder": { "id": "gid://shopify/FulfillmentOrder/1046000796", "lineItems": { "edges": [ { "cursor": "eyJsYXN0X2lkIjoxMDU4NzM3NTAzLCJsYXN0X3ZhbHVlIjoxMDU4NzM3NTAzfQ==", "node": { "id": "gid://shopify/FulfillmentOrderLineItem/1058737503", "totalQuantity": 1 } } ] } }, "remainingFulfillmentOrder": { "id": "gid://shopify/FulfillmentOrder/1046000797", "lineItems": { "edges": [ { "cursor": "eyJsYXN0X2lkIjoxMDU4NzM3NTA0LCJsYXN0X3ZhbHVlIjoxMDU4NzM3NTA0fQ==", "node": { "id": "gid://shopify/FulfillmentOrderLineItem/1058737504", "totalQuantity": 2 } } ] } } } ], "userErrors": [] } } }