Manage addresses for a consumer profile
You can manage the addresses on a consumer profile using the following operations:
- Add an address to an existing consumer profile
- Update an address
- Delete an address
Add an address to an existing consumer profile
You can add a new address to an existing customer profile by sending a POST request to the /consumer-profiles/{consumer-profile-id}/addresses endpoint. The response includes the system-generated addressIdentifier field which is used to make subsequent updates to the new address.
HTTP method: POST
Endpoint: /consumer-profiles/PACJGQ/addresses
Scenario: Adding a new address to a consumer profile with consumer-profile-id = PACJGQ
{
"firstName": "John",
"lastName": "Doe",
"consumerAssignedAddressName": "Work2",
"primaryAddressIndicator": true,
"addressType": "SHIPPING",
"line1": "200 Elton Farm",
"line2": "Apt 123",
"city": "Glen Mills",
"state": "PA",
"postalCode": "19342",
"countryCode": "USA",
"addressStatus": "ACTIVE"
}
Response:
{
"consumerProfileId": "PACJGQ",
"cardOnFileReferenceNumber": "",
"firstName": "John",
"lastName": "Doe",
"communication": {
"phoneList": [
{
"phoneNumber": "8888888828",
"countryCode": "1",
"phoneNumberType": "Home",
"communicationIdentifier": "HH04423498968"
}
],
"emailList": [
{
"emailAddress": "john.doe.x@gmail.com",
"emailAddressType": "Home",
"communicationIdentifier": "EE8141240230923"
}
]
},
"paymentMethodType": {
"cardList": [
{
"paymentMethodId": "77ccba29-4857-494a-82bc-2a80e1fa2b9d",
"cardExpirationMonthYearNumber": "01/2025",
"last4CardNumber": "9999",
"cardType": "MC",
"firstName": "John",
"lastName": "Doe",
"addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0"
}
]
},
"addresses": [
{
"addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0",
"firstName": "John",
"lastName": "Doe",
"consumerAssignedAddressName": "Work",
"primaryAddressIndicator": true,
"addressType": "SHIPPING",
"line1": "100 Elton Farm",
"line2": "Apt 123",
"city": "Glen Mills",
"state": "PA",
"postalCode": "19342",
"countryCode": "USA",
"addressStatus": "ACTIVE"
},
{
"addressIdentifier": "e17a1ecd-b177-4c3d-a99b-c72e132b260f",
"firstName": "John",
"lastName": "Doe",
"consumerAssignedAddressName": "Work2",
"primaryAddressIndicator": true,
"addressType": "SHIPPING",
"line1": "200 Elton Farm",
"line2": "Apt 123",
"city": "Glen Mills",
"state": "PA",
"postalCode": "19342",
"countryCode": "USA",
"addressStatus": "ACTIVE"
}
],
"correlationIdentifier": "04ee743b-b33e-4867-a94b-b92003fce9ce",
"createTimestamp": "2021-08-23T00:23:05.353Z",
"createUserIdentifier": "jack",
"updateTimestamp": "2024-07-02T10:07:04.400Z",
"updateUserIdentifier": "jack",
"profileStatus": "ACTIVE"
}
Update an address
You can modify an existing address on a customer profile by sending a PATCH request to the using the /consumer-profiles/{consumer-profile-id}/addresses/{address-id} endpoint.
HTTP method: PATCH
Endpoint: /consumer-profiles/PACJGQ/addresses/4a599d25-00b9-4a19-af8d-fdae45e034c9
Scenario: Updating the address with address-id = 4a599d25-00b9-4a19-af8d-fdae45e034c9 on the consumer profile with consumer-profile-id = PACJGQ
{
"firstName": "John",
"lastName": "Doe",
"consumerAssignedAddressName": "Work2",
"primaryAddressIndicator": true,
"line1": "201 Elton Farm",
"line2": "Apt 123",
"city": "Glen Mills",
"state": "PA",
"postalCode": "19342",
"countryCode": "USA",
"addressStatus": "ACTIVE"
}
Response:
{
"consumerProfileId": "PACJGQ",
"cardOnFileReferenceNumber": "123",
"firstName": "John",
"lastName": "Doe",
"communication": {
"phoneList": [
{
"phoneNumber": "8888888828",
"countryCode": "1",
"phoneNumberType": "Home",
"communicationIdentifier": "HH04423498968"
}
],
"emailList": [
{
"emailAddress": "john.doe.x@gmail.com",
"emailAddressType": "Home",
"communicationIdentifier": "EE8141240230923"
}
]
},
"paymentMethodType": {
"cardList": [
{
"paymentMethodId": "77ccba29-4857-494a-82bc-2a80e1fa2b9d",
"cardExpirationMonthYearNumber": "01/2025",
"last4CardNumber": "9999",
"accountStatus": "ACTIVE",
"cardType": "MC",
"firstName": "John",
"lastName": "Doe",
"addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0"
}
]
},
"addresses": [
{
"addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0",
"firstName": "John",
"lastName": "Doe",
"consumerAssignedAddressName": "Work",
"primaryAddressIndicator": true,
"addressType": "SHIPPING",
"line1": "100 Elton Farm",
"line2": "Apt 123",
"city": "Glen Mills",
"state": "PA",
"postalCode": "19342",
"countryCode": "USA",
"addressStatus": "ACTIVE"
},
{
"addressIdentifier": "e17a1ecd-b177-4c3d-a99b-c72e132b260f",
"firstName": "John",
"lastName": "Doe",
"consumerAssignedAddressName": "Work2",
"primaryAddressIndicator": true,
"addressType": "SHIPPING",
"line1": "201 Elton Farm",
"line2": "Apt 123",
"city": "Glen Mills",
"state": "PA",
"postalCode": "19342",
"countryCode": "USA",
"addressStatus": "ACTIVE"
}
],
"correlationIdentifier": "94083a23-cff7-47bd-8223-04a0df6c9421",
"createTimestamp": "2021-08-23T00:23:05.353Z",
"createUserIdentifier": "jack",
"updateTimestamp": "2024-07-02T11:19:47.202Z",
"updateUserIdentifier": "jack",
"profileStatus": "ACTIVE"
}
Delete an address
You can delete an existing address from a customer profile by sending a DELETE request using the /consumer-profiles/{consumer-profile-id}/addresses/{address-id} endpoint.
HTTP method: DELETE
Endpoint: /consumer-profiles/PACJGQ/addresses/e17a1ecd-b177-4c3d-a99b-c72e132b260f
Scenario: Deleting the address with address-id = e17a1ecd-b177-4c3d-a99b-c72e132b260f from the consumer profile with consumer-profile-id = PACJGQ
{
"consumerProfileId": "PACJGQ",
"cardOnFileReferenceNumber": "123",
"firstName": "John",
"lastName": "Doe",
"communication": {
"phoneList": [
{
"phoneNumber": "8888888828",
"countryCode": "1",
"phoneNumberType": "Home",
"communicationIdentifier": "HH04423498968"
}
],
"emailList": [
{
"emailAddress": "john.doe.x@gmail.com",
"emailAddressType": "Home",
"communicationIdentifier": "EE8141240230923"
}
]
},
"paymentMethodType": {
"cardList": [
{
"paymentMethodId": "77ccba29-4857-494a-82bc-2a80e1fa2b9d",
"cardExpirationMonthYearNumber": "01/2025",
"last4CardNumber": "9999",
"accountStatus": "ACTIVE",
"cardType": "MC",
"firstName": "John",
"lastName": "Doe",
"addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0"
}
]
},
"addresses": [
{
"addressIdentifier": "8d452494-ec75-4ef9-9b45-e4bd7debf6a0",
"firstName": "John",
"lastName": "Doe",
"consumerAssignedAddressName": "Work",
"primaryAddressIndicator": true,
"addressType": "SHIPPING",
"line1": "100 Elton Farm",
"line2": "Apt 123",
"city": "Glen Mills",
"state": "PA",
"postalCode": "19342",
"countryCode": "USA",
"addressStatus": "ACTIVE"
}
],
"correlationIdentifier": "94083a23-cff7-47bd-8223-04a0df6c9421",
"createTimestamp": "2021-08-23T00:23:05.353Z",
"createUserIdentifier": "jack",
"updateTimestamp": "2024-07-02T11:23:33.463Z",
"updateUserIdentifier": "jack",
"profileStatus": "ACTIVE"
}