fulfillment Create V2mutation deprecated
Requires write
access scope, write
access scope or write
access scope. Also: The user must have fulfill_and_ship_orders permission.
Creates a fulfillment for one or many fulfillment orders.
The fulfillment orders are associated with the same order and are assigned to the same location. Use fulfillment
instead.
Arguments
The input fields used to create a fulfillment from fulfillment orders.
Anchor to messagemessageAn optional message for the fulfillment request.
FulfillmentCreateV2Payload returns
The created fulfillment.
The list of errors that occurred from executing the mutation.
Code examples for MUTATION: fulfillmentCreateV2
Query Reference for MUTATION: fulfillmentCreateV2
"mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n # Fulfillment fields\n }\n userErrors {\n field\n message\n }\n }\n}"
Input Reference for MUTATION: fulfillmentCreateV2
"{\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": [\n {\n \"fulfillmentOrderId\": \"gid://shopify/<objectName>/10079785100\",\n \"fulfillmentOrderLineItems\": [\n {\n \"id\": \"gid://shopify/<objectName>/10079785100\",\n \"quantity\": 1\n }\n ]\n }\n ],\n \"notifyCustomer\": true,\n \"originAddress\": {\n \"address1\": \"<your-address1>\",\n \"address2\": \"<your-address2>\",\n \"city\": \"<your-city>\",\n \"countryCode\": \"<your-countryCode>\",\n \"provinceCode\": \"<your-provinceCode>\",\n \"zip\": \"<your-zip>\"\n },\n \"trackingInfo\": {\n \"company\": \"<your-company>\",\n \"number\": \"<your-number>\",\n \"numbers\": [\n \"<your-numbers>\"\n ],\n \"url\": \"https://example.myshopify.com\",\n \"urls\": [\n \"https://example.myshopify.com\"\n ]\n }\n },\n \"message\": \"<your-message>\"\n}"
Schema Reference for MUTATION: fulfillmentCreateV2
"input FulfillmentV2Input {\n lineItemsByFulfillmentOrder: [FulfillmentOrderLineItemsInput!]!\n notifyCustomer: Boolean\n originAddress: FulfillmentOriginAddressInput\n trackingInfo: FulfillmentTrackingInput\n}\n\ninput FulfillmentOrderLineItemsInput {\n fulfillmentOrderId: ID!\n fulfillmentOrderLineItems: [FulfillmentOrderLineItemInput!]\n}\n\ninput FulfillmentOriginAddressInput {\n address1: String\n address2: String\n city: String\n countryCode: String!\n provinceCode: String\n zip: String\n}\n\ninput FulfillmentTrackingInput {\n company: String\n number: String\n numbers: [String!]\n url: URL\n urls: [URL!]\n}\n"
Display Examples for MUTATION: fulfillmentCreateV2
[ { "example": { "type_name": "fulfillmentcreatev2", "title": "Fulfill a fulfillment order", "description": "Create a fulfillment for all of the line items in a fulfillment order.", "query_string": "mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n}", "variables": { "fulfillment": { "lineItemsByFulfillmentOrder": { "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279" } } }, "response": { "data": { "fulfillmentCreateV2": { "fulfillment": { "id": "gid://shopify/Fulfillment/1069019872", "status": "SUCCESS" }, "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/fulfillments/test/unit/graph_api/admin/mutations/fulfillment_create_v2_test.rb", "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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) { fulfillmentCreateV2(fulfillment: $fulfillment) { fulfillment { id status } userErrors { field message } } }\",\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n }\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n }\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"fulfillment\" => [\n \"lineItemsByFulfillmentOrder\" => [\n \"fulfillmentOrderId\" => \"gid://shopify/FulfillmentOrder/940656279\",\n ],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "fulfillment", "description": "The input fields used to create a fulfillment from fulfillment orders.", "type": { "kind": "INPUT_OBJECT", "name": "FulfillmentV2Input", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "FulfillmentV2Input!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "fulfillment", "argValue": " {\"lineItemsByFulfillmentOrder\":{\"fulfillmentOrderId\":\"gid://shopify/FulfillmentOrder/940656279\"}}", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "fulfillmentcreatev2", "title": "Fulfill a fulfillment order with tracking data specified", "description": "Create a fulfillment with a UPS carrier company and a tracking number provided.\n\nWhen you specify a\n[Shopify-supported tracking company name](https://shopify.dev/api/admin-graphql/latest/objects/FulfillmentTrackingInfo#supported-tracking-companies),\nShopify will automatically build tracking urls for all tracking numbers provided.\nThe company name should directly match with one from the list (capitalization matters).\n", "query_string": "mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n}", "variables": { "fulfillment": { "lineItemsByFulfillmentOrder": { "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279" }, "trackingInfo": { "company": "UPS", "number": "1Z001985YW99744790" } } }, "response": { "data": { "fulfillmentCreateV2": { "fulfillment": { "id": "gid://shopify/Fulfillment/1069019868", "status": "SUCCESS", "trackingInfo": [ { "company": "UPS", "number": "1Z001985YW99744790", "url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790" } ] }, "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/fulfillments/test/unit/graph_api/admin/mutations/fulfillment_create_v2_test.rb", "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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) { fulfillmentCreateV2(fulfillment: $fulfillment) { fulfillment { id status trackingInfo(first: 10) { company number url } } userErrors { field message } } }\",\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"company\": \"UPS\",\n \"number\": \"1Z001985YW99744790\"\n }\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"company\": \"UPS\",\n \"number\": \"1Z001985YW99744790\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"company\": \"UPS\",\n \"number\": \"1Z001985YW99744790\"\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"company\": \"UPS\",\n \"number\": \"1Z001985YW99744790\"\n }\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"fulfillment\" => [\n \"lineItemsByFulfillmentOrder\" => [\n \"fulfillmentOrderId\" => \"gid://shopify/FulfillmentOrder/940656279\",\n ],\n \"trackingInfo\" => [\n \"company\" => \"UPS\",\n \"number\" => \"1Z001985YW99744790\",\n ],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "fulfillment", "description": "The input fields used to create a fulfillment from fulfillment orders.", "type": { "kind": "INPUT_OBJECT", "name": "FulfillmentV2Input", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "FulfillmentV2Input!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "fulfillment", "argValue": " {\"lineItemsByFulfillmentOrder\":{\"fulfillmentOrderId\":\"gid://shopify/FulfillmentOrder/940656279\"},\"trackingInfo\":{\"company\":\"UPS\",\"number\":\"1Z001985YW99744790\"}}", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "fulfillmentcreatev2", "title": "Fulfill a fulfillment order with two tracking numbers and a supported tracking company name specified", "description": "Create a fulfillment with a UPS carrier company and a two tracking numbers provided.\n\nWhen you specify a\n[Shopify-supported tracking company name](https://shopify.dev/api/admin-graphql/latest/objects/FulfillmentTrackingInfo#supported-tracking-companies),\nShopify will automatically build tracking urls for all tracking numbers provided.\nThe company name should directly match with one from the list (capitalization matters).\n", "query_string": "mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n}", "variables": { "fulfillment": { "lineItemsByFulfillmentOrder": { "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279" }, "trackingInfo": { "company": "UPS", "numbers": [ "1Z001985YW99744790", "1Z001985YW99744791" ] } } }, "response": { "data": { "fulfillmentCreateV2": { "fulfillment": { "id": "gid://shopify/Fulfillment/1069019870", "status": "SUCCESS", "trackingInfo": [ { "company": "UPS", "number": "1Z001985YW99744790", "url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744790" }, { "company": "UPS", "number": "1Z001985YW99744791", "url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z001985YW99744791" } ] }, "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/fulfillments/test/unit/graph_api/admin/mutations/fulfillment_create_v2_test.rb", "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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) { fulfillmentCreateV2(fulfillment: $fulfillment) { fulfillment { id status trackingInfo(first: 10) { company number url } } userErrors { field message } } }\",\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"company\": \"UPS\",\n \"numbers\": [\n \"1Z001985YW99744790\",\n \"1Z001985YW99744791\"\n ]\n }\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"company\": \"UPS\",\n \"numbers\": [\n \"1Z001985YW99744790\",\n \"1Z001985YW99744791\"\n ]\n }\n }\n },\n },\n);\n\nconst data = await response.json();\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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"company\": \"UPS\",\n \"numbers\": [\"1Z001985YW99744790\", \"1Z001985YW99744791\"]\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"company\": \"UPS\",\n \"numbers\": [\n \"1Z001985YW99744790\",\n \"1Z001985YW99744791\"\n ]\n }\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"fulfillment\" => [\n \"lineItemsByFulfillmentOrder\" => [\n \"fulfillmentOrderId\" => \"gid://shopify/FulfillmentOrder/940656279\",\n ],\n \"trackingInfo\" => [\n \"company\" => \"UPS\",\n \"numbers\" => [\"1Z001985YW99744790\", \"1Z001985YW99744791\"],\n ],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "fulfillment", "description": "The input fields used to create a fulfillment from fulfillment orders.", "type": { "kind": "INPUT_OBJECT", "name": "FulfillmentV2Input", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "FulfillmentV2Input!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "fulfillment", "argValue": " {\"lineItemsByFulfillmentOrder\":{\"fulfillmentOrderId\":\"gid://shopify/FulfillmentOrder/940656279\"},\"trackingInfo\":{\"company\":\"UPS\",\"numbers\":[\"1Z001985YW99744790\",\"1Z001985YW99744791\"]}}", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "fulfillmentcreatev2", "title": "Fulfill a fulfillment order with two tracking numbers and tracking urls from different tracking tracking providers", "description": "Create a fulfillment with two tracking numbers and tracking urls.\n\nFor example, you are fulfilling a kitchen table.\nThe table top is sent in one parcel, and the table legs are sent in the second parcel\nwith a different tracking number.\n\nSpecify tracking urls for both tracking numbers and include the tracking number values in the urls,\nso that the customer can click on each tracking number and follow them to their respective\ntracking status pages.\n", "query_string": "mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n}", "variables": { "fulfillment": { "lineItemsByFulfillmentOrder": { "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279" }, "trackingInfo": { "numbers": [ "1Z1234512345123456", "MS123" ], "urls": [ "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456", "http://shopify-unsupported-tracking-company.com?tracking_number=MS123" ] } } }, "response": { "data": { "fulfillmentCreateV2": { "fulfillment": { "id": "gid://shopify/Fulfillment/1069019869", "status": "SUCCESS", "trackingInfo": [ { "company": "UPS", "number": "1Z1234512345123456", "url": "https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456" }, { "company": "UPS", "number": "MS123", "url": "http://shopify-unsupported-tracking-company.com?tracking_number=MS123" } ] }, "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/fulfillments/test/unit/graph_api/admin/mutations/fulfillment_create_v2_test.rb", "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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) { fulfillmentCreateV2(fulfillment: $fulfillment) { fulfillment { id status trackingInfo(first: 10) { company number url } } userErrors { field message } } }\",\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"numbers\": [\n \"1Z1234512345123456\",\n \"MS123\"\n ],\n \"urls\": [\n \"https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456\",\n \"http://shopify-unsupported-tracking-company.com?tracking_number=MS123\"\n ]\n }\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"numbers\": [\n \"1Z1234512345123456\",\n \"MS123\"\n ],\n \"urls\": [\n \"https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456\",\n \"http://shopify-unsupported-tracking-company.com?tracking_number=MS123\"\n ]\n }\n }\n },\n },\n);\n\nconst data = await response.json();\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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"numbers\": [\"1Z1234512345123456\", \"MS123\"],\n \"urls\": [\"https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456\", \"http://shopify-unsupported-tracking-company.com?tracking_number=MS123\"]\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n },\n \"trackingInfo\": {\n \"numbers\": [\n \"1Z1234512345123456\",\n \"MS123\"\n ],\n \"urls\": [\n \"https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456\",\n \"http://shopify-unsupported-tracking-company.com?tracking_number=MS123\"\n ]\n }\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"fulfillment\" => [\n \"lineItemsByFulfillmentOrder\" => [\n \"fulfillmentOrderId\" => \"gid://shopify/FulfillmentOrder/940656279\",\n ],\n \"trackingInfo\" => [\n \"numbers\" => [\"1Z1234512345123456\", \"MS123\"],\n \"urls\" => [\"https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456\", \"http://shopify-unsupported-tracking-company.com?tracking_number=MS123\"],\n ],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "fulfillment", "description": "The input fields used to create a fulfillment from fulfillment orders.", "type": { "kind": "INPUT_OBJECT", "name": "FulfillmentV2Input", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "FulfillmentV2Input!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "fulfillment", "argValue": " {\"lineItemsByFulfillmentOrder\":{\"fulfillmentOrderId\":\"gid://shopify/FulfillmentOrder/940656279\"},\"trackingInfo\":{\"numbers\":[\"1Z1234512345123456\",\"MS123\"],\"urls\":[\"https://www.ups.com/WebTracking?loc=en_US&requester=ST&trackNums=1Z1234512345123456\",\"http://shopify-unsupported-tracking-company.com?tracking_number=MS123\"]}}", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "fulfillmentcreatev2", "title": "Fulfill a fulfillment order without providing tracking info", "description": "Fulfill a fulfillment order without providing tracking info.\nTracking numbers can be set later with the [fulfillmentTrackingInfoUpdate](/api/admin-graphql/latest/mutations/fulfillmentTrackingInfoUpdate) mutation.\n", "query_string": "mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n}", "variables": { "fulfillment": { "lineItemsByFulfillmentOrder": { "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279" } } }, "response": { "data": { "fulfillmentCreateV2": { "fulfillment": { "id": "gid://shopify/Fulfillment/1069019873", "status": "SUCCESS", "trackingInfo": [] }, "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/fulfillments/test/unit/graph_api/admin/mutations/fulfillment_create_v2_test.rb", "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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) { fulfillmentCreateV2(fulfillment: $fulfillment) { fulfillment { id status trackingInfo(first: 10) { company number url } } userErrors { field message } } }\",\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n }\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n }\n }\n },\n },\n);\n\nconst data = await response.json();\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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\"\n }\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n trackingInfo(first: 10) {\n company\n number\n url\n }\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"fulfillment\" => [\n \"lineItemsByFulfillmentOrder\" => [\n \"fulfillmentOrderId\" => \"gid://shopify/FulfillmentOrder/940656279\",\n ],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "fulfillment", "description": "The input fields used to create a fulfillment from fulfillment orders.", "type": { "kind": "INPUT_OBJECT", "name": "FulfillmentV2Input", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "FulfillmentV2Input!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "fulfillment", "argValue": " {\"lineItemsByFulfillmentOrder\":{\"fulfillmentOrderId\":\"gid://shopify/FulfillmentOrder/940656279\"}}", "typeKind": "MUTATION" } ] }, { "example": { "type_name": "fulfillmentcreatev2", "title": "Partially fulfill a fulfillment order", "description": "Create a fulfillment for specific line items of a fulfillment order.", "query_string": "mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n}", "variables": { "fulfillment": { "lineItemsByFulfillmentOrder": { "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279", "fulfillmentOrderLineItems": { "id": "gid://shopify/FulfillmentOrderLineItem/361939597", "quantity": 1 } } } }, "response": { "data": { "fulfillmentCreateV2": { "fulfillment": { "id": "gid://shopify/Fulfillment/1069019871", "status": "SUCCESS" }, "userErrors": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/fulfillments/test/unit/graph_api/admin/mutations/fulfillment_create_v2_test.rb", "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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) { fulfillmentCreateV2(fulfillment: $fulfillment) { fulfillment { id status } userErrors { field message } } }\",\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\",\n \"fulfillmentOrderLineItems\": {\n \"id\": \"gid://shopify/FulfillmentOrderLineItem/361939597\",\n \"quantity\": 1\n }\n }\n }\n }\n}'\n", "remix_example": "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\",\n \"fulfillmentOrderLineItems\": {\n \"id\": \"gid://shopify/FulfillmentOrderLineItem/361939597\",\n \"quantity\": 1\n }\n }\n }\n },\n },\n);\n\nconst data = await response.json();\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 fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\",\n \"fulfillmentOrderLineItems\": {\n \"id\": \"gid://shopify/FulfillmentOrderLineItem/361939597\",\n \"quantity\": 1\n }\n }\n }\n}\n\nresponse = client.query(query: query, variables: variables)\n", "node_example": "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"fulfillment\": {\n \"lineItemsByFulfillmentOrder\": {\n \"fulfillmentOrderId\": \"gid://shopify/FulfillmentOrder/940656279\",\n \"fulfillmentOrderLineItems\": {\n \"id\": \"gid://shopify/FulfillmentOrderLineItem/361939597\",\n \"quantity\": 1\n }\n }\n }\n },\n },\n});\n", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n mutation fulfillmentCreateV2($fulfillment: FulfillmentV2Input!) {\n fulfillmentCreateV2(fulfillment: $fulfillment) {\n fulfillment {\n id\n status\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY;\n\n$variables = [\n \"fulfillment\" => [\n \"lineItemsByFulfillmentOrder\" => [\n \"fulfillmentOrderId\" => \"gid://shopify/FulfillmentOrder/940656279\",\n \"fulfillmentOrderLineItems\" => [\n \"id\" => \"gid://shopify/FulfillmentOrderLineItem/361939597\",\n \"quantity\" => 1,\n ],\n ],\n ],\n];\n\n$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "fulfillment", "description": "The input fields used to create a fulfillment from fulfillment orders.", "type": { "kind": "INPUT_OBJECT", "name": "FulfillmentV2Input", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "FulfillmentV2Input!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "fulfillment", "argValue": " {\"lineItemsByFulfillmentOrder\":{\"fulfillmentOrderId\":\"gid://shopify/FulfillmentOrder/940656279\",\"fulfillmentOrderLineItems\":{\"id\":\"gid://shopify/FulfillmentOrderLineItem/361939597\",\"quantity\":1}}}", "typeKind": "MUTATION" } ] } ]