Retrieve Customer Address
Retrieves detailed information about a specific customer address.
HTTP Request
GET/api/customers/:customer_pk/addresses/:id
Authorization
Authorization
- Required: Yes
- Permission: Staff or Admin
- Authentication: Token-based (Authorization: Token <your_api_key>)
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| customer_pk | Integer | Yes | Unique ID of the customer |
| id | Integer | Yes | Unique ID of the address |
Example Requests
- 🐍 Python
- 🌐 Curl
1import requests
2
3response = requests.get('http://www.example.com/api/customers/123/addresses/456',
4 headers={'Authorization': 'Token <your_api_key>'}
5)
6print(response.json())1curl "http://www.example.com/api/customers/123/addresses/456" -H "Authorization: Token <your_api_key>"Status Codes
| Code | Description |
|---|---|
| 200 | Customer address retrieved successfully |
| 401 | Unauthorized — authentication required |
| 403 | Forbidden — insufficient permissions |
| 404 | Customer or address not found |
| 500 | Internal server error |
Response Fields
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the address |
| default | Boolean | Whether this is the customer's default address |
| country_data | Object | Country information with id, name, etc. |
| state_data | Object | State information with id, name, etc. |
| city_data | Object | City information with id, name, etc. |
| address | String | Street address |
| postal_code | String | Postal/ZIP code |
| first_name | String | First name on the address |
| last_name | String | Last name on the address |
| national_code | String | National identification code |
| mobile_number | String | Mobile phone number for this address |
| text | String | Additional text/notes for the address |
| created_at | String (ISO 8601) | Timestamp when address was created |
| updated_at | String (ISO 8601) | Timestamp when address was last updated |
Country Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the country |
| name | String | Name of the country |
| code | String | ISO country code (e.g., US, CA) |
State Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the state |
| name | String | Name of the state |
| code | String | State code (if applicable) |
City Data Structure
| Field | Type | Description |
|---|---|---|
| id | Integer | Unique ID of the city |
| name | String | Name of the city |