# Add Address v2.0Beta
The Add Address endpoint adds an address to an existing customer profile. Values supplied will be validated against a set of basic validation rules and applied to the customer profile. The new address will reflect immediately on the customer profile.
# Request
POST /v2.0/customers/{profileKey}/addresses
# Authorization
An OAuth 2.0 Bearer token with the Profile.Write
scope is required. For more information, see Authentication.
# Path Parameters
A list of the supported path parameters is described below.
Name | Required | Type | Description |
---|---|---|---|
profileKey | true | guid | The profile key for the customer. This value can be retrieved from the profileKey claim in the token returned from our SSO solution. |
# Request Body
The request body takes an AddAddress object which is described below.
# AddAddress
Name | Required | Type | Description |
---|---|---|---|
addressType | true | string(50) | The type of address. Must either be a valid value from the address types lookup or unspecified if the customer does not wish to specify their gender. |
addressName | true | string(50) | The customer provided name for the address. |
addressLine1 | true | string(500) | The first line of the address. |
addressLine2 | false | string(500) | The second line of the address. |
suburb | true | string(100) | The suburb for the address. |
city | true | string(100) | The city for the address. |
province | true | string(100) | The province or state for the address. |
postalCode | true | string(10) | The postal code for the address. |
countryCode | true | string(2) | The ISO 3166-1 Alpha-2 country code for the address. |
latitude | false | double | The latitude of the address. |
longitude | false | double | The longitude of the address. |
# Sample
{
"addressType": "Delivery",
"addressName": "Home",
"addressLine1": "13 Burger Avenue",
"addressLine2": "",
"suburb": "Century City",
"city": "Cape Town",
"postalCode": "7441",
"province": "Western Cape",
"countryCode": "ZA",
"latitude": 123.456789,
"longitude": -87.137878
}
# Response
200
OK
Returns an ApiResponse envelope.
# Response Body
The endpoint returns our ApiResponse envelope.
# Sample
{
"message": "The operation succeeded!",
"notifications": [
{
"severity": "Success",
"text": "The address was added.",
"code": null,
"additionalData": null
}
]
}
# Errors
The standard error responses apply.
400
Bad Request
When the request fails validation.
401
Unauthorized
When authentication fails.
403
Forbidden
When authorisation fails.
404
Not Found
When the customer profile cannot be found.