Transfer stock
POST
/api/v1/commerce/transfers
const url = 'https://digize.com/api/v1/commerce/transfers';const options = { method: 'POST', headers: { 'Idempotency-Key': '5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69', 'x-api-key': '<x-api-key>', 'Content-Type': 'application/json' }, body: '{"fromLocationId":"example","toLocationId":"example","lines":[{"variantId":"example","quantity":1}],"note":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://digize.com/api/v1/commerce/transfers \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: 5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69' \ --header 'x-api-key: <x-api-key>' \ --data '{ "fromLocationId": "example", "toLocationId": "example", "lines": [ { "variantId": "example", "quantity": 1 } ], "note": "example" }'Moves stock of one or more variants from one location to another at once, refused when the first location hasn’t that many.
Needs the commerce:write permission.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Idempotency-Key
string
Makes the request safe to send again: for 24 hours the same key and request answer the first response without repeating the change.
Example
5f1c2a8e-3b7d-4c55-9a0e-1f2d3c4b5a69Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
fromLocationId
required
string
toLocationId
required
string
lines
required
Array<object>
object
variantId
required
string
quantity
required
integer
note
string
Example generated
{ "fromLocationId": "example", "toLocationId": "example", "lines": [ { "variantId": "example", "quantity": 1 } ], "note": "example"}Responses
Section titled “Responses”Done
Media typeapplication/json
object
id
required
string
number
required
T-1001 onwards.
number
from
required
object
id
required
string
name
required
string
to
required
object
id
required
string
name
required
string
lines
required
Array<object>
object
variantId
required
string
productId
required
string | null
name
required
string
sku
required
string
quantity
required
number
units
required
number
note
required
string
actorName
required
string
at
required
string format: date-time
Example generated
{ "id": "example", "number": 1, "from": { "id": "example", "name": "example" }, "to": { "id": "example", "name": "example" }, "lines": [ { "variantId": "example", "productId": "example", "name": "example", "sku": "example", "quantity": 1 } ], "units": 1, "note": "example", "actorName": "example", "at": "2026-04-15T12:00:00Z"}What was sent isn’t valid (invalid).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}No key, or one that’s unknown, off or expired.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}The key doesn’t have the permission this needs.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}Nothing has that id (not_found).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}A request with the same Idempotency-Key is still running (conflict).
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}The Idempotency-Key was used with a different request.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}Over the rate limit; see retry-after.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
details
object
key
additional properties
any
Example
{ "error": { "code": "invalid" }}