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
| Header | Type | Description |
|---|---|---|
accessToken | string | Access token for authentication. (required) |
Path Parameters
| Parameter | Type | Description |
|---|---|---|
address_id | string | The 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 Code | Description |
|---|---|
| 200 OK | The 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:
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates whether the request was successful. |
data | object | The shipping address object containing detailed information. |
Shipping Address Object Structure
The object in the data field 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. |
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 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 shipping address 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.
- Ensure the
address_idin the URL is replaced with the actual ID of the shipping address you wish to retrieve.