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
1const { admin } = await authenticate.admin(request);23const response = await admin.graphql(4 `#graphql5 mutation FulfillmentCreate($fulfillment: FulfillmentV2Input!) {6 fulfillmentCreateV2(fulfillment: $fulfillment) {7 fulfillment {8 fulfillmentLineItems(first: 10) {9 edges {10 node {11 id12 lineItem {13 title14 variant {15 id16 }17 }18 quantity19 originalTotalSet {20 shopMoney {21 amount22 currencyCode23 }24 }25 }26 }27 }28 status29 estimatedDeliveryAt30 location {31 id32 legacyResourceId33 }34 service {35 handle36 }37 trackingInfo(first: 10) {38 company39 number40 url41 }42 originAddress {43 address144 address245 city46 countryCode47 provinceCode48 zip49 }50 }51 userErrors {52 field53 message54 }55 }56 }`,57 {58 variables: {59 "fulfillment": {60 "lineItemsByFulfillmentOrder": {61 "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279"62 }63 }64 },65 },66);6768const data = await response.json();69
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/unstable/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
JSON1{2 "fulfillment": {3 "lineItemsByFulfillmentOrder": {4 "fulfillmentOrderId": "gid://shopify/FulfillmentOrder/940656279"5 }6 }7}
Response
JSON1{2 "fulfillmentCreateV2": {3 "fulfillment": {4 "fulfillmentLineItems": {5 "edges": [6 {7 "node": {8 "id": "gid://shopify/FulfillmentLineItem/1024375042",9 "lineItem": {10 "title": "Crafty Shoes - Blue",11 "variant": {12 "id": "gid://shopify/ProductVariant/715806386"13 }14 },15 "quantity": 1,16 "originalTotalSet": {17 "shopMoney": {18 "amount": "10.0",19 "currencyCode": "USD"20 }21 }22 }23 },24 {25 "node": {26 "id": "gid://shopify/FulfillmentLineItem/1024375043",27 "lineItem": {28 "title": "Crafty Shoes - Green",29 "variant": {30 "id": "gid://shopify/ProductVariant/445365074"31 }32 },33 "quantity": 10,34 "originalTotalSet": {35 "shopMoney": {36 "amount": "1000.0",37 "currencyCode": "USD"38 }39 }40 }41 }42 ]43 },44 "status": "SUCCESS",45 "estimatedDeliveryAt": null,46 "location": {47 "id": "gid://shopify/Location/124656943",48 "legacyResourceId": "124656943"49 },50 "service": {51 "handle": "manual"52 },53 "trackingInfo": [],54 "originAddress": null55 },56 "userErrors": []57 }58}