List All Order Items
Retrieves a list of all order items of a specific order with optional filtering, sorting, and pagination.
HTTP Request
GET/api/orders/:order_id/items
Authorization
Authorization
- Required: Yes
- Permission: Staff with OrderItemPermission or Admin
- Permission Code: 2222
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| order_id | integer | Yes | Unique ID of the order to retrieve items for |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 10 | Number of results to return per page |
| offset | integer | 0 | Number of results to skip before returning results |
| search | string | — | Search term to lookup results by`id`, `product_data__id`, `product_data__name` |
| ordering | string | — | Order results by (`id`, `order__id`, `order__status`, `product__id`, `product__name`, `unit_price`, `unit_discount`, `quantity`, `created_at`, `updated_at`) |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3response = requests.get('http://www.example.com/api/orders/123/items',
4 headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.json())1curl "http://www.example.com/api/orders/123/items" -H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| count | Integer | Total number of categories |
| next | String | URL for the next page of results |
| previous | String | URL for the previous page of results |
| results | Array[Object] | Array of OrderItem objects |
OrderItem Object Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the order item |
| product | Integer | Unique ID of the product |
| product_title | String | Current Product Title |
| product_data | Object | Snapshot of product data at time of order |
| unit_price | Integer | Price per unit (in smallest currency unit) |
| unit_discount | Integer | Discount per unit (in smallest currency unit) |
| quantity | Integer | Quantity ordered |
| notes | String | Item-specific notes |
| subtotal | Integer | Calculated subtotal (computed field) |
| discount | Integer | Total discount for this item (computed field) |
| total | Integer | Final total for this item (computed field) |
| created_at | String (ISO 8601) | Item creation timestamp |
| updated_at | String (ISO 8601) | Item last update timestamp |
Example Respones
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 2,
"product": 53,
"product_title": "آلاینده هوا پرایدی",
"product_data": {
"key": "value"
},
"unit_price": 980000,
"unit_discount": 80000,
"quantity": 10,
"notes": "",
"subtotal": 9800000,
"discount": 800000,
"total": 9000000,
"created_at": "2025-12-28T10:43:38.508594Z",
"updated_at": "2025-12-28T10:43:38.508598Z"
},
{
"id": 1,
"product": 36,
"product_title": "ماوس لاجیتک MX Vertical",
"product_data": {},
"unit_price": 8500000,
"unit_discount": 500000,
"quantity": 5,
"notes": "handle with care",
"subtotal": 42500000,
"discount": 2500000,
"total": 40000000,
"created_at": "2025-12-28T10:43:38.506842Z",
"updated_at": "2025-12-28T10:43:38.506846Z"
}
]
}