This endpoint allows you to retrieve a list of orders from the e-commerce platform. You can filter orders by status, apply pagination, and control the sorting order.
/api/orders
Retrieves a list of orders based on the specified filters and pagination parameters.
Use Basic Authentication with your vendor credentials:
Authorization: Basic {base64_encoded_credentials}
Parameter | Type | Required | Description |
---|---|---|---|
status | string | No | Filter orders by status. Available options:P - In preparationH - DispatchedG - Cancellation requestedE - Sent to vendorA - Pending customer acceptanceY - Payment overdueI - CanceledB - Awaiting stockD - Payment deniedF - ErrorO - OpenC - CompletedJ - Cancellation deniedNote: Additional status codes may be available depending on the e-commerce configuration. |
items_per_page | integer | No | Number of orders to return per page. Default: 20 |
page | integer | No | Page number to retrieve. Default: 1 |
sort_order | string | No | Order of results:asc - Ascending (oldest orders first)desc - Descending (newest orders first)Default: desc
|
E
) or orders awaiting stock (B
).
GET /api/orders?status=I&page=1
GET /api/orders?status=H&items_per_page=10&page=2&sort_order=asc
{ "orders": [ { "order_id": "5138", "issuer_id": "78", "user_id": "4031", "is_parent_order": "N", "parent_order_id": "0", "company_id": "32", "company": "", "timestamp": "1660336595", "firstname": "Próximo Supermercado", "lastname": "", "email": "encarregado@proximosupermercado.com.br", "phone": "(11)98888-7654", "status": "I", "total": "9790.00", "issuer_name": "João da Silva ", "invoice_id": null, "credit_memo_id": null, "cp_em_ip": "2db423c5", "pos_order_id": null }, { "order_id": "5136", "issuer_id": "78", "user_id": "4031", "is_parent_order": "N", "parent_order_id": "0", "company_id": "32", "company": "", "timestamp": "1660335242", "firstname": "Próximo Supermercado", "lastname": "", "email": "encarregado@proximosupermercado.com.br", "phone": "(11)98888-7654", "status": "I", "total": "1353.50", "issuer_name": "João da Silva ", "invoice_id": null, "credit_memo_id": null, "cp_em_ip": "2db423c5", "pos_order_id": null }, { "order_id": "5131", "issuer_id": "217", "user_id": "4031", "is_parent_order": "N", "parent_order_id": "0", "company_id": "32", "company": "", "timestamp": "1660246473", "firstname": "Próximo Supermercado", "lastname": "", "email": "encarregado@proximosupermercado.com.br", "phone": "(11)98888-7654", "status": "I", "total": "8147.67", "issuer_name": "Hélder Ltda ", "invoice_id": null, "credit_memo_id": null, "cp_em_ip": "bb3c5eaa", "pos_order_id": null } ] }
{ "orders": [], "params": { "page": 1, "items_per_page": 20, "extra": [ "issuers", "invoice_docs", "memo_docs" ], "status": "X", "include_incompleted": false, "sort_order": "desc", "sort_by": "date", "sort_order_rev": "asc", "total_items": "0" } }
Status Code | Description |
---|---|
200 OK |
Request successful (even when no orders match the criteria) |
400 Bad Request |
Invalid request parameters |
401 Unauthorized |
Missing or invalid authentication credentials |
Field | Type | Description |
---|---|---|
orders | array | List of order objects matching the query parameters |
params | object | Query parameters used for the request (only present when no orders are found) |
Field | Type | Description |
---|---|---|
order_id | string | Unique identifier for the order |
issuer_id | string | ID of the user who placed the order |
user_id | string | ID of the customer account |
company_id | string | ID of the vendor company |
timestamp | string | Order creation timestamp (Unix format) |
firstname | string | Customer's first name or company name |
string | Customer's email address | |
phone | string | Customer's phone number |
status | string | Current order status |
total | string | Total order value |
issuer_name | string | Name of the person who placed the order |