Create warehouse
Creates a warehouse for a seller.
Use it when the seller keeps stock in more than one place. The default warehouse already exists, because it is born with the seller. Here you create the others.
Send name and, to link it to your ERP, externalId, which is unique within the seller. With isDefault: true, the new warehouse is born as the default and the previous one stops being it. Without it, the default stays the same.
curl -X POST "$BACKEND_URL/v1/sellers/$SELLER_ID/warehouses" \
-H "Authorization: Bearer mk_your_api_key" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"name":"Campinas branch","externalId":"CD-02"}'The response is 201 with the warehouse. The warehouse.created event reaches your webhooks. If the new one is the default, the previous default gets warehouse.updated.
Repeat with the same Idempotency-Key and the same body if the network fails: you get the original response and no new warehouse.
Common errors
404: the seller does not exist or belongs to another account.409withdetails.field = "externalId": another warehouse of the same seller already uses thisexternalId.
api_keyAuthorizationBearer <token>API key (mk_...)
sellerId*stringSeller the new resource belongs to.
^([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)$uuidIdempotency-Key?stringOptional. A unique value (for example a UUID), 1 to 255 characters, that makes the request safe to retry: repeating it with the same body within 24h returns the original response with Idempotency-Replayed: true instead of running the operation again. Scoped to your account. Reusing it with a different body returns 409.
1 <= length <= 255application/json- body
A new warehouse of the seller in the path.
name*stringDisplay name of the warehouse. Required, 1 to 200 characters; leading and trailing spaces are removed.
1 <= length <= 200externalId?|Optional. Your own identifier for this warehouse, 1 to 120 characters after trimming. Must be unique within the seller. Accepts null.
1 <= length <= 120isDefault?trueOptional. Send true to make this the seller's default warehouse right away, replacing the current one. Omit it to leave the current default in place. false does not exist: a new warehouse is not the default unless you ask.
trueThe created warehouse.
application/json- response
A place where a seller keeps stock. Inventory is counted per variant and warehouse.
id*stringOpaque unique identifier of the warehouse, generated by the API. Use it in the /v1/warehouses/{warehouseId} routes and as warehouseId of an inventory movement.
^([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)$uuidsellerId*stringThe seller that owns this warehouse. A warehouse never moves to another seller.
^([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)$uuidname*stringDisplay 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*booleantrue 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*stringLifecycle 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.
"active""archived"createdAt*stringWhen the warehouse was created, in ISO-8601 (UTC).
^(?:(?:\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))$date-timeupdatedAt*stringWhen the warehouse was last changed, in ISO-8601 (UTC).
^(?:(?:\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))$date-timecurl -X POST "https://example.com/v1/sellers/b6a1c0de-3f0c-4f53-9c6e-2a1d7d3b9e10/warehouses" \ -H "Content-Type: application/json" \ -d '{ "name": "Overflow warehouse", "externalId": "erp-wh-02" }'{ "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"}