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
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"
}
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-04/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"
}
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
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 json = await response.json();
return json.data;
}
Ruby
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)
Node.js
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"
}
},
},
});
Shopify CLI
shopify app execute \
--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"
}
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-04/graphql.json', {
method: 'POST',
body: JSON.stringify({
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 { data } = await response.json();
console.log(data);
Response
{
"fulfillmentEventCreate": {
"fulfillmentEvent": {
"id": "gid://shopify/FulfillmentEvent/944956426",
"status": "OUT_FOR_DELIVERY",
"message": "This package is now out for delivery!"
},
"userErrors": []
}
}
Creates a fulfillment event
Query
mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {
fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {
fulfillmentEvent {
address1
city
country
estimatedDeliveryAt
happenedAt
latitude
longitude
message
province
status
zip
}
userErrors {
field
message
}
}
}
Variables
{
"fulfillmentEvent": {
"fulfillmentId": "gid://shopify/Fulfillment/237894043",
"address1": "150 Elgin St.",
"city": "Ottawa",
"country": "Canada",
"estimatedDeliveryAt": "2024-11-15T23:40:59Z",
"happenedAt": "2024-11-15T23:40:49Z",
"latitude": 1.234,
"longitude": 9.876,
"message": "In transit",
"province": "Ontario",
"status": "IN_TRANSIT",
"zip": "K2P1L4"
}
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) { fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) { fulfillmentEvent { address1 city country estimatedDeliveryAt happenedAt latitude longitude message province status zip } userErrors { field message } } }",
"variables": {
"fulfillmentEvent": {
"fulfillmentId": "gid://shopify/Fulfillment/237894043",
"address1": "150 Elgin St.",
"city": "Ottawa",
"country": "Canada",
"estimatedDeliveryAt": "2024-11-15T23:40:59Z",
"happenedAt": "2024-11-15T23:40:49Z",
"latitude": 1.234,
"longitude": 9.876,
"message": "In transit",
"province": "Ontario",
"status": "IN_TRANSIT",
"zip": "K2P1L4"
}
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {
fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {
fulfillmentEvent {
address1
city
country
estimatedDeliveryAt
happenedAt
latitude
longitude
message
province
status
zip
}
userErrors {
field
message
}
}
}`,
{
variables: {
"fulfillmentEvent": {
"fulfillmentId": "gid://shopify/Fulfillment/237894043",
"address1": "150 Elgin St.",
"city": "Ottawa",
"country": "Canada",
"estimatedDeliveryAt": "2024-11-15T23:40:59Z",
"happenedAt": "2024-11-15T23:40:49Z",
"latitude": 1.234,
"longitude": 9.876,
"message": "In transit",
"province": "Ontario",
"status": "IN_TRANSIT",
"zip": "K2P1L4"
}
},
},
);
const json = await response.json();
return json.data;
}
Ruby
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 {
address1
city
country
estimatedDeliveryAt
happenedAt
latitude
longitude
message
province
status
zip
}
userErrors {
field
message
}
}
}
QUERY
variables = {
"fulfillmentEvent": {
"fulfillmentId": "gid://shopify/Fulfillment/237894043",
"address1": "150 Elgin St.",
"city": "Ottawa",
"country": "Canada",
"estimatedDeliveryAt": "2024-11-15T23:40:59Z",
"happenedAt": "2024-11-15T23:40:49Z",
"latitude": 1.234,
"longitude": 9.876,
"message": "In transit",
"province": "Ontario",
"status": "IN_TRANSIT",
"zip": "K2P1L4"
}
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {
fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {
fulfillmentEvent {
address1
city
country
estimatedDeliveryAt
happenedAt
latitude
longitude
message
province
status
zip
}
userErrors {
field
message
}
}
}`,
"variables": {
"fulfillmentEvent": {
"fulfillmentId": "gid://shopify/Fulfillment/237894043",
"address1": "150 Elgin St.",
"city": "Ottawa",
"country": "Canada",
"estimatedDeliveryAt": "2024-11-15T23:40:59Z",
"happenedAt": "2024-11-15T23:40:49Z",
"latitude": 1.234,
"longitude": 9.876,
"message": "In transit",
"province": "Ontario",
"status": "IN_TRANSIT",
"zip": "K2P1L4"
}
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {
fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {
fulfillmentEvent {
address1
city
country
estimatedDeliveryAt
happenedAt
latitude
longitude
message
province
status
zip
}
userErrors {
field
message
}
}
}' \
--variables \
'{
"fulfillmentEvent": {
"fulfillmentId": "gid://shopify/Fulfillment/237894043",
"address1": "150 Elgin St.",
"city": "Ottawa",
"country": "Canada",
"estimatedDeliveryAt": "2024-11-15T23:40:59Z",
"happenedAt": "2024-11-15T23:40:49Z",
"latitude": 1.234,
"longitude": 9.876,
"message": "In transit",
"province": "Ontario",
"status": "IN_TRANSIT",
"zip": "K2P1L4"
}
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-04/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation fulfillmentEventCreate($fulfillmentEvent: FulfillmentEventInput!) {
fulfillmentEventCreate(fulfillmentEvent: $fulfillmentEvent) {
fulfillmentEvent {
address1
city
country
estimatedDeliveryAt
happenedAt
latitude
longitude
message
province
status
zip
}
userErrors {
field
message
}
}
}
`,
variables: {
"fulfillmentEvent": {
"fulfillmentId": "gid://shopify/Fulfillment/237894043",
"address1": "150 Elgin St.",
"city": "Ottawa",
"country": "Canada",
"estimatedDeliveryAt": "2024-11-15T23:40:59Z",
"happenedAt": "2024-11-15T23:40:49Z",
"latitude": 1.234,
"longitude": 9.876,
"message": "In transit",
"province": "Ontario",
"status": "IN_TRANSIT",
"zip": "K2P1L4"
}
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"fulfillmentEventCreate": {
"fulfillmentEvent": {
"address1": "150 Elgin St.",
"city": "Ottawa",
"country": "Canada",
"estimatedDeliveryAt": "2024-11-15T23:40:59Z",
"happenedAt": "2024-11-15T23:40:49Z",
"latitude": 1.234,
"longitude": 9.876,
"message": "In transit",
"province": "Ontario",
"status": "IN_TRANSIT",
"zip": "K2P1L4"
},
"userErrors": []
}
}