Orders
Retrieve customer's order history with detailed information.
HTTP Request
GET/api/shop/customers/me/orders
Authorization
Authorization
- Required: Yes
- Permission: Authenticated Customer
- Authentication: Token-based (`Authorization: Token <your_api_key>`)
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | — | Number of results to return per page |
| offset | integer | — | Number of results to skip |
| search | string | — | Search in `id`, `key`, `notes`, `billing_country__name`, `billing_state__name`, `billing_city__name`, `billing_first_name`, `billing_last_name`, `billing_mobile_number` |
| ordering | string | — | Field to order results by (`id`, `created_at`, `updated_at`, `status`, `shipping_cost`, `billing_country__name`, `billing_state__name`, `billing_city__name`, `payment_method__name`, `shipping_method__name`) |
| status | string | — | Filter by order status. (`new`, `hold`, `failed`, `cancelled`, `processing`, `shipped`, `completed`, `refunded`, `deleted`) |
| status_in | string | — | Filter by multiple order statuses (comma-separated) (`new`, `hold`, `failed`, `cancelled`, `processing`, `shipped`, `completed`, `refunded`, `deleted`) |
| payment_method | integer | — | Filter by payment method ID |
| payment_method_in | string | — | Filter by multiple payment methods (comma-separated) |
| shipping_method | integer | — | Filter by shipping method ID |
| shipping_method_in | string | — | Filter by multiple shipping methods (comma-separated) |
| billing_country | integer | — | Filter by billing country ID |
| billing_state | integer | — | Filter by billing state ID |
| billing_city | integer | — | Filter by billing city ID |
| billing_country_in | string | — | Filter by multiple billing countries (comma-separated) |
| billing_state_in | string | — | Filter by multiple billing states (comma-separated) |
| billing_city_in | string | — | Filter by multiple billing cities (comma-separated) |
| is_paid | boolean | — | Filter by payment status (paid/unpaid) |
| is_payable | boolean | — | Filter by whether order can be paid |
| has_notes | boolean | — | Filter orders with/without notes |
| id_min | integer | — | Minimum ID filter |
| id_max | integer | — | Maximum ID filter |
| created_date | string | — | Filter by creation date |
| updated_date | string | — | Filter by last updated date |
| created_from | string | — | Filter by creation date range start |
| created_to | string | — | Filter by creation date range end |
| updated_from | string | — | Filter by last updated date range start |
| updated_to | string | — | Filter by last updated date range end |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# List customer orders
4response = requests.get('http://www.example.com/api/shop/customers/me/orders',
5 params={
6 'ordering': '-created_at',
7 'limit': 20,
8 'status': 'completed'
9 },
10 headers={'Authorization': 'Token <your_api_key>'}
11)
12print(response.json())
13
14# Filter orders by payment method and date
15response = requests.get('http://www.example.com/api/shop/customers/me/orders',
16 params={
17 'payment_method': 1,
18 'created_from': '2024-01-01',
19 'status_in': 'pending,processing,completed'
20 },
21 headers={'Authorization': 'Token <your_api_key>'}
22)
23print(response.json())1# List customer orders with filters
2curl "http://www.example.com/api/shop/customers/me/orders?ordering=-created_at&status=completed&limit=20" -H "Authorization: Token <your_api_key>"
3
4# Filter orders by multiple criteria
5curl "http://www.example.com/api/shop/customers/me/orders?payment_method=1&created_from=2024-01-01&status_in=pending,processing" -H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 200 | Orders retrieved successfully |
| 401 | Unauthorized — authentication required |
| 400 | Bad request — validation errors |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | integer | Unique ID of the order |
| key | string | Unique key of the order |
| status | string | Current order status |
| customer | object | Customer details |
| payment_method | object | Payment method details |
| shipping_method | object | Shipping method details |
| shipping_cost | decimal | Cost of shipping |
| notes | string | Order notes |
| created_at | string (ISO 8601) | Order creation timestamp |
| updated_at | string (ISO 8601) | Order last update timestamp |
| billing_country | object | Billing country details |
| billing_state | object | Billing state details |
| billing_city | object | Billing city details |
| billing_address | string | Billing address |
| billing_postal_code | string | Billing postal code |
| billing_national_code | string | Billing national code |
| billing_mobile_number | string | Billing mobile number |
| billing_first_name | string | Billing first name |
| billing_last_name | string | Billing last name |
| count | integer | Number of different products in the order |
| quantity | integer | Total quantity of items in the order |
| items_subtotal | decimal | Subtotal of all items before discounts |
| items_discount | decimal | Total discount applied to items |
| subtotal | decimal | Order subtotal after item discounts |
| total_discount | decimal | Total discount amount on the order |
| total | decimal | Final order total after all discounts and shipping costs |
| amount_paid | decimal | Amount already paid towards the order |
| amount_outstanding | decimal | Outstanding amount yet to be paid |
| is_paid | boolean | Whether the order is fully paid |
| is_payable | boolean | Whether the order can be paid |
Notes
- If
is_payableis false, the order cannot be paid (e.g.,canceledorrefunded) - If
is_paidis true,amount_outstandingwill be zero