Retrieve Order
Retrieve a specific order item by its unique ID.
HTTP Request
GET/api/orders/:order_id/items/:id
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 |
| id | Integer | Yes | Unique ID of the order item to retrieve |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3response = requests.get('http://www.example.com/api/orders/123/items/2',
4 headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.json())1curl "http://www.example.com/api/orders/123/items/2" -H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the order item |
| product | Integer | Unique ID of the product |
| product_name | String | Current Product Name |
| 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 Response
{
"id": 8,
"product": 36,
"product_title": "ماوس لاجیتک MX Vertical",
"product_data": {
"id": 36,
"code": "1001001",
"slug": "logitech-mouse-mx-vertical",
"image": {
"f": "http://127.0.0.1:8000/media/core_media/2025/11/22/logitech-mx-1.jpg",
"id": 2,
"mode": "RGB",
"name": "logitech-mx-1",
"size": 4766,
"type": "image",
"width": 225,
"height": 225,
"human_readable_size": "4.65 KB"
},
"title": "ماوس لاجیتک MX Vertical"
},
"unit_price": 9780000,
"unit_discount": 80000,
"quantity": 5,
"notes": "some random note",
"subtotal": 48900000,
"discount": 400000,
"total": 48500000,
"created_at": "2025-12-28T11:29:10.190784Z",
"updated_at": "2025-12-28T11:29:10.190792Z"
}