Anchor to fulfillmentCreateV2fulfillment
fulfillmentCreateV2
mutationDeprecated
Requires access scope,
access scope or
access scope. Also: The user must have fulfill_and_ship_orders permission.
Creates a fulfillment for one or many fulfillment orders.
The fulfillment orders are associated with the same order and are assigned to the same location. Use instead.
Anchor to Arguments
Arguments
- Anchor to fulfillmentfulfillment•Fulfillment
V2Input! required The input fields used to create a fulfillment from fulfillment orders.
- Anchor to messagemessage•
An optional message for the fulfillment request.
Was this section helpful?
Anchor to FulfillmentCreateV2Payload returnsFulfillmentCreateV2Payload returns
- Anchor to fulfillmentfulfillment•
The created fulfillment.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
- Creates a fulfillment for one or many fulfillment orders
- Fulfill a fulfillment order
- Fulfill a fulfillment order with tracking data specified
- Fulfill a fulfillment order with two tracking numbers and a supported tracking company name specified
- Fulfill a fulfillment order with two tracking numbers and tracking urls from different tracking tracking providers
- Fulfill a fulfillment order without providing tracking info
- Partially fulfill a fulfillment order
- fulfillmentCreateV2 reference
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation FulfillmentCreate($fulfillment: FulfillmentV2Input!) {
fulfillmentCreateV2(fulfillment: $fulfillment) {
fulfillment {
fulfillmentLineItems(first: 10) {
edges {
node {
id
lineItem {
title
variant {
id
}
}
quantity
originalTotalSet {
shopMoney {
amount
currencyCode
}
mutation FulfillmentCreate($fulfillment: FulfillmentV2Input!) {
fulfillmentCreateV2(fulfillment: $fulfillment) {
fulfillment {
fulfillmentLineItems(first: 10) {
edges {
node {
id
lineItem {
title
variant {
id
}
}
quantity
originalTotalSet {
shopMoney {
amount
currencyCode
}
}
}
}
}
status
estimatedDeliveryAt
location {
id
legacyResourceId
}
service {
handle
}
trackingInfo(first: 10) {
company
number
url
}
originAddress {
address1
address2
city
countryCode
provinceCode
zip
}
}
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 FulfillmentCreate($fulfillment: FulfillmentV2Input!) { fulfillmentCreateV2(fulfillment: $fulfillment) { fulfillment { fulfillmentLineItems(first: 10) { edges { node { id lineItem { title variant { id } } quantity originalTotalSet { shopMoney { amount currencyCode } } } } } status estimatedDeliveryAt location { id legacyResourceId } service { handle } trackingInfo(first: 10) { company number url } originAddress { address1 address2 city countryCode provinceCode zip } } userErrors { field message } } }",
"variables": {
"fulfillment": {
"lineItemsByFulfillmentOrder": {
"fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279"
}
}
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation FulfillmentCreate($fulfillment: FulfillmentV2Input!) {
fulfillmentCreateV2(fulfillment: $fulfillment) {
fulfillment {
fulfillmentLineItems(first: 10) {
edges {
node {
id
lineItem {
title
variant {
id
}
}
quantity
originalTotalSet {
shopMoney {
amount
currencyCode
}
}
}
}
}
status
estimatedDeliveryAt
location {
id
legacyResourceId
}
service {
handle
}
trackingInfo(first: 10) {
company
number
url
}
originAddress {
address1
address2
city
countryCode
provinceCode
zip
}
}
userErrors {
field
message
}
}
}`,
{
variables: {
"fulfillment": {
"lineItemsByFulfillmentOrder": {
"fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279"
}
}
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation FulfillmentCreate($fulfillment: FulfillmentV2Input!) {
fulfillmentCreateV2(fulfillment: $fulfillment) {
fulfillment {
fulfillmentLineItems(first: 10) {
edges {
node {
id
lineItem {
title
variant {
id
}
}
quantity
originalTotalSet {
shopMoney {
amount
currencyCode
}
}
}
}
}
status
estimatedDeliveryAt
location {
id
legacyResourceId
}
service {
handle
}
trackingInfo(first: 10) {
company
number
url
}
originAddress {
address1
address2
city
countryCode
provinceCode
zip
}
}
userErrors {
field
message
}
}
}`,
"variables": {
"fulfillment": {
"lineItemsByFulfillmentOrder": {
"fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279"
}
}
},
},
});
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 FulfillmentCreate($fulfillment: FulfillmentV2Input!) {
fulfillmentCreateV2(fulfillment: $fulfillment) {
fulfillment {
fulfillmentLineItems(first: 10) {
edges {
node {
id
lineItem {
title
variant {
id
}
}
quantity
originalTotalSet {
shopMoney {
amount
currencyCode
}
}
}
}
}
status
estimatedDeliveryAt
location {
id
legacyResourceId
}
service {
handle
}
trackingInfo(first: 10) {
company
number
url
}
originAddress {
address1
address2
city
countryCode
provinceCode
zip
}
}
userErrors {
field
message
}
}
}
QUERY
variables = {
"fulfillment": {
"lineItemsByFulfillmentOrder": {
"fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279"
}
}
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"fulfillment": {
"lineItemsByFulfillmentOrder": {
"fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279"
}
}
}
Response
JSON{
"fulfillmentCreateV2": {
"fulfillment": {
"fulfillmentLineItems": {
"edges": [
{
"node": {
"id": "gid://shopify/FulfillmentLineItem/1024375042",
"lineItem": {
"title": "Crafty Shoes - Blue",
"variant": {
"id": "gid://shopify/ProductVariant/715806386"
}
},
"quantity": 1,
"originalTotalSet": {
"shopMoney": {
"amount": "10.0",
"currencyCode": "USD"
}
}
}
},
{
"node": {
"id": "gid://shopify/FulfillmentLineItem/1024375043",