Skip to main content

Get Shipping Address

This GET API endpoint retrieves a specific shipping address by its unique identifier ID.

HTTP Request

  • URL: /shippingAddress/{address_id}
  • 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)

Path Parameters

ParameterTypeDescription
address_idstringThe unique identifier of the shipping address to be retrieved.

Sample Request

Here’s a sample cURL command to demonstrate how to make a request to this API endpoint:

curl --location --request GET '<BASE_URL>/shippingAddress/66c81e2ed484025cfe9bca3b' \
--header 'accessToken: <ACCESS_TOKEN>'

Response

Success Response

Status CodeDescription
200 OKThe request was successful, and the server returned the specified shipping address.

Response Structure

When successfully retrieving the shipping address, the response will include the following structure:

FieldTypeDescription
successbooleanIndicates whether the request was successful.
dataobjectThe shipping address object containing detailed information.

Shipping Address Object Structure

The object in the data field 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.

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": "66b9b3b166169eecd60e5ba8"
}
}

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 shipping address 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.
  • Ensure the address_id in the URL is replaced with the actual ID of the shipping address you wish to retrieve.