Order types
SmartLogix supports two order types, which determine how the order is handled downstream:NACIONAL
Domestic orders within the same country. Standard processing with no additional documentation requirements.
INTERNACIONAL
Cross-border orders. The
observaciones field on international orders automatically receives a customs handling note at creation time.Order lifecycle
Every order starts asPENDIENTE and moves forward as your team processes it. Orders can also be cancelled at any stage.
| Status | Meaning |
|---|---|
PENDIENTE | Order submitted, awaiting approval |
APROBADO | Order approved and in processing |
EN_ENVIO | Shipment created and in progress |
ENTREGADO | Order delivered to the destination |
CANCELADO | Order cancelled at any stage |
Create an order
Send aPOST request to /api/pedidos. The productoId and cantidad fields are used to validate stock before the order is accepted.
NACIONAL order
INTERNACIONAL order
201 Created response returns the full order object. The initial status is always PENDIENTE.
Required fields
| Field | Type | Description |
|---|---|---|
userId | integer | ID of the user placing the order |
userEmail | string | Email address of the user |
clienteNombre | string | Name of the end customer |
total | number | Order total value |
tipoPedido | string | NACIONAL or INTERNACIONAL |
destino | string | Destination city or country |
productoId | integer | ID of the product being ordered |
cantidad | integer | Quantity of units requested |
Stock validation and circuit breaker
When you submit an order, the order service calls the inventory service to confirm thatstockActual >= cantidad for the given product. If stock is insufficient, the order is rejected with an error response.
SmartLogix uses a circuit breaker pattern on the stock validation call. If the inventory service is unavailable or the circuit is open due to repeated failures, the order is rejected immediately rather than being accepted with unverified stock. This is a deliberate fail-safe — it prevents overselling when stock data cannot be confirmed. Once the inventory service recovers, new orders will be accepted normally.
List and filter orders
Retrieve all orders withGET /api/pedidos. The dashboard groups orders by status — you can apply the same filter in your own integrations by inspecting the status field in the response array.
Endpoint reference
| Method | Path | Description |
|---|---|---|
GET | /api/pedidos | List all orders |
POST | /api/pedidos | Create a new order |
GET | /api/pedidos/{id} | Get an order by ID |