POST /v1/ecommerce/products/:id/stock/transfer
Move stock of a product or variant between the warehouse and branches. The total does not change.
POST
Traspasar stock entre bodega y sucursales
Moves units from one place to another. Without
from_branch_id they leave the warehouse; without to_branch_id they go back to the warehouse. Between two branches, pass both.
The master total stays the same: only where the units sit changes. The move leaves a transfer entry in the stock movements.
Endpoint
Required scope
ecommerce:stock:write
The scope comes from your role. Minting a token with
ecommerce:stock:write requires the permission to adjust and transfer stock in your Keebai role, unless you are the company owner or a superuser. See scopes.Headers
Path parameters
Body
Where the units go
Example request
Response
200 OK
The product’s stock after the transfer, in the same shape asGET /v1/ecommerce/products/{id}/stock.
400 Bad Request
The body does not match the schema — for examplequantity below 1 — or one of these:
401 Unauthorized
Missing, invalid, revoked, or expired token.403 Forbidden
The token does not have theecommerce:stock:write scope.
404 Not Found
No product with that id, or it belongs to a different company.502 Bad Gateway
ECOMMERCE_UPSTREAM_ERROR — the ecommerce service could not answer.
Operational notes
- The total never changes. A transfer only moves units between the warehouse and branches. To add or remove stock, adjust it.
- This call is not idempotent. Retrying after a timeout moves the units twice. Check the stock movements before retrying.
Authorizations
Personal Access Token con prefijo kbai_pk_. Generar desde el portal con permiso developer.manage_tokens.
Path Parameters
Body
application/json
Unidades a traspasar
Required range:
x >= 1ObjectId de la variante. Obligatorio si el producto tiene más de una
Sucursal de origen. Sin ella, sale de la bodega
Sucursal de destino. Sin ella, vuelve a la bodega
Motivo del traspaso
Maximum string length:
500Traspasar stock entre bodega y sucursales