Skip to main content

List All 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
limitinteger10Number of results to return per page
offsetinteger0Number of results to skip
searchstring—Search in `id`, `key`, `notes`, `billing_country__name`, `billing_state__name`, `billing_city__name`, `billing_first_name`, `billing_last_name`, `billing_mobile_number`
orderingstring—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`)
statusstring—Filter by order status. (`new`, `hold`, `failed`, `cancelled`, `processing`, `shipped`, `completed`, `refunded`)
status_instring—Filter by multiple order statuses (comma-separated) (`new`, `hold`, `failed`, `cancelled`, `processing`, `shipped`, `completed`, `refunded`, `deleted`)
payment_methodinteger—Filter by payment method ID
payment_method_instring—Filter by multiple payment methods (comma-separated)
shipping_methodinteger—Filter by shipping method ID
shipping_method_instring—Filter by multiple shipping methods (comma-separated)
billing_countryinteger—Filter by billing country ID
billing_stateinteger—Filter by billing state ID
billing_cityinteger—Filter by billing city ID
billing_country_instring—Filter by multiple billing countries (comma-separated)
billing_state_instring—Filter by multiple billing states (comma-separated)
billing_city_instring—Filter by multiple billing cities (comma-separated)
has_notesboolean—Filter orders with/without notes
id_mininteger—Minimum ID filter
id_maxinteger—Maximum ID filter
created_datestring—Filter by creation date
updated_datestring—Filter by last updated date
created_fromstring—Filter by creation date range start
created_tostring—Filter by creation date range end
updated_fromstring—Filter by last updated date range start
updated_tostring—Filter 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())

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 Order objects

Order Object Data Structure

FieldTypeDescription
idintegerUnique ID of the order
keystringUnique key of the order
statusstringCurrent order status (choices: `new`, `hold`, `failed`, `cancelled`, `processing`, `shipped`, `completed`, `refunded`)
customerobjectCustomer details (nullable)
payment_methodobjectPayment method details (nullable)
shipping_methodobjectShipping method details (nullable)
shipping_costdecimalCost of shipping (default=0)
notesstringOrder notes (nullable)
created_atstring (ISO 8601)Order creation timestamp
updated_atstring (ISO 8601)Order last update timestamp
billing_countryobjectBilling country details (nullable)
billing_stateobjectBilling state details (nullable)
billing_cityobjectBilling city details (nullable)
billing_addressstringBilling address (nullable)
billing_postal_codestringBilling postal code (nullable, valid 10 digit postal code)
billing_national_codestringBilling national code (nullable, valid 10 digit national code)
billing_mobile_numberstringBilling mobile number (nullable, valid iranian mobile number)
billing_first_namestringBilling first name (nullable)
billing_last_namestringBilling last name (nullable)
countintegerNumber of different products in the order
quantityintegerTotal quantity of all 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 payments are allowed on the order

Customer Object Data Structure

FieldTypeDescription
idIntegerUnique ID of the customer
usernameStringUsername of the customer
full_nameStringFull name of the customer (computed field)

Payment Method Object Data Structure

FieldTypeDescription
idIntegerUnique ID of the customer
nameStringName of the payment method
imageObjectImage details of the payment method

Image Data Structure

FieldTypeDescription
idIntegerUnique ID of the image
typeStringFile type (e.g., image)
mime_typeStringMime type of the File (e.g., image/jpeg) (nullable)
nameStringOriginal file name
sizeIntegerFile size in bytes
human_readable_sizeStringHuman readable file size (e.g., 2.5 MB)
fStringURL to access the image file
widthIntegerImage width in pixels
heightIntegerImage height in pixels
modeStringColor mode (e.g., RGB, CMYK)
thumbnailsList of thumbnail objectsImgae thumbnails

Thumbnail Data Structure

FieldTypeDescription
idIntegerUnique ID of the thumbnail (unique)
fStringURL to access the thumbnail file
sizeIntegerFile size in bytes (nullable)

Shipping Method Object Data Structure

FieldTypeDescription
idIntegerUnique ID of the shipping method
nameStringName of the shipping method
imageObjectImage details of the shipping method

Billing Country Object Data Structure

FieldTypeDescription
idIntegerUnique ID of the billing country
nameStringName of the billing country
codeStringCode of the billing country

Billing State Object Data Structure

FieldTypeDescription
idIntegerUnique ID of the billing state
nameStringName of the billing state
codeStringCode of the billing state

Billing City Object Data Structure

FieldTypeDescription
idIntegerUnique ID of the billing city
nameStringName of the billing city

Example Response​

{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 2,
"key": "0c86ab758d3e236cb5a4",
"status": "shipped",
"customer": {
"id": 1,
"username": "behrooz3500",
"full_name": "behrooz ghorbanie"
},
"payment_method": {
"id": 1,
"name": "پرداخت در محل",
"image": null
},
"shipping_method": {
"id": 1,
"name": "پیک موتور",
"image": {
"id": 8,
"type": "image",
"mime_type": "image/jpeg",
"name": "پیک موتوری",
"size": 808754,
"human_readable_size": "789.80 KB",
"f": "http://127.0.0.1:8000/media/core_media/2025/12/20/Fantasticheskie_kartinki_dlja_monitora_68_63.jpg",
"width": 1920,
"height": 1080,
"mode": "RGB",
"thumbnails": [
{
"id": 213,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_64x64.jpg",
"size": 64
},
{
"id": 214,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_128x128.jpg",
"size": 128
},
{
"id": 215,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_512x512.jpg",
"size": 512
},
{
"id": 216,
"f": "http://127.0.0.1:8000/media/core_media/2026/02/02/thumbnails/test2_ecH0zVV_thumbnail_1080x1080.jpg",
"size": 1080
}
]
}
},
"shipping_cost": 75000,
"notes": "Facilis sequi alias optio. Alias ipsam deserunt. At veniam nam et. Et aut id id aut quae non animi. Sed tempora aut ut ipsa dicta vel eveniet et aspernatur.",
"created_at": "2025-12-27T18:17:09.771123Z",
"updated_at": "2025-12-28T11:28:47.290350Z",
"billing_country": {
"id": 1,
"name": "ایران",
"code": "IR"
},
"billing_state": {
"id": 1,
"name": "آذربایجان شرقی",
"code": "EA"
},
"billing_city": {
"id": 1,
"name": "اسکو"
},
"billing_address": "5411 Stokes Grove",
"billing_postal_code": "1234567890",
"billing_national_code": null,
"billing_mobile_number": "09523296536",
"billing_first_name": "پدرام",
"billing_last_name": "زمانی",
"count": 0,
"quantity": 0,
"items_subtotal": 0,
"items_discount": 0,
"subtotal": 0,
"total_discount": 0,
"total": 75000,
"amount_paid": 50000,
"amount_outstanding": 25000,
"is_paid": false,
"is_payable": true
}
]
}

Notes​

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