on 2018 Dec 10 4:41 PM
Hello All ,
I am trying to use the OOTB web service for getting the customer addresses
https://localhost:9002/rest/v2/powertools/users/01110005978/addresses?fields=DEFAULT
GET /{baseSiteId}/users/{userId}/addresses
But it returns an empty list of addresses although those customers has many addresses.
Any idea what to do ?
Request clarification before answering.
As you have mentioned, I am assuming that the customer (e.g. anil.gupta@rustic-hw.com) has at least one address. I have added an address to this user for demo purpose.
Go to backoffice > Addresses > Select the customer address (e.g. anil.gupta@rustic-hw.com) > Change is shipping address to true under ADDRESS TYPES on the GENERAL tab > SAVE

Now, you can send the following GET request using a REST client (e.g. Postman)
https://localhost:8002/rest/v2/powertools/users/anil.gupta@rustic-hw.com/addresses
And you will get a response like:
{
"addresses": [
{
"country": {
"isocode": "GB"
},
"defaultAddress": true,
"firstName": "Anil",
"id": "8796125822999",
"lastName": "Gupta",
"line1": "Wigmore House",
"line2": "Wigmore Lane",
"postalCode": "LU2 9TN",
"town": "Luton"
}
]
}
Note: Please make sure to use the Access Token created for the user, anil.gupta@rustic-hw.com; otherwise, you get the error, Access is denied.
Please let me know if you face any further issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To get the cusomer address. Go and add the address to customer first. Then use below url
here it is pk of the address id. 8796125822999
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.