Anchor to fulfillmentEventCreatefulfillment
fulfillment Event Create
mutation
Requires access scope. Also: The user must have fulfill_and_ship_orders permission.
Creates a fulfillment event for a specified fulfillment.
Anchor to Arguments
Arguments
- Anchor to fulfillmentEventfulfillment•
Event FulfillmentEvent Input!required The input fields used to create a fulfillment event for a fulfillment.
Was this section helpful?
- Anchor to fulfillmentEventfulfillment•
Event The created fulfillment event.
- Anchor to userErrorsuser•
Errors [UserError!]!non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
- Create fulfillment event when a package is out for delivery
- Creates a fulfillment event
- fulfillmentEventCreate reference
Examples
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {6 fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {7 fulfillmentEvent {8 id9 status10 message11 }12 userErrors {13 field14 message15 }16 }17 }`,18 {19 variables: {20 "fulfillmentEvent": {21 "fulfillmentId": "gid://shopify/Fulfillment/237894043",22 "address1": "151 O'Connor St",23 "city": "Ottawa",24 "province": "Ontario",25 "country": "Canada",26 "zip": "K2P 2L8",27 "latitude": 45.4191176,28 "longitude": 75.6966166,29 "happenedAt": "2024-03-07T15:50:00Z",30 "estimatedDeliveryAt": "2024-03-07T16:50:00Z",31 "message": "This package is now out for delivery!",32 "status": "OUT_FOR_DELIVERY"33 }34 },35 },36);3738const data = await response.json();39
mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {
fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {
fulfillmentEvent {
id
status
message
}
userErrors {
field
message
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) { fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) { fulfillmentEvent { id status message } userErrors { field message } } }",
"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"
}
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {
fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {
fulfillmentEvent {
id
status
message
}
userErrors {
field
message
}
}
}`,
{
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"
}
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {
fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {
fulfillmentEvent {
id
status
message
}
userErrors {
field
message
}
}
}`,
"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"
}
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {
fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {
fulfillmentEvent {
id
status
message
}
userErrors {
field
message
}
}
}
QUERY
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 = client.query(query: query, variables: variables)
Input variables
JSON1{2 "fulfillmentEvent": {3 "fulfillmentId": "gid://shopify/Fulfillment/237894043",4 "address1": "151 O'Connor St",5 "city": "Ottawa",6 "province": "Ontario",7 "country": "Canada",8 "zip": "K2P 2L8",9 "latitude": 45.4191176,10 "longitude": 75.6966166,11 "happenedAt": "2024-03-07T15:50:00Z",12 "estimatedDeliveryAt": "2024-03-07T16:50:00Z",13 "message": "This package is now out for delivery!",14 "status": "OUT_FOR_DELIVERY"15 }16}
Response
JSON1{2 "fulfillmentEventCreate": {3 "fulfillmentEvent": {4 "id": "gid://shopify/FulfillmentEvent/944956426",5 "status": "OUT_FOR_DELIVERY",6 "message": "This package is now out for delivery!"7 },8 "userErrors": []9 }10}