API - Address

Created by KloudShip Support, Modified on Thu, 7 Mar, 2024 at 2:25 PM by KloudShip Support Admin

Get: Address

The Get Address Get API allows you to retrieve detailed address information based on the provided parameters. This information is useful for various shipping, communication, and location-related purposes. 

Endpoint

GET /{{BaseURL}}/Address/{address_id}

 

- {address_id}: The ID of the address for which you want to retrieve the info.

 

 

Parameters

 

- None

 

Response

 

Upon a successful request, the API returns address information in JSON format.

{
    "type": "ShipTo",
    "verificationStatus": "Success",
    "id": "649018e1703a221b756fb974",
    "name": "Mr Test",
    "company": "Test",
    "street1": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block Sector 62",
    "street2": "",
    "street3": "",
    "city": "Noida",
    "stateCode": "UP",
    "zip": "201309",
    "countryCode": "IN",
    "phone": "9999900000",
    "email": "manoj.kumar@impledge.com",
    "save": true,
    "verify": true,
    "isResidential": true,
    "latitude": 0.0,
    "longitude": 0.0,
    "streetAddress": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block Sector 62"
}
...

 

Response Fields

  1. `type` (string): Specifies the type of address, e.g., "ShipTo".
  2. `verificationStatus` (string): Indicates the verification status of the address, e.g., "Success".
  3. `id` (string): Unique identifier for the address.
  4. `name` (string): Name associated with the address.
  5. `company` (string): Company name associated with the address.
  6. `street1`, `street2`, `street3` (string): Address street lines.
  7. `city` (string): City of the address.
  8. `stateCode` (string): State code of the address.
  9. `zip` (string): Postal code of the address.
  10. `countryCode` (string): Country code of the address.
  11. `phone` (string): Phone number associated with the address.
  12. `email` (string): Email address associated with the address.
  13. `save` (boolean): Indicates if the address is marked for saving.
  14. `verify` (boolean): Indicates if the address needs verification.
  15. `isResidential` (boolean): Specifies if the address is a residential location.
  16. `latitude` (float): Latitude coordinate of the address.
  17. `longitude` (float): Longitude coordinate of the address.
  18. `streetAddress` (string): Consolidated street address.

 

Example Response

{
    "type": "ShipTo",
    "verificationStatus": "Success",
    "id": "649018e1703a221b756fb974",
    "name": "Mr Test",
    "company": "Test",
    "street1": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block Sector 62",
    "street2": "",
    "street3": "",
    "city": "Noida",
    "stateCode": "UP",
    "zip": "201309",
    "countryCode": "IN",
    "phone": "9999900000",
    "email": "manoj.kumar@impledge.com",
    "save": true,
    "verify": true,
    "isResidential": true,
    "latitude": 0.0,
    "longitude": 0.0,
    "streetAddress": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block Sector 62"
}
```


Additional Notes

  1. The latitude and longitude values are provided as float data types.
  2. The `save` and `verify` fields are boolean values indicating save and verification statuses, respectively.
  3. The `isResidential` field indicates whether the address is a residential location (boolean).
  4. Street lines are represented by `street1`, `street2`, and `street3` fields.
  5. The `streetAddress` field provides the consolidated street address.
  6. If the address needs verification, it is recommended to use the `verify` field to ensure accuracy before using the address for critical purposes.



Post: Address

The Post Address Create API allows you to create a new shipping address for a specific type of recipient. This API enables you to provide detailed information about the address, including recipient name, company, street details, city, state, postal code, country, contact phone, email, and various optional parameters. The address can also be verified, saved, and marked as residential. This documentation provides a comprehensive guide on how to use the API effectively.

Endpoint

 

```

POST /{{BaseURL}}/Address

```

Request Headers

  • Content-Type: application/json
  • Authorization: Bearer [Your_Auth_Token]

 

Request Body

 

The request body should be a JSON object containing the details of the address you want to create. Below is an example of a request body:

 

{
    "type": "ShipTo",
    "verificationStatus": "Success",
    "id": "64dc9341822cae68cb08eb03",
    "name": "Mr Test",
    "company": "Test",
    "street1": "Regus, 5th Floor, Tower C, Green Boulevard,B-Block Sector 62",
    "street2": "",
    "street3": "",
    "city": "Noida",
    "stateCode": "UP",
    "zip": "201309",
    "countryCode": "IN",
    "phone": "9999900000",
    "email": "manoj.kumar@impledge.com",
    "save": true,
    "verify": true,
    "isResidential": true,
    "latitude": 0.0,
    "longitude": 0.0,
    "streetAddress": "Regus, 5th Floor, Tower C, Green Boulevard,B-Block Sector 62"
}
```

 

Request Parameters

  1. type: Type of recipient (e.g., "ShipTo").
  2. verificationStatus**: Status of address verification (e.g., "Success").
  3. id: Unique identifier for the address.
  4. name: Name of the recipient.
  5. company: Name of the company associated with the recipient (optional).
  6. street1: First line of the street address.
  7. street2: Second line of the street address (optional).
  8. street3: Third line of the street address (optional).
  9. city: City of the recipient.
  10. stateCode: State code of the recipient's location.
  11. zip: Postal/ZIP code of the recipient's location.
  12. countryCode: Country code of the recipient's location (e.g., "IN" for India).
  13. phone: Contact phone number of the recipient.
  14. email: Contact email address of the recipient.
  15. save: Boolean indicating whether to save the address.
  16. verify: Boolean indicating whether the address is verified.
  17. isResidential: Boolean indicating if the address is residential.
  18. latitude: Latitude coordinate of the address (optional).
  19. longitude: Longitude coordinate of the address (optional).
  20. streetAddress: Concatenated street address (optional).

 

Response

Upon successful creation of the address, the API will return a response with a status code of `201 Created` and a JSON object containing information about the created address. In case of errors, appropriate error status codes and error messages will be returned.

 

Example Response

{
    "message": "Address created successfully.",
    "data": {
        "id": "64dc9341822cae68cb08eb03",
        "type": "ShipTo",
        "name": "Mr Test",
        "company": "Test",
        "street1": "Regus, 5th Floor, Tower C, Green Boulevard,B-Block Sector 62",
        "street2": "",
        "street3": "",
        "city": "Noida",
        "stateCode": "UP",
        "zip": "201309",
        "countryCode": "IN",
        "phone": "9999900000",
        "email": "manoj.kumar@impledge.com",
        "save": true,
        "verify": true,
        "isResidential": true,
        "latitude": 0.0,
        "longitude": 0.0,
        "streetAddress": "Regus, 5th Floor, Tower C, Green Boulevard,B-Block Sector 62"
    }
}
```



Put: Address

Updates the details of an address based on the provided address ID.

 

Endpoint 

PUT /{{BaseURL}}/Address/{address_Id}

Request Body

  1. type (string, required): The type of address. Possible values: `"ShipTo"`.
  2. verificationStatus** (string, required): The verification status of the address. Possible values: `"Success"`.
  3. id (string, required): The unique identifier of the address.
  4. name (string, required): The name associated with the address.
  5. company (string, required): The company associated with the address.
  6. street1 (string, required): The primary street address.
  7. street2 (string): Additional street address information (if any).
  8. street3 (string): Additional street address information (if any).
  9. city (string, required): The city of the address.
  10. stateCode (string, required): The state code of the address.
  11. zip (string, required): The ZIP code of the address.
  12. countryCode (string, required): The country code of the address.
  13. phone (string, required): The phone number associated with the address.
  14. email (string, required): The email address associated with the address.
  15. save (boolean, required): Indicates whether to save the address. Possible values: `true`.
  16. verify (boolean, required): Indicates whether the address should be verified. Possible values: `true`.
  17. isResidential (boolean, required): Indicates whether the address is a residential address. Possible values: `true`.
  18. latitude (float, required): The latitude coordinate of the address.
  19. longitude (float, required): The longitude coordinate of the address.
  20. streetAddress (string, required): The complete street address.

 

Example Request Body 

{
    "type": "ShipTo",
    "verificationStatus": "Success",
    "id": "64dcaee3822cae68cb08eb09",
    "name": "Mr Aayush",
    "company": "Test",
    "street1": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block Sector 62",
    "street2": "",
    "street3": "",
    "city": "Noida",
    "stateCode": "UP",
    "zip": "201309",
    "countryCode": "IN",
    "phone": "9999900000",
    "email": "manoj.kumar@impledge.com",
    "save": true,
    "verify": true,
    "isResidential": true,
    "latitude": 0.0,
    "longitude": 0.0,
    "streetAddress": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block Sector 62"
}
```


Response

  • type (string): The type of address.
  • verificationStatus (string): The verification status of the address.
  • id (string): The unique identifier of the address.
  • name (string): The name associated with the address.
  • company (string): The company associated with the address.
  • street1 (string): The primary street address.
  • street2 (string): Additional street address information (if any).
  • street3 (string): Additional street address information (if any).
  • city (string): The city of the address.
  • stateCode (string): The state code of the address.
  • zip (string): The ZIP code of the address.
  • countryCode (string): The country code of the address.
  • phone (string): The phone number associated with the address.
  • email (string): The email address associated with the address.
  • save (boolean): Indicates whether the address is saved.
  • verify (boolean): Indicates whether the address is verified.
  • isResidential (boolean): Indicates whether the address is a residential address.
  • latitude (float): The latitude coordinate of the address.
  • longitude (float): The longitude coordinate of the address.
  • streetAddress (string): The complete street address.

 

Example Response

{
    "type": "ShipTo",
    "verificationStatus": "Success",
    "id": "64dcaee3822cae68cb08eb09",
    "name": "Mr Aayush",
    "company": "Test",
    "street1": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block Sector 62",
    "street2": "",
    "street3": "",
    "city": "Noida",
    "stateCode": "UP",
    "zip": "201309",
    "countryCode": "IN",
    "phone": "9999900000",
    "email": "manoj.kumar@impledge.com",
    "save": true,
    "verify": true,
    "isResidential": true,
    "latitude": 0.0,
    "longitude": 0.0,
    "streetAddress": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block Sector 62"
}
```

 

Additional Note 

Replace `{{BaseURL}}` with the actual base URL of your API before using this documentation.



Delete: Address

The Delete Address API allows you to delete a specific address location using its unique `location_id`.

 

Endpoint

DELETE /{{BaseURL}}/Address/{address_ID}


Parameters

 

- `address_id` (path parameter) - The unique identifier of the address to be deleted.

 

Request

 

Endpoint

 

```
DELETE /{{BaseURL}}/Address/{address_id}
```

 

Example

Request

DELETE /Address/123456
```


Response

 

The response from the Delete Address API includes status codes 200 success status code, which signify the request was successful and the server has responded with the requested information. The response will contain either a "true" or "false" value.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article