customer
query
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.
Return customer information by ID
Arguments
Returns a Customer resource by ID.
Return
Address information
Total cost amount
Can be deleted
Creation time
Default address
Full name
email
Mailbox subscription information
firstName
Customer id
Last name
The time when the customer joined the store, for example, one day, one week, one year
Language
Notes
Order qty
Phone number
Sms subscription status
Customer status
Tag
The customer's order can be marked as tax-free, true: tax-free, false: not tax-free
Customer's tax-free list
Update time
Email address verification does not guarantee the authenticity of the email address
Email verification or not
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
get customer details
Code
query {
customer(id: "gid://shopline/Customer/4600419107") {
locale
id
state
firstName
lastName
email
phone
createdAt
updatedAt
note
verifiedEmail
tags
lifetimeDuration
validEmailAddress
amountSpent{
amount
currencyCode
}
taxExempt
taxExemptions{
countryCode
provinceGCodeList
}
numberOfOrders
lifetimeDuration
validEmailAddress
defaultAddress {
address1
address2
city
company
country
countryCodeV2
firstName
lastName
id
phone
province
provinceCode
zip
district
town
}
addresses {
address1
address2
city
company
country
countryCodeV2
firstName
lastName
id
phone
province
provinceCode
zip
district
town
}
canDelete
}
}
Response
{
"data": {
"customer": {
"amountSpent": {
"amount": "0",
"currencyCode": "CLP"
},
"firstName": "S*****",
"lastName": "T*****",
"locale": null,
"phone": "0086138****1234",
"validEmailAddress": true,
"defaultAddress": {
"id": "gid://shopline/MailingAddress/SL201UA6266776363820652562",
"phone": "0086138****1234",
"town": "Street",
"countryCodeV2": "US",
"firstName": "S*****",
"lastName": "T*****",
"provinceCode": null,
"address2": "Apartment 2",
"city": "Louisville",
"country": "United States",
"district": "district",
"province": "Kentucky",
"zip": "40202",
"address1": "Chestnut Street 92",
"company": "C*****"
},
"email": "*****@example.com",
"id": "gid://shopline/Customer/4600419107",
"numberOfOrders": 0,
"tags": [
"test1"
],
"addresses": [
{
"address2": "Apartment 2",
"country": "United States",
"firstName": "S*****",
"id": "gid://shopline/MailingAddress/SL201UA6266776363820652562",
"provinceCode": null,
"company": "C*****",
"lastName": "T*****",
"province": "Kentucky",
"zip": "40202",
"address1": "Chestnut Street 92",
"countryCodeV2": "US",
"town": "Street",
"city": "Louisville",
"district": "district",
"phone": "0086138****1234"
}
],
"canDelete": true,
"lifetimeDuration": "14 days ago",
"state": "NOT_INVITED",
"taxExempt": true,
"taxExemptions": [
{
"countryCode": "US",
"provinceGCodeList": [
"AK",
"AL"
]
}
],
"updatedAt": "2023-12-29T13:38:08.470Z",
"createdAt": "2023-12-29T13:38:06.534Z",
"note": "Placed an order that had a fraud warning",
"verifiedEmail": true
}
}
}
Was this article helpful to you?