Create a new order
POST/api/orders
Creates a shipping order, generates the shipping label and deducts the cost from the prepaid balance.
Before creating the order, get these IDs:
| Order field | Where it comes from | Response field |
|---|---|---|
branchInfo.branchAddressId (pickup address) | GET /api/branchs/branchsAddresses, or the one returned by POST /api/branchs/branchsAddresses when creating it | branchAddressId |
branchInfo.branchsClientId (client and delivery address) | GET /api/branchs/branchsClient or GET /api/branchs/branchsClient/search, or the one returned by POST /api/branchs/branchsClient when registering it | branchsClientId |
courier.courierServiceId (courier and service) | POST /api/courier (quote), sending the pickup address and the client's municipality | courierServiceId |
courier.agencias (optional) | GET /api/courier/agencies, only if the courier works with agencies | Agency ID |
The delivery address is not sent separately: it is the one registered for the client.
Validation is done by section (branchInfo, courier, location, product, order) and the first error found is reported.
Request
Responses
- 201
- 400
- 401
- 409
- 422
- 500
Order created successfully
Invalid request data
The token is missing, expired (it lasts 15 minutes) or invalid. Log in again to get a new one.
Business rule (insufficient amount, address that does not belong to the merchant, balance)
The courier could not generate the shipping label receipt. Try again or choose another service from the quote.
Internal error while creating the order. The message may vary and include the error details.