List Shipping Methods
Retrieve a list of shipping methods with optional filtering and pagination.
HTTP Request
GET/api/shipping/methods
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
| limit | integer | 10 | Number of results per page |
| offset | integer | 0 | Number of results to skip |
| search | string | — | Search term to filter results by `id`, `name` and `description` |
| ordering | string | — | Order results by field (`id`, `name`, `order`, `active`, `created_at`, `updated_at`) |
| active | boolean | — | Filter by active status |
| order_min | integer | — | Minimum order value to filter results by |
| order_max | integer | — | Maximum order value to filter results by |
| has_image | boolean | — | Filter results to only include shipping methods with an associated image |
| has_formula | boolean | — | Filter results to only include shipping methods with a formula defined |
| id_min | integer | — | Minimum ID to filter results by |
| id_max | integer | — | Maximum ID to filter results by |
| created_date | string | — | Filter results by creation date (e.g., 2023-01-01) |
| updated_date | string | — | Filter results by last updated date (e.g., 2023-01-01) |
| created_from | string | — | Filter results by creation date range start (e.g., 2023-01-01) |
| created_to | string | — | Filter results by creation date range end (e.g., 2023-12-31) |
| updated_from | string | — | Filter results by last updated date range start (e.g., 2023-01-01) |
| updated_to | string | — | Filter results by last updated date range end (e.g., 2023-12-31) |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3# List all shipping methods
4response = requests.get('http://www.example.com/api/shipping/methods',
5 headers={'Authorization': 'Token <your_api_key>'}
6)
7print(response.json())
8
9# Filter active shipping methods
10response = requests.get('http://www.example.com/api/shipping/methods', params={
11 'active': True,
12 'ordering': 'order',
13 'limit': 20
14}, headers={'Authorization': 'Token <your_api_key>'})
15print(response.json())
16
17# Search for shipping methods by name
18response = requests.get('http://www.example.com/api/shipping/methods', params={
19 'name': 'Standard',
20 'active': True
21}, headers={'Authorization': 'Token <your_api_key>'})
22print(response.json())1# List all shipping methods
2curl "http://www.example.com/api/shipping/methods" -H "Authorization: Token <your_api_key>"
3
4# Filter active shipping methods
5curl "http://www.example.com/api/shipping/methods?active=true&ordering=order&limit=20" -H "Authorization: Token <your_api_key>"
6
7# Search for shipping methods by name
8curl "http://www.example.com/api/shipping/methods?name=Standard&active=true" -H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 200 | Shipping methods retrieved successfully |
| 400 | Bad request — invalid parameters |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | integer | Unique ID of the shipping method |
| active | boolean | Whether the shipping method is active |
| order | integer | The order in which the shipping method appears |
| name | string | Name of the shipping method |
| image_data | object | Image data associated with the shipping method (id, type, name, size, human_readable_size, f, width, height, mode) |
| description | string | Description of the shipping method |
| formula | string | Formula for calculating shipping costs |
| created_at | string (ISO 8601) | Timestamp when the shipping method was created |
| updated_at | string (ISO 8601) | Timestamp when the shipping method was last updated |
Image Data Object Fields:
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the image |
| type | String | File type (read-only, auto-detected) |
| name | String | Original filename |
| size | Integer | File size in bytes (read-only) |
| human_readable_size | String | Human-readable file size (e.g., "2.5 MB") |
| f | String | File URL/path |
| width | Integer | Image width in pixels (images only, read-only) |
| height | Integer | Image height in pixels (images only, read-only) |
| mode | String | Image color mode (images only, read-only) |