Warehouses

Update warehouse

Changes the name, the external id or the default warehouse.

PATCH
/v1/warehouses/{warehouseId}

Send only what changes: name, externalId (accepts null to clear it), isDefault or status.

  • Change the default: mark the other warehouse with isDefault: true. There is no isDefault: false, because the seller never ends up without a default. The swap happens in one step: both warehouses get warehouse.updated.
  • Reactivate: status: "active" reactivates an archived warehouse. To archive, use Archive warehouse: archived is not accepted here.
  • No change: if the body changes nothing, the response is 200 with the warehouse, nothing is written and no event is sent.
curl -X PATCH "$BACKEND_URL/v1/warehouses/$WAREHOUSE_ID" \
  -H "Authorization: Bearer mk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"isDefault":true}'

Common errors

  • 400: invalid body, for example isDefault: false or status: "archived". Neither value exists here.
  • 409 with details.reason = "warehouse_archived": isDefault: true on an archived warehouse. Reactivate it first, or in the same call: {"status":"active","isDefault":true}.
  • 409 with details.field = "externalId": another warehouse of the same seller already uses this externalId.
  • 404: the warehouse does not exist or belongs to another account.

Authorization

api_key
headerAuthorizationBearer <token>

API key (mk_...)

Path Parameters

warehouseId*string

Identifier of the warehouse, as returned by the API.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Request Body

application/json
  1. body

Fields to change. Only the fields you send are updated.

name?string

New display name, 1 to 200 characters; leading and trailing spaces are removed. Omit it to keep the current name. null is not accepted.

Length1 <= length <= 200
externalId?|

New external identifier, 1 to 120 characters after trimming, unique within the seller. Omit it to keep the current value; send null to clear it.

Length1 <= length <= 120
isDefault?true

Send true to make this the seller's default warehouse. The current default stops being it in the same step, so the seller always has exactly one. false is not accepted: to move the default away from a warehouse, mark another one. Omit it to keep the default as it is.

Value intrue
status?"active"

Send active to reactivate an archived warehouse. Archiving is DELETE /v1/warehouses/{warehouseId}, so archived is not accepted here. Omit it to keep the current status.

Value in"active"

Response Body

The warehouse after the change. A request that changes nothing answers the same way and emits no event.

application/json
  1. response

A place where a seller keeps stock. Inventory is counted per variant and warehouse.

id*string

Opaque unique identifier of the warehouse, generated by the API. Use it in the /v1/warehouses/{warehouseId} routes and as warehouseId of an inventory movement.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
sellerId*string

The seller that owns this warehouse. A warehouse never moves to another seller.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid
name*string

Display name of the warehouse.

externalId*|

Your own identifier for this warehouse, such as its code in your ERP, so you can find the record without storing ours. null when it was never set. Unique within the seller.

isDefault*boolean

true for the seller's default warehouse: the one an inventory movement uses when it names no warehouse. A seller has exactly one, created together with the seller. To change it, send isDefault: true for another warehouse.

status*string

Lifecycle state. An active warehouse takes inventory movements and shows in the balance of every variant of the seller. An archived one stays for the ledger history and takes no new movement.

Value in"active""archived"
createdAt*string

When the warehouse was created, in ISO-8601 (UTC).

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
Formatdate-time
updatedAt*string

When the warehouse was last changed, in ISO-8601 (UTC).

Match^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$
Formatdate-time
curl -X PATCH "https://example.com/v1/warehouses/b7e2a1c4-5d3f-4e8a-9b6c-2f1d0a8e7c35" \  -H "Content-Type: application/json" \  -d '{    "name": "Main warehouse"  }'
{  "id": "b7e2a1c4-5d3f-4e8a-9b6c-2f1d0a8e7c35",  "sellerId": "3d1c8a52-7f0e-4b0a-8a65-9c1b2f6d7e01",  "name": "Default",  "externalId": null,  "isDefault": true,  "status": "active",  "createdAt": "2026-10-10T12:00:00.000Z",  "updatedAt": "2026-10-10T12:00:00.000Z"}