Creates a draft inventory transfer
Description
Create a draft transfer that moves inventory from one location to another, for example when an inventory app rebalances stock between two stores. The request sets the app's own transfer reference as `referenceName`, adds tags and a note, and passes an idempotency key with the [`@idempotent` directive](https://shopify.dev/docs/apps/build/apis/graphql-admin/implementing-idempotency) so the app can retry the request safely. The response returns the transfer with a `DRAFT` status, its origin and destination, and its line items. Use `inventoryTransferMarkAsReadyToShip` when the transfer is ready to ship.
Query
mutation inventoryTransferCreate($input: InventoryTransferCreateInput!, $idempotencyKey: String!) {
inventoryTransferCreate(input: $input) @idempotent(key: $idempotencyKey) {
inventoryTransfer {
id
name
status
referenceName
tags
note
totalQuantity
origin {
name
}
destination {
name
}
lineItems(first: 10) {
nodes {
title
totalQuantity
inventoryItem {
id
}
}
}
}
userErrors {
field
message
code
}
}
}
Variables
{
"input": {
"originLocationId": "gid://shopify/Location/346779380",
"destinationLocationId": "gid://shopify/Location/750123840",
"lineItems": [
{
"inventoryItemId": "gid://shopify/InventoryItem/30322695",
"quantity": 5
}
],
"tags": [
"rebalance",
"winter-season"
],
"note": "Move surplus snowboards to Toronto ahead of the winter sale.",
"referenceName": "REBAL-2026-014"
},
"idempotencyKey": "634397a0-54a4-46a1-8e1e-881063a2294e"
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-10/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation inventoryTransferCreate($input: InventoryTransferCreateInput!, $idempotencyKey: String!) { inventoryTransferCreate(input: $input) @idempotent(key: $idempotencyKey) { inventoryTransfer { id name status referenceName tags note totalQuantity origin { name } destination { name } lineItems(first: 10) { nodes { title totalQuantity inventoryItem { id } } } } userErrors { field message code } } }",
"variables": {
"input": {
"originLocationId": "gid://shopify/Location/346779380",
"destinationLocationId": "gid://shopify/Location/750123840",
"lineItems": [
{
"inventoryItemId": "gid://shopify/InventoryItem/30322695",
"quantity": 5
}
],
"tags": [
"rebalance",
"winter-season"
],
"note": "Move surplus snowboards to Toronto ahead of the winter sale.",
"referenceName": "REBAL-2026-014"
},
"idempotencyKey": "634397a0-54a4-46a1-8e1e-881063a2294e"
}
}'
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 inventoryTransferCreate($input: InventoryTransferCreateInput!, $idempotencyKey: String!) {
inventoryTransferCreate(input: $input) @idempotent(key: $idempotencyKey) {
inventoryTransfer {
id
name
status
referenceName
tags
note
totalQuantity
origin {
name
}
destination {
name
}
lineItems(first: 10) {
nodes {
title
totalQuantity
inventoryItem {
id
}
}
}
}
userErrors {
field
message
code
}
}
}`,
{
variables: {
"input": {
"originLocationId": "gid://shopify/Location/346779380",
"destinationLocationId": "gid://shopify/Location/750123840",
"lineItems": [
{
"inventoryItemId": "gid://shopify/InventoryItem/30322695",
"quantity": 5
}
],
"tags": [
"rebalance",
"winter-season"
],
"note": "Move surplus snowboards to Toronto ahead of the winter sale.",
"referenceName": "REBAL-2026-014"
},
"idempotencyKey": "634397a0-54a4-46a1-8e1e-881063a2294e"
},
},
);
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 inventoryTransferCreate($input: InventoryTransferCreateInput!, $idempotencyKey: String!) {
inventoryTransferCreate(input: $input) @idempotent(key: $idempotencyKey) {
inventoryTransfer {
id
name
status
referenceName
tags
note
totalQuantity
origin {
name
}
destination {
name
}
lineItems(first: 10) {
nodes {
title
totalQuantity
inventoryItem {
id
}
}
}
}
userErrors {
field
message
code
}
}
}
QUERY
variables = {
"input": {
"originLocationId": "gid://shopify/Location/346779380",
"destinationLocationId": "gid://shopify/Location/750123840",
"lineItems": [
{
"inventoryItemId": "gid://shopify/InventoryItem/30322695",
"quantity": 5
}
],
"tags": [
"rebalance",
"winter-season"
],
"note": "Move surplus snowboards to Toronto ahead of the winter sale.",
"referenceName": "REBAL-2026-014"
},
"idempotencyKey": "634397a0-54a4-46a1-8e1e-881063a2294e"
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation inventoryTransferCreate($input: InventoryTransferCreateInput!, $idempotencyKey: String!) {
inventoryTransferCreate(input: $input) @idempotent(key: $idempotencyKey) {
inventoryTransfer {
id
name
status
referenceName
tags
note
totalQuantity
origin {
name
}
destination {
name
}
lineItems(first: 10) {
nodes {
title
totalQuantity
inventoryItem {
id
}
}
}
}
userErrors {
field
message
code
}
}
}`,
"variables": {
"input": {
"originLocationId": "gid://shopify/Location/346779380",
"destinationLocationId": "gid://shopify/Location/750123840",
"lineItems": [
{
"inventoryItemId": "gid://shopify/InventoryItem/30322695",
"quantity": 5
}
],
"tags": [
"rebalance",
"winter-season"
],
"note": "Move surplus snowboards to Toronto ahead of the winter sale.",
"referenceName": "REBAL-2026-014"
},
"idempotencyKey": "634397a0-54a4-46a1-8e1e-881063a2294e"
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation inventoryTransferCreate($input: InventoryTransferCreateInput!, $idempotencyKey: String!) {
inventoryTransferCreate(input: $input) @idempotent(key: $idempotencyKey) {
inventoryTransfer {
id
name
status
referenceName
tags
note
totalQuantity
origin {
name
}
destination {
name
}
lineItems(first: 10) {
nodes {
title
totalQuantity
inventoryItem {
id
}
}
}
}
userErrors {
field
message
code
}
}
}' \
--variables \
'{
"input": {
"originLocationId": "gid://shopify/Location/346779380",
"destinationLocationId": "gid://shopify/Location/750123840",
"lineItems": [
{
"inventoryItemId": "gid://shopify/InventoryItem/30322695",
"quantity": 5
}
],
"tags": [
"rebalance",
"winter-season"
],
"note": "Move surplus snowboards to Toronto ahead of the winter sale.",
"referenceName": "REBAL-2026-014"
},
"idempotencyKey": "634397a0-54a4-46a1-8e1e-881063a2294e"
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-10/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation inventoryTransferCreate($input: InventoryTransferCreateInput!, $idempotencyKey: String!) {
inventoryTransferCreate(input: $input) @idempotent(key: $idempotencyKey) {
inventoryTransfer {
id
name
status
referenceName
tags
note
totalQuantity
origin {
name
}
destination {
name
}
lineItems(first: 10) {
nodes {
title
totalQuantity
inventoryItem {
id
}
}
}
}
userErrors {
field
message
code
}
}
}
`,
variables: {
"input": {
"originLocationId": "gid://shopify/Location/346779380",
"destinationLocationId": "gid://shopify/Location/750123840",
"lineItems": [
{
"inventoryItemId": "gid://shopify/InventoryItem/30322695",
"quantity": 5
}
],
"tags": [
"rebalance",
"winter-season"
],
"note": "Move surplus snowboards to Toronto ahead of the winter sale.",
"referenceName": "REBAL-2026-014"
},
"idempotencyKey": "634397a0-54a4-46a1-8e1e-881063a2294e"
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"inventoryTransferCreate": {
"inventoryTransfer": {
"id": "gid://shopify/InventoryTransfer/1061783019",
"name": "#T0012",
"status": "DRAFT",
"referenceName": "REBAL-2026-014",
"tags": [
"rebalance",
"winter-season"
],
"note": "Move surplus snowboards to Toronto ahead of the winter sale.",
"totalQuantity": 5,
"origin": {
"name": "Ottawa Store"
},
"destination": {
"name": "Toronto Store"
},
"lineItems": {
"nodes": [
{
"title": "Element",
"totalQuantity": 5,
"inventoryItem": {
"id": "gid://shopify/InventoryItem/30322695"
}
}
]
}
},
"userErrors": []
}
}