Skip to main content

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

ParameterTypeRequiredDescription
order_idintegerYesUnique ID of the order to retrieve items for

Query Parameters

ParameterTypeDefaultDescription
limitinteger10Number of results to return per page
offsetinteger0Number of results to skip before returning results
searchstringSearch term to lookup results by`id`, `product_data__id`, `product_data__name`
orderingstringOrder results by (`id`, `order__id`, `order__status`, `product__id`, `product__name`, `unit_price`, `unit_discount`, `quantity`, `created_at`, `updated_at`)

Example Requests

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())

Response Fields

FieldTypeDescription
countIntegerTotal number of categories
nextStringURL for the next page of results
previousStringURL for the previous page of results
resultsArray[Object]Array of OrderItem objects

OrderItem Object Data Structure

FieldTypeDescription
idIntegerUnique ID of the order item
productIntegerUnique ID of the product
product_titleStringCurrent Product Title
product_dataObjectSnapshot of product data at time of order
unit_priceIntegerPrice per unit (in smallest currency unit)
unit_discountIntegerDiscount per unit (in smallest currency unit)
quantityIntegerQuantity ordered
notesStringItem-specific notes
subtotalIntegerCalculated subtotal (computed field)
discountIntegerTotal discount for this item (computed field)
totalIntegerFinal total for this item (computed field)
created_atString (ISO 8601)Item creation timestamp
updated_atString (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"
}
]
}