Skip to main content

List Payment Methods

Retrieves a list of payment methods with optional filtering and pagination.

HTTP Request

GET/api/payment/methods

Authorization

Authorization

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

Query Parameters

ParameterTypeDefaultDescription
limitinteger10Number of results per page
offsetinteger0Number of results to skip
orderingstring-created_atSort order (`id`, `name`, `order`, `active`, `created_at`, `updated_at`)
searchstringSearch in (`id`, `name`, `description`)
id_minintegerMinimum ID filter
id_maxintegerMaximum ID filter
created_datestringFilter by creation date (e.g., 2023-01-01)
updated_datestringFilter by last updated date (e.g., 2023-01-01)
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
backendstringFilter by backend type (`zarinpal`, `pay-on-delivery`)
activebooleanFilter by active status
order_minintegerMinimum row-order value filter
order_maxintegerMaximum row-order value filter
has_imagebooleanFilter payment methods with/without an associated image

Example Requests

1import requests
2
3# List all payment methods
4response = requests.get('http://www.example.com/api/payment/methods',
5  headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())
8
9# List active payment methods only
10response = requests.get('http://www.example.com/api/payment/methods', params={
11  'active': True,
12  'ordering': 'order'
13}, headers={'Authorization': 'Token <your_api_key>'})
14print(response.json())
15
16# Filter by backend type
17response = requests.get('http://www.example.com/api/payment/methods', params={
18  'backend': 'zarinpal',
19  'active': True
20}, headers={'Authorization': 'Token <your_api_key>'})
21print(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 payment method objects

PaymentMethod Object Structure

FieldTypeDescription
idIntegerUnique ID of the payment method
backendStringBackend identifier for the payment method (choices: ZaringPal, Zibal, PayOnDelivery)
activeBooleanWhether the payment method is active
orderIntegerRow-order of the payment method in the list(nullable)
nameStringName of the payment method (unique)
image_dataObjectImage details (read-only)
descriptionStringDescription of the payment method (nullable)
settingsJsonFieldAdditional settings for the payment method (default=dict)
created_atString (ISO 8601)Timestamp when the payment method was created
updated_atString (ISO 8601)Timestamp when the payment method was last updated

Image Data Structure

FieldTypeDescription
idIntegerUnique ID of the image
typeStringFile type (e.g., image/jpeg)
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)

Example Response

{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 2,
"active": true,
"backend": "zarinpal",
"order": 3,
"name": "زرین پال",
"image_data": {
"id": 5,
"type": "image",
"name": "keyboard",
"size": 2131742,
"human_readable_size": "2.03 MB",
"f": "http://127.0.0.1:8000/media/core_media/2025/11/29/Fantasticheskie_kartinki_dlja_monitora_68_96.jpg",
"width": 2560,
"height": 1600,
"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
}
]
},
"description": "پرداخت با درگاه آنلاین زرین پال",
"settings": {
"token": "some-very-hard-token"
},
"auto_approve_payments": true,
"created_at": "2025-12-20T17:55:44.361021Z",
"updated_at": "2025-12-20T17:55:44.361027Z"
},
{
"id": 1,
"active": true,
"backend": "pay-on-delivery",
"order": null,
"name": "پرداخت در مخل",
"image_data": null,
"description": "",
"settings": {},
"auto_approve_payments": true,
"created_at": "2025-12-20T17:54:59.658436Z",
"updated_at": "2025-12-20T17:54:59.658441Z"
}
]
}