Anchor to fulfillmentEventCreatefulfillment
fulfillmentEventCreate
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 requiredInput! The input fields used to create a fulfillment event for a fulfillment.
Was this section helpful?
Anchor to FulfillmentEventCreatePayload returnsFulfillmentEventCreatePayload returns
- 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
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,
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
JSON{
"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
JSON{
"fulfillmentEventCreate": {
"fulfillmentEvent": {
"id": "gid://shopify/FulfillmentEvent/944956426",
"status": "OUT_FOR_DELIVERY",
"message": "This package is now out for delivery!"
},
"userErrors": []
}
}