customerAddress
Overview
Fetch a specific customer address by its unique ID.
- Type: GraphQL Query
- Endpoint: https://subdomain.com
- Authentication:
Authorization: Bearer <TOKEN>
Query
query FindCustomerAddressById($addressId: ID!) {
findCustomerAddressById(addressId: $addressId) {
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
}
}
}
Variables
{
"addressId": "<ADDRESS_ID>"
}
Examples
- cURL
- JavaScript (fetch)
curl -X POST \
https://subdomain.com \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <TOKEN>" \
--data-binary @- << 'EOF'
{
"query": "query FindCustomerAddressById($addressId: ID!) { findCustomerAddressById(addressId: $addressId) { success message data { _id neighborhood street zipCode } } }",
"variables": { "addressId": "<ADDRESS_ID>" }
}
EOF
const res = await fetch('https://subdomain.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Bearer ' + token,
},
body: JSON.stringify({
query: `
query FindCustomerAddressById($addressId: ID!) {
findCustomerAddressById(addressId: $addressId) {
success
message
data { _id neighborhood street zipCode }
}
}
`,
variables: { addressId: '<ADDRESS_ID>' },
}),
});
const json = await res.json();
Notes
- Replace
<TOKEN>and<ADDRESS_ID>with valid values. - You can expand the selected fields (e.g., include full city/country data) based on your UI needs.