List All Order Payments
Retrieves a list of all order payments for a specific order with optional filtering, sorting, and pagination.
HTTP Request
GET/api/orders/:order_id/payments
Authorization
Authorization
- Required: Yes
- Permission: Staff with OrderPaymentPermission or Admin
- Permission Code: 2242
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| order_id | integer | Yes | Unique ID of the order to retrieve payments for |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 10 | Number of results to return per page |
| offset | integer | 0 | Number of results to skip before returning results |
| search | string | — | Search term to lookup results by`id`, `transaction_id`, `payment_method__name` |
| ordering | string | -created_at | Order results by (`id`, `transaction_id`, `approved`, `amount`, `payment_method__id`, `payment_method__name`, `order__id`, `order__status`, `created_at`, `updated_at`) |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# List all payments for an order
4response = requests.get('http://www.example.com/api/orders/123/payments',
5 headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())
8
9# Search for payments with filters
10response = requests.get('http://www.example.com/api/orders/123/payments', params={
11 'search': 'TXN123',
12 'approved': True,
13 'ordering': '-created_at',
14 'limit': 20
15}, headers={'Authorization': 'Token <your_api_key>'})
16print(response.json())
17
18# Filter by payment amount
19response = requests.get('http://www.example.com/api/orders/123/payments', params={
20 'ordering': 'amount'
21}, headers={'Authorization': 'Token <your_api_key>'})
22print(response.json())1# List all payments for an order
2curl "http://www.example.com/api/orders/123/payments" -H "Authorization: Token <your_api_key>"
3
4# Search with filters
5curl "http://www.example.com/api/orders/123/payments?search=TXN123&approved=true&ordering=-created_at&limit=20" -H "Authorization: Token <your_api_key>"
6
7# Filter by amount
8curl "http://www.example.com/api/orders/123/payments?ordering=amount" -H "Authorization: Token <your_api_key>"Response Fields
| Field | Type | Description |
|---|---|---|
| count | Integer | Total number of categories |
| next | String | URL for the next page of results |
| previous | String | URL for the previous page of results |
| results | Array[Object] | Array of OrderPayment objects |
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the order payment |
| payment_method_data | Object | Payment method details (read-only) |
| approved | Boolean | Whether the payment is approved |
| amount | Integer | Payment amount (in smallest currency unit) |
| transaction_id | String | External transaction identifier |
| notes | String | Additional notes about the payment |
| created_at | String (ISO 8601) | Timestamp when payment was created |
| updated_at | String (ISO 8601) | Timestamp when payment was last updated |
Payment Method Data Fields:
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the payment method |
| name | String | Name of the payment method |
| image | Object | Image details for the payment method |
Image Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the image |
| type | String | File type (e.g., image/jpeg) |
| name | String | Original file name |
| size | Integer | File size in bytes |
| human_readable_size | String | Human readable file size (e.g., 2.5 MB) |
| f | String | URL to access the image file |
| width | Integer | Image width in pixels |
| height | Integer | Image height in pixels |
| mode | String | Color mode (e.g., RGB, CMYK) |
| thumbnails | List of thumbnail objects | Imgae thumbnails |
Thumbnail Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the thumbnail (unique) |
| f | String | URL to access the thumbnail file |
| size | Integer | File size in bytes (nullable) |
Example Response
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"payment_method_data": {
"id": 1,
"name": "پرداخت در مخل",
"image": null
},
"approved": true,
"amount": 500000,
"transaction_id": "1589800",
"notes": "",
"created_at": "2025-12-28T10:43:38.509103Z",
"updated_at": "2025-12-28T10:43:38.509107Z"
}
]
}