Requires read_customers access scope.
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Customer list
Arguments
after ● String
Returns elements following the specified cursor. The first argument must also be specified when using this argument.
before ● String
Returns elements preceding the specified cursor. The last argument must also be specified when using this argument.
first ● Int
Returns the first n elements in the list.
last ● Int
Returns the last n elements in the list.
reverse ● Boolean
Whether to reverse the order of the list.
● true: reverse
● false: do not reverse
Default value: false
sortKey ● CustomerSortKeys
Sort rules
More
rawQuery ● String
Crowd screening conditions , json string
Return
edges ● [CustomerEdge!]non-null
edges list
More
nodes ● [Customer]
node list
More
pageInfo ● PageInfo!non-null
Information to aid in pagination.
More
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Customers
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": {
"edges": [
{
"node": {
"defaultAddress": null,
"email": "*****@example.com",
"tags": null,
"emailMarketingConsent": {
"consentUpdatedAt": "2022-09-13T11:32:06.599Z",
"marketingState": "SUBSCRIBED"
},
"id": "gid://shopline/Customer/4211385613",
"numberOfOrders": 3,
"lastName": "T*****",
"lifetimeDuration": "2022-09-13 19:32",
"locale": null,
"phone": "0086178****4249",
"updatedAt": "2022-09-14T06:33:58.912Z",
"verifiedEmail": false,
"amountSpent": {
"amount": "37530",
"currencyCode": "CLP"
},
"createdAt": "2022-09-13T11:32:06.325Z",
"firstName": "S*****",
"note": "Placed an order that had a fraud warning",
"smsMarketingConsent": {
"consentUpdatedAt": "2022-09-13T11:32:06.640Z",
"marketingState": "SUBSCRIBED"
},
"state": "NOT_INVITED",
"validEmailAddress": true,
"addresses": [
{
"countryCodeV2": "US",
"id": "gid://shopline/MailingAddress/SL201UA5582461214494581165",
"phone": "0086138****1234",
"address2": "Apartment 2",
"city": "Louisville",
"company": null,
"firstName": "S*****",
"lastName": "T*****",
"province": "Kentucky",
"provinceCode": "4200021",
"zip": "40202",
"address1": "Chestnut Street 92",
"country": "United States"
}
]
}
}
],
"pageInfo": {
"endCursor": "E002CE0E792FBA4E98672D39851FDFD6",
"hasNextPage": true,
"hasPreviousPage": false,
"startCursor": "AF52536A1951B28A30AAE8825A2B69B9"
}
}
}
}
Was this article helpful to you?