XM

Delete Address

Path:

DEL https://{baseurl}/api-commerceIdentity/user/{{userId}}/address/{{addressId}}

The flexibility to add multiple addresses also adds to the complexity of managing them. This API makes it easier for users to remove unused addresses and retain only the required ones.

Headers

Content-Type : application/json

x-site-context : { "date": "2020-08-28T02:35:27.787Z", "channel": 12, "account": 5f493c9f30ec2a0007a94fc8", "stage": "sandbox" }

Parameters

Type : Path

Name : The system-generated user ID and address ID.

Required : true

Type : requestBody

Name : The customer address to be deleted.

Required : true

Sample Request

Path:

DELETA https://{baseurl}/api-commerceIdentity/user/{{userId}}/address/{{addressId}}

Sample Response

HTTP Code : 200 Message : OK

Description: You will see this message when the address is successfully removed. In response, the entire user details are retrieved to rebuild the user profile.

{
"_id": "5e97947d3cb8553c0e43d87f",
"isActive": {
"status": true
},
"registrationDate": "2020-04-15T22:34:22.429Z",
"expiryDate": "2070-04-15T22:34:22.429Z",
"roles": [
"5de1646f8c6352091d944f1c"
],
"name": {
"first": "John",
"middle": "A",
"last": "Doe"
},
"phone": [
{
"_id": "5e97947d3cb8553c0e43d880",
"number": "123456789",
"countryCode": "+1",
"extension": "1234",
"kind": "mobile",
"id": "5e97947d3cb8553c0e43d880"
}
],
"email": "[email protected]",
"extra": {
"resetPassword": "requested"
},
"registrationSite": "abcde.com",
"account": "5e97947d3cb8553c0e43d87e",
"userId": 90,
"address": [],
"provider": [
{
"registrationDate": "2020-04-15T22:34:22.429Z",
"isActive": true,
"_id": "5e97947d3cb8553c0e43d881",
"name": "LOCAL",
"lastLoginDate": "2020-04-17T20:53:59.803Z",
"id": "5e97947d3cb8553c0e43d881"
}
],
"createdAt": "2020-04-15T23:10:53.773Z",
"updatedAt": "2020-04-17T20:54:10.178Z",
"__v": 0
}

HTTP Code : 404 Message : Not Found

Description: You will see this message when the system user ID is incorrect.

Sample

{
"code": "USER_NOT_FOUND",
"message": "User not found."
}

Changelog

  • Last updated - July 2020