XM

Set Default Address

Path:

GET /user/{userId}/address/{addressId}/set

We enable users to set a default address for shipping and billing, so that they don't have to separately select them each time they shop.

Headers

Content-Type : application/json

Consumes

  • application/json

Produces

  • application/json

Parameters

Type: Path

Name: System user ID and addres 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: You will see this message when an address is set as default.

Sample

[
{
"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"
}
]

HTTP Code : 404 Message : Not Found

Description: You will see this message when the address could not be set as a default address

Sample

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

Changelog

  • Last updated - July 2020