customerAddresses
Overview
Fetch the customer's saved address for the current account/session.
- Type: GraphQL Query
- Endpoint: https://subdomain.com
- Authentication:
Authorization: Bearer <TOKEN>
Query
query FindCustomerAddressByAccount {
findCustomerAddressByAccount {
success
message
data {
_id
country {
_id
name
image {
image
imageUrl
}
code
continent
capital
active
deleted
phonekey
createdAt
updatedAt
}
city {
_id
name
description
active
deleted
country {
_id
name
image {
image
imageUrl
}
code
continent
capital
active
deleted
phonekey
createdAt
updatedAt
}
}
neighborhood
street
zipCode
description
account
device
deleted
}
}
}
Examples
- cURL
- JavaScript (fetch)
curl -X POST \
https://subdomain.com \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
--data-binary @- << 'EOF'
{
"query": "query FindCustomerAddressByAccount { findCustomerAddressByAccount { success message data { _id neighborhood street zipCode } } }"
}
EOF
const res = await fetch('https://subdomain.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + token,
},
body: JSON.stringify({
query: `
query FindCustomerAddressByAccount {
findCustomerAddressByAccount {
success
message
data { _id neighborhood street zipCode }
}
}
`,
}),
});
const json = await res.json();
Notes
- Replace
<TOKEN>with a valid token tied to the current account/session. - You can expand the returned fields (e.g., full city/country details) according to your UI needs.