Get All Shipping Addresses
This API endpoint retrieves a list of shipping addresses with pagination and filtering options. You can specify parameters such as page number, limit, and filters to retrieve specific shipping addresses.
HTTP Request
- URL:
/shippingAddress/all - Method:
GET
Authentication
To access this endpoint, you must include a valid access token in the request header.
- Header:
accessToken - Type: Bearer Token
- Value:
<ACCESS-TOKEN>
Request Headers
| Header | Type | Description |
|---|---|---|
accessToken | string | Access token for authentication. (required) |
Query Parameters
To effectively paginate and filter your API requests, include the following query parameters:
| Parameter | Type | Description |
|---|---|---|
page | Integer | The page number to retrieve (default is 1). |
limit | Integer | The number of items to retrieve per page (default is 10). |
id:in | String | Comma-separated list of shipping address IDs to include. |
date_modified:max | String | Include shipping addresses modified on or before this date (ISO format). |
date_modified:min | String | Include shipping addresses modified on or after this date (ISO format). |
Sample Request
Here’s a sample cURL command to demonstrate how to make a request to this API endpoint:
curl --location '<BASE_URL>/shippingAddress/all' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
Success Response
| Status Code | Description |
|---|---|
| 200 OK | The request was successful, and the server returned a list of shipping addresses. |
Response Structure
When successfully retrieving shipping addresses, the response will include the following structure:
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates whether the request was successful. |
data | array | An array of shipping address objects containing detailed information. |
pagination | object | Pagination details for navigating large sets of shipping addresses. |
Shipping Address Object Structure
Each object in the data array contains the following fields:
| Field | Type | Description |
|---|---|---|
companyName | string | Company name of this recipient (Optional). |
companyEmail | string | Company email of the recipient (Optional) |
firstName | String | First name of the recipient. |
lastName | String | Last name of the recipient. |
address1 | String | Primary address line. |
address2 | String | Secondary address line (optional). |
phoneNumber | String | Contact phone number. |
city | String | City of the shipping address. |
state | Object | State information (contains name and code). |
country | Object | Country information (contains name and code). |
zipcode | String | Postal code of the shipping address. |
isDefaultAddress | Boolean | Indicates if this is the default shipping address. |
status | Boolean | Status of the address (e.g., active or inactive). |
metaFields | Array | Additional meta information associated with the address (optional). |
createdAt | String | Date and time the address was created (ISO format). |
updatedAt | String | Date and time the address was last updated (ISO format). |
company | String | The company associated with the shipping address. |
id | String | Unique identifier for the shipping address. |
Pagination Object Structure
The pagination object contains the following fields:
| Field | Type | Description |
|---|---|---|
page | Integer | The current page number. |
total | Integer | The total number of shipping addresses available. |
count | Integer | The number of shipping addresses returned on the current page. |
Sample JSON Response
Here’s an example of the JSON response you might receive from this endpoint:
{
"success": true,
"data": [
{
"firstName": "John",
"lastName": "Doe",
"address1": "123 Maple St",
"address2": "Apt 4B",
"phoneNumber": "1234567890",
"city": "New York",
"state": {
"name": "New York",
"code": "NY"
},
"country": {
"name": "United States",
"code": "US"
},
"zipcode": "10001",
"isDefaultAddress": true,
"status": true,
"metaFields": [],
"createdAt": "2024-01-10T12:00:00Z",
"updatedAt": "2024-01-12T12:00:00Z",
"company": "5f8d04f2c6071200213a9e5b",
"id": "5f8d04f2c6071200213a9e5d"
}
],
"pagination": {
"page": 1,
"total": 100,
"count": 10
}
}
Error Responses
| Status Code | Description |
|---|---|
| 400 Bad Request | The request was malformed or invalid. |
| 401 Unauthorized | The access token is invalid or missing. |
| 403 Forbidden | You do not have permission to access this resource. |
| 404 Not Found | The requested resource could not be found. |
| 500 Internal Server Error | An error occurred on the server. |
Notes
- Ensure the access token is valid and active to authenticate the request successfully.
- The API supports pagination and filtering, which should be included in the query parameters if applicable.
- Date fields (
date_modified:min,date_modified:max) must be in the ISO 8601 format, e.g.,2024-09-30T00:00:00Z.