Skip to main content

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

HeaderTypeDescription
accessTokenstringAccess token for authentication. (required)

Query Parameters

To effectively paginate and filter your API requests, include the following query parameters:

ParameterTypeDescription
pageIntegerThe page number to retrieve (default is 1).
limitIntegerThe number of items to retrieve per page (default is 10).
id:inStringComma-separated list of shipping address IDs to include.
date_modified:maxStringInclude shipping addresses modified on or before this date (ISO format).
date_modified:minStringInclude 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 CodeDescription
200 OKThe 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:

FieldTypeDescription
successbooleanIndicates whether the request was successful.
dataarrayAn array of shipping address objects containing detailed information.
paginationobjectPagination details for navigating large sets of shipping addresses.

Shipping Address Object Structure

Each object in the data array contains the following fields:

FieldTypeDescription
companyNamestringCompany name of this recipient (Optional).
companyEmailstringCompany email of the recipient (Optional)
firstNameStringFirst name of the recipient.
lastNameStringLast name of the recipient.
address1StringPrimary address line.
address2StringSecondary address line (optional).
phoneNumberStringContact phone number.
cityStringCity of the shipping address.
stateObjectState information (contains name and code).
countryObjectCountry information (contains name and code).
zipcodeStringPostal code of the shipping address.
isDefaultAddressBooleanIndicates if this is the default shipping address.
statusBooleanStatus of the address (e.g., active or inactive).
metaFieldsArrayAdditional meta information associated with the address (optional).
createdAtStringDate and time the address was created (ISO format).
updatedAtStringDate and time the address was last updated (ISO format).
companyStringThe company associated with the shipping address.
idStringUnique identifier for the shipping address.

Pagination Object Structure

The pagination object contains the following fields:

FieldTypeDescription
pageIntegerThe current page number.
totalIntegerThe total number of shipping addresses available.
countIntegerThe 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 CodeDescription
400 Bad RequestThe request was malformed or invalid.
401 UnauthorizedThe access token is invalid or missing.
403 ForbiddenYou do not have permission to access this resource.
404 Not FoundThe requested resource could not be found.
500 Internal Server ErrorAn 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.