Warehouses

Archive warehouse

Archives a warehouse without deleting it.

DELETE
/v1/warehouses/{warehouseId}

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 warehouses list 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:

usesMeansWhat to do
defaultit is the seller's default warehousemark another one with isDefault: true
stockit has balance: onHand or reserved is not 0move the balance out with a transfer or an adjustment

Once the reason is solved, repeat the DELETE.

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

Response Body

The 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