customers
query
需要 read_customers 权限点。
接口访问需要令牌,具体如何获取令牌参考:身份认证。
客户列表
Example
客户列表
Code
query {
customers(first: 2, after:null,rawQuery:null,reverse:false,sortKey:CREATE_TIME) {
edges {
node {
id
locale
state
firstName
lastName
email
phone
createdAt
updatedAt
note
verifiedEmail
tags
amountSpent{
amount
currencyCode
}
numberOfOrders
lifetimeDuration
validEmailAddress
defaultAddress{
address1
address2
city
company
country
countryCodeV2
firstName
lastName
id
phone
province
provinceCode
zip
}
addresses {
address1
address2
city
company
country
countryCodeV2
firstName
lastName
id
phone
province
provinceCode
zip
}
emailMarketingConsent{
consentUpdatedAt
marketingState
}
smsMarketingConsent{
consentUpdatedAt
marketingState
}
}
}
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
}
}
Response
{
"data": {
"customers": {
"pageInfo": {
"endCursor": "E002CE0E792FBA4E98672D39851FDFD6",
"hasNextPage": true,
"hasPreviousPage": false,
"startCursor": "AF52536A1951B28A30AAE8825A2B69B9"
},
"edges": [
{
"node": {
"numberOfOrders": 3,
"createdAt": "2022-09-13T11:32:06.325Z",
"firstName": "S*****",
"verifiedEmail": false,
"defaultAddress": null,
"locale": null,
"tags": null,
"phone": "0086178****4249",
"addresses": [
{
"address1": "Chestnut Street 92",
"country": "United States",
"countryCodeV2": "US",
"firstName": "S*****",
"lastName": "T*****",
"province": "Kentucky",
"provinceCode": "4200021",
"address2": "Apartment 2",
"city": "Louisville",
"company": null,
"id": "gid://shopline/MailingAddress/SL201UA5582461214494581165",
"phone": "0086138****1234",
"zip": "40202"
}
],
"email": "*****@example.com",
"emailMarketingConsent": {
"consentUpdatedAt": "2022-09-13T11:32:06.599Z",
"marketingState": "SUBSCRIBED"
},
"id": "gid://shopline/Customer/4211385613",
"lastName": "T*****",
"lifetimeDuration": "2022-09-13 19:32",
"smsMarketingConsent": {
"marketingState": "SUBSCRIBED",
"consentUpdatedAt": "2022-09-13T11:32:06.640Z"
},
"amountSpent": {
"amount": "37530",
"currencyCode": "CLP"
},
"note": "Placed an order that had a fraud warning",
"state": "NOT_INVITED",
"updatedAt": "2022-09-14T06:33:58.912Z",
"validEmailAddress": true
}
}
]
}
}
}
这篇文章对你有帮助吗?