List Orders
Retrieve a list of orders for your tenant with optional filtering and pagination.
Requires read:orders scope.
Request
Query Parameters
Page number for pagination
Number of orders per page (max 100)
Filter by order state ID(s)
Filter orders created on or after this date (YYYY-MM-DD)
Filter orders created on or before this date (YYYY-MM-DD)
Filter by assembly/ship date (YYYY-MM-DD)
Include order line items in response
Response
Whether the request was successful
Total number of orders matching filters
Examples
Basic Request
curl -X GET "https://api.zenflow.com.ar/api/v1/orders?page=1&limit=20" \
-H "X-API-Key: zenflow_live_your_key"
Response
{
"success": true,
"data": {
"orders": [
{
"id": 12345,
"order_tenant_id": "ORD-001",
"state_id": 1,
"state_name": "Pending",
"assembly_date": "2024-01-15",
"customer_name": "John Doe",
"items_count": 3,
"created_at": "2024-01-14T10:30:00Z",
"updated_at": "2024-01-14T10:30:00Z"
},
{
"id": 12346,
"order_tenant_id": "ORD-002",
"state_id": 2,
"state_name": "In Progress",
"assembly_date": "2024-01-15",
"customer_name": "Jane Smith",
"items_count": 1,
"created_at": "2024-01-14T11:00:00Z",
"updated_at": "2024-01-14T14:30:00Z"
}
],
"pagination": {
"total": 150,
"page": 1,
"limit": 20,
"total_pages": 8
}
}
}
With Filters
curl -X GET "https://api.zenflow.com.ar/api/v1/orders?state_id=1&state_id=2&start_date=2024-01-01&include_details=true" \
-H "X-API-Key: zenflow_live_your_key"
Error Responses
401 Unauthorized
{
"success": false,
"error": {
"code": "invalid_api_key",
"message": "The API key provided is invalid"
}
}
403 Forbidden
{
"success": false,
"error": {
"code": "insufficient_scope",
"message": "This API key does not have the required scope: read:orders"
}
}