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
searchstring—Search term to lookup results by`id`, `product_data__id`, `product_data__name`
orderingstring—Order 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
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_title": "آلاینده هوا پرایدی",
"product_data": {
"id": 1,
"code": "1000",
"slug": "test",
"image": {
"f": "http://127.0.0.1:8000/media/core_media/2026/08/01/ic_logo_dark.svg",
"id": 4,
"mode": null,
"name": "ic_logo_dark",
"size": 901,
"type": "image",
"width": null,
"height": null,
"mime_type": "image/svg+xml",
"thumbnails": [],
"human_readable_size": "901.00 B"
},
"title": "test"
},
"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": "لپ تاپ",
"product_data": {
"id": 5,
"code": null,
"slug": "laptop",
"image": {
"f": "http://127.0.0.1:8000/media/core_media/2026/07/31/file_example_WEBP_1500kB.webp",
"id": 2,
"mode": "RGB",
"name": "file_example_WEBP_1500kB",
"size": 1490952,
"type": "image",
"width": 5760,
"height": 3840,
"mime_type": "image/webp",
"thumbnails": [
{
"f": "http://127.0.0.1:8000/media/core_media/2026/07/31/thumbnails/file_example_WEBP_1500kB_thumbnail_64x64.webp",
"id": 5,
"size": 64
},
{
"f": "http://127.0.0.1:8000/media/core_media/2026/07/31/thumbnails/file_example_WEBP_1500kB_thumbnail_128x128.webp",
"id": 6,
"size": 128
},
{
"f": "http://127.0.0.1:8000/media/core_media/2026/07/31/thumbnails/file_example_WEBP_1500kB_thumbnail_512x512.webp",
"id": 7,
"size": 512
},
{
"f": "http://127.0.0.1:8000/media/core_media/2026/07/31/thumbnails/file_example_WEBP_1500kB_thumbnail_1080x1080.webp",
"id": 8,
"size": 1080
}
],
"human_readable_size": "1.42 MB"
},
"title": "لپ تاپ"
},
"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"
}
]
}