XPM

Unset Default Address

Path:

GET /user/{userId}/address/unset

After setting an address as default, users may want to change that default address at a later point in the future. This endpoint is used to remove the address as default.

A new default address can be set through the Set Default Address endpoint.

Headers

Content-Type : application/json

Consumes

  • application/json

Produces

  • application/json

Parameters

Type: Path

Name: System user ID (user._Id)

Required: true

Type: Body

Name: Address

Required: true

Sample Request

Path:

https://{baseurl}/user/5e97947d3cb8553c0e43d87f/address

Body:

{
"address1":"10400 NE 4th St ",
"city":"Bellevue",
"state":"WA",
"country": "United States",
"zipCode":"98004",
"kind":"Billing",
"name":{
"first":"John",
"last":"Doe"
},
"isVerified":true
‚Äč
}

Response

HTTP Code : 200 Message : OK

Description: The address is successfully removed from the default address setting. The complete user details are retrieved in response.

Sample

{
"_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": "johndoe@fabric.inc",
"extra": {
"resetPassword": "requested"
},
"registrationSite": "abcde.com",
"account": "5e97947d3cb8553c0e43d87e",
"userId": 90,
"address": [
{
"isDefault": false,
"isValidated": false,
"_id": "5e98a2a13e9e9e495ed2e3b3",
"address1": "10400 NE 4th St ",
"city": "Bellevue",
"state": "WA",
"country": "United States",
"zipCode": "98004",
"kind": "Billing",
"name": {
"first": "John",
"last": "Doe"
},
"address2": null,
"attention": null,
"company": null,
"email": null,
"phone": null,
"id": "5e98a2a13e9e9e495ed2e3b3"
}
],
"provider": [
{
"registrationDate": "2020-04-15T22:34:22.429Z",
"isActive": true,
"_id": "5e97947d3cb8553c0e43d881",
"name": "LOCAL",
"lastLoginDate": "2020-04-16T22:44:59.116Z",
"id": "5e97947d3cb8553c0e43d881"
}
],
"createdAt": "2020-04-15T23:10:53.773Z",
"updatedAt": "2020-04-16T23:02:39.342Z",
"__v": 0

HTTP Code : 404 Message : Not Found

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

Sample

{
"code": "SET_DEFAULT_FAILED",
"message": "Address not found."
}

Changelog

  • Last updated - July 2020