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 fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) { fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) { fulfillmentEvent { id status message } userErrors { field message } } }\",\n \"variables\": {\n \"fulfillmentEvent\": {\n \"fulfillmentId\": \"gid://shopify/Fulfillment/237894043\",\n \"address1\": \"151 O'\\''Connor St\",\n \"city\": \"Ottawa\",\n \"province\": \"Ontario\",\n \"country\": \"Canada\",\n \"zip\": \"K2P 2L8\",\n \"latitude\": 45.4191176,\n \"longitude\": 75.6966166,\n \"happenedAt\": \"2024-03-07T15:50:00Z\",\n \"estimatedDeliveryAt\": \"2024-03-07T16:50:00Z\",\n \"message\": \"This package is now out for delivery!\",\n \"status\": \"OUT_FOR_DELIVERY\"\n }\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {\n fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {\n fulfillmentEvent {\n id\n status\n message\n }\n userErrors {\n field\n message\n }\n }\n }`,\n \"variables\": {\n \"fulfillmentEvent\": {\n \"fulfillmentId\": \"gid://shopify/Fulfillment/237894043\",\n \"address1\": \"151 O'Connor St\",\n \"city\": \"Ottawa\",\n \"province\": \"Ontario\",\n \"country\": \"Canada\",\n \"zip\": \"K2P 2L8\",\n \"latitude\": 45.4191176,\n \"longitude\": 75.6966166,\n \"happenedAt\": \"2024-03-07T15:50:00Z\",\n \"estimatedDeliveryAt\": \"2024-03-07T16:50:00Z\",\n \"message\": \"This package is now out for delivery!\",\n \"status\": \"OUT_FOR_DELIVERY\"\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 fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {\n fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {\n fulfillmentEvent {\n id\n status\n message\n }\n userErrors {\n field\n message\n }\n }\n }\nQUERY\n\nvariables = {\n \"fulfillmentEvent\": {\n \"fulfillmentId\": \"gid://shopify/Fulfillment/237894043\",\n \"address1\": \"151 O'Connor St\",\n \"city\": \"Ottawa\",\n \"province\": \"Ontario\",\n \"country\": \"Canada\",\n \"zip\": \"K2P 2L8\",\n \"latitude\": 45.4191176,\n \"longitude\": 75.6966166,\n \"happenedAt\": \"2024-03-07T15:50:00Z\",\n \"estimatedDeliveryAt\": \"2024-03-07T16:50:00Z\",\n \"message\": \"This package is now out for delivery!\",\n \"status\": \"OUT_FOR_DELIVERY\"\n }\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 = <<[\n \"fulfillmentId\" => \"gid://shopify/Fulfillment/237894043\",\n \"address1\" => \"151 O'Connor St\",\n \"city\" => \"Ottawa\",\n \"province\" => \"Ontario\",\n \"country\" => \"Canada\",\n \"zip\" => \"K2P 2L8\",\n \"latitude\" => 45.4191176,\n \"longitude\" => 75.6966166,\n \"happenedAt\" => \"2024-03-07T15:50:00Z\",\n \"estimatedDeliveryAt\" => \"2024-03-07T16:50:00Z\",\n \"message\" => \"This package is now out for delivery!\",\n \"status\" => \"OUT_FOR_DELIVERY\",\n ],\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 fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {\n fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {\n fulfillmentEvent {\n id\n status\n message\n }\n userErrors {\n field\n message\n }\n }\n }`,\n {\n variables: {\n \"fulfillmentEvent\": {\n \"fulfillmentId\": \"gid://shopify/Fulfillment/237894043\",\n \"address1\": \"151 O'Connor St\",\n \"city\": \"Ottawa\",\n \"province\": \"Ontario\",\n \"country\": \"Canada\",\n \"zip\": \"K2P 2L8\",\n \"latitude\": 45.4191176,\n \"longitude\": 75.6966166,\n \"happenedAt\": \"2024-03-07T15:50:00Z\",\n \"estimatedDeliveryAt\": \"2024-03-07T16:50:00Z\",\n \"message\": \"This package is now out for delivery!\",\n \"status\": \"OUT_FOR_DELIVERY\"\n }\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {\n fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {\n fulfillmentEvent {\n id\n status\n message\n }\n userErrors {\n field\n message\n }\n }\n}"
input: { "fulfillmentEvent": { "fulfillmentId": "gid://shopify/Fulfillment/237894043", "address1": "151 O'Connor St", "city": "Ottawa", "province": "Ontario", "country": "Canada", "zip": "K2P 2L8", "latitude": 45.4191176, "longitude": 75.6966166, "happenedAt": "2024-03-07T15:50:00Z", "estimatedDeliveryAt": "2024-03-07T16:50:00Z", "message": "This package is now out for delivery!", "status": "OUT_FOR_DELIVERY" } }
response: { "data": { "fulfillmentEventCreate": { "fulfillmentEvent": { "id": "gid://shopify/FulfillmentEvent/944956391", "status": "OUT_FOR_DELIVERY", "message": "This package is now out for delivery!" }, "userErrors": [] } } }