fulfillment Event Createmutation
mutation
2024-10latest
Requires write
access scope. Also: The user must have fulfill_and_ship_orders permission.
Creates a fulfillment event for a specified fulfillment.
Arguments
The input fields used to create a fulfillment event for a fulfillment.
Was this section helpful?
FulfillmentEventCreatePayload returns
The created fulfillment event.
The list of errors that occurred from executing the mutation.
Was this section helpful?
Code examples for MUTATION: fulfillmentEventCreate
Query Reference for MUTATION: fulfillmentEventCreate
"mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {\n fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {\n fulfillmentEvent {\n # FulfillmentEvent fields\n }\n userErrors {\n field\n message\n }\n }\n}"
Input Reference for MUTATION: fulfillmentEventCreate
"{\n \"fulfillmentEvent\": {\n \"address1\": \"<your-address1>\",\n \"city\": \"<your-city>\",\n \"country\": \"<your-country>\",\n \"estimatedDeliveryAt\": \"2019-09-07T15:50:00Z\",\n \"fulfillmentId\": \"gid://shopify/<objectName>/10079785100\",\n \"happenedAt\": \"2019-09-07T15:50:00Z\",\n \"latitude\": 1.1,\n \"longitude\": 1.1,\n \"message\": \"<your-message>\",\n \"province\": \"<your-province>\",\n \"status\": \"ATTEMPTED_DELIVERY\",\n \"zip\": \"<your-zip>\"\n }\n}"
Schema Reference for MUTATION: fulfillmentEventCreate
"input FulfillmentEventInput {\n address1: String\n city: String\n country: String\n estimatedDeliveryAt: DateTime\n fulfillmentId: ID!\n happenedAt: DateTime\n latitude: Float\n longitude: Float\n message: String\n province: String\n status: FulfillmentEventStatus!\n zip: String\n}\n"
Display Examples for MUTATION: fulfillmentEventCreate
[ { "example": { "type_name": "fulfillmenteventcreate", "title": "Create fulfillment event when a package is out for delivery", "description": "Create a fulfillment event when the items in a fulfillment are sent out for delivery.", "query_string": "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}", "variables": { "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": [] } } }, "api_name": "admin", "minimum_api_version": "2023-10", "maximum_api_version": "unstable", "location": "/components/fulfillments/test/unit/graph_api/admin/mutations/fulfillment_event_create_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 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", "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", "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", "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", "php_example": "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<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\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$response = $client->query([\"query\" => $query, \"variables\" => $variables]);\n" }, "titleStringKey": "variables", "inputVariableEntries": [ { "arg": { "name": "fulfillmentEvent", "description": "The input fields used to create a fulfillment event for a fulfillment.", "type": { "kind": "INPUT_OBJECT", "name": "FulfillmentEventInput", "list": false, "non_null": true }, "defaultValue": null, "typeSignature": "FulfillmentEventInput!", "isDeprecated": false, "deprecationReason": null, "kind": "ARGUMENT" }, "key": "fulfillmentEvent", "argValue": " {\"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\"}", "typeKind": "MUTATION" } ] } ]