Skip to main content

Get All Order Items

Retrieves a list of all order items with optional filtering, sorting, and pagination.

HTTP Request

GET/api/orders/:order_id/items

Authorization

Authorization

  • Required: Yes
  • Permission: Staff or Admin
  • Authentication: Token-based (Authorization: Token <your_api_key>)

Path Parameters

ParameterTypeRequiredDescription
order_idintegerYesUnique ID of the order to retrieve items for

Query Parameters

ParameterTypeDefaultDescription
limitintegerNumber of results to return per page
offsetintegerNumber of results to skip before returning results
searchstringSearch term to filter results by `id`, `product_data__id`, `product_data__name`
orderingstringField to 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())

Status Codes

CodeDescription
200Orders retrieved successfully
400Bad request — invalid parameters
401Unauthorized — authentication required
403Forbidden — insufficient permissions
500Internal server error

Response Fields

FieldTypeDescription
idIntegerUnique ID of the order item
productIntegerUnique ID of the product
product_nameStringCurrent Product Name
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