transferInventory
Requires permission inventory:stock_transfer:create.
Moves stock from one warehouse to another, for one or more items, in one call. The two warehouses must differ and both must exist, every item needs a variant, and each item needs enough available stock (on hand less reserved) in the source warehouse. An idempotency key makes a retry return the original movement. Needs the stock transfers feature on your plan and the stock transfer create permission.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation TransferInventory($input: TransferInventoryInput!) {
transferInventory(input: $input) {
id
batchNumber
movementNumber
serialNumber
status
type
fromWarehouse {
id
code
taxRegistrationNumber
name
status
type
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation TransferInventory($input: TransferInventoryInput!) {\n transferInventory(input: $input) {\n id\n batchNumber\n movementNumber\n serialNumber\n status\n type\n fromWarehouse {\n id\n code\n taxRegistrationNumber\n name\n status\n type\n }\n }\n}",
"variables": {
"input": {
"fromWarehouseId": "id",
"items": [
{
"productId": "id",
"quantity": 0,
"variantId": "id"
}
],
"toWarehouseId": "id"
}
}
}
EOF
Variables:
{
"input": {
"fromWarehouseId": "id",
"items": [
{
"productId": "id",
"quantity": 0,
"variantId": "id"
}
],
"toWarehouseId": "id"
}
}
Response:
{
"data": {
"transferInventory": {
"id": "id",
"batchNumber": "string",
"movementNumber": "string",
"serialNumber": "string",
"status": "CANCELLED",
"type": "ADJUSTMENT",
"fromWarehouse": {
"id": "id",
"code": "string",
"taxRegistrationNumber": "string",
"name": "string",
"status": "ACTIVE",
"type": "string"
}
}
}
}
transferInventory(
input: TransferInventoryInput!
): StockMovement!
Arguments
transferInventory.input ● TransferInventoryInput! non-null input
The details of the transfer inventory request.
Type
StockMovement object
A movement of stock: a receipt, issue, transfer or adjustment.