customerAddresses
نظرة عامة
اجلب عنوان العميل المحفوظ للحساب/الجلسة الحالية.
- النوع: GraphQL Query
- Endpoint: https://subdomain.com
- المصادقة:
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
}
}
}
أمثلة
- 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();
ملاحظات
- استبدل
<TOKEN>برمز صالح مرتبط بالحساب/الجلسة الحالية. - يمكنك توسيع الحقول المُعادة (مثل تفاصيل المدينة/الدولة الكاملة) وفقاً لاحتياجات واجهتك.