Skip to main content

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

ParameterTypeDefaultDescription
limitintegerNumber of results to return per page
offsetintegerNumber of results to skip
searchstringSearch in `id`, `key`, `notes`, `billing_country__name`, `billing_state__name`, `billing_city__name`, `billing_first_name`, `billing_last_name`, `billing_mobile_number`
orderingstringField 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`)
statusstringFilter by order status. (`new`, `hold`, `failed`, `cancelled`, `processing`, `shipped`, `completed`, `refunded`, `deleted`)
status_instringFilter by multiple order statuses (comma-separated) (`new`, `hold`, `failed`, `cancelled`, `processing`, `shipped`, `completed`, `refunded`, `deleted`)
payment_methodintegerFilter by payment method ID
payment_method_instringFilter by multiple payment methods (comma-separated)
shipping_methodintegerFilter by shipping method ID
shipping_method_instringFilter by multiple shipping methods (comma-separated)
billing_countryintegerFilter by billing country ID
billing_stateintegerFilter by billing state ID
billing_cityintegerFilter by billing city ID
billing_country_instringFilter by multiple billing countries (comma-separated)
billing_state_instringFilter by multiple billing states (comma-separated)
billing_city_instringFilter by multiple billing cities (comma-separated)
is_paidbooleanFilter by payment status (paid/unpaid)
is_payablebooleanFilter by whether order can be paid
has_notesbooleanFilter orders with/without notes
id_minintegerMinimum ID filter
id_maxintegerMaximum ID filter
created_datestringFilter by creation date
updated_datestringFilter by last updated date
created_fromstringFilter by creation date range start
created_tostringFilter by creation date range end
updated_fromstringFilter by last updated date range start
updated_tostringFilter by last updated date range end

Example Requests

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

Status Codes

CodeDescription
200Orders retrieved successfully
401Unauthorized — authentication required
400Bad request — validation errors
500Internal server error

Response Fields

FieldTypeDescription
idintegerUnique ID of the order
keystringUnique key of the order
statusstringCurrent order status
customerobjectCustomer details
payment_methodobjectPayment method details
shipping_methodobjectShipping method details
shipping_costdecimalCost of shipping
notesstringOrder notes
created_atstring (ISO 8601)Order creation timestamp
updated_atstring (ISO 8601)Order last update timestamp
billing_countryobjectBilling country details
billing_stateobjectBilling state details
billing_cityobjectBilling city details
billing_addressstringBilling address
billing_postal_codestringBilling postal code
billing_national_codestringBilling national code
billing_mobile_numberstringBilling mobile number
billing_first_namestringBilling first name
billing_last_namestringBilling last name
countintegerNumber of different products in the order
quantityintegerTotal quantity of items in the order
items_subtotaldecimalSubtotal of all items before discounts
items_discountdecimalTotal discount applied to items
subtotaldecimalOrder subtotal after item discounts
total_discountdecimalTotal discount amount on the order
totaldecimalFinal order total after all discounts and shipping costs
amount_paiddecimalAmount already paid towards the order
amount_outstandingdecimalOutstanding amount yet to be paid
is_paidbooleanWhether the order is fully paid
is_payablebooleanWhether the order can be paid

Notes

    • If is_payable is false, the order cannot be paid (e.g., canceled or refunded)
    • If is_paid is true, amount_outstanding will be zero