Warehouses
Archive warehouse
Archives a warehouse without deleting it.
DELETE
This DELETE archives, it does not delete: the movement history points to the warehouse. The response is 204, with no body, and the warehouse.archived event reaches your webhooks. Archiving a warehouse that is already archived changes nothing and also returns 204.
Once archived, the warehouse:
- accepts no new movement (
409,warehouse_archived); - leaves the
warehouseslist of the balance of the Variants; - stays in List warehouses with
status: "archived", and in the old movements.
To use it again, reactivate it with status: "active".
curl -X DELETE "$BACKEND_URL/v1/warehouses/$WAREHOUSE_ID" \
-H "Authorization: Bearer mk_your_api_key"When the API refuses
The response is 409 with details.reason = "warehouse_in_use". The details.uses field gives the reason, and may have both:
uses | Means | What to do |
|---|---|---|
default | it is the seller's default warehouse | mark another one with isDefault: true |
stock | it has balance: onHand or reserved is not 0 | move the balance out with a transfer or an adjustment |
Once the reason is solved, repeat the DELETE.
api_keyheader
AuthorizationBearer <token>API key (mk_...)
warehouseId*stringIdentifier 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)$Format
uuidThe warehouse was archived (status: archived), or already was. Reactivate it with PATCH and status: active.
curl -X DELETE "https://example.com/v1/warehouses/b7e2a1c4-5d3f-4e8a-9b6c-2f1d0a8e7c35"Empty