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
id ● ID!non-null
Returns a Customer resource by ID.
Return
addresses ● [MailingAddress]
Address information
More
amountSpent ● MoneyV2
Total cost amount
More
canDelete ● Boolean
Can be deleted
createdAt ● Date
Creation time
defaultAddress ● MailingAddress
Default address
More
displayName ● String
Full name
email ● String
email
emailMarketingConsent ● CustomerEmailMarketingConsentState
Mailbox subscription information
More
firstName ● String
firstName
id ● ID
Customer id
lastName ● String
Last name
lifetimeDuration ● String
The time when the customer joined the store, for example, one day, one week, one year
locale ● String
Language
note ● String
Notes
numberOfOrders ● Int
Order qty
phone ● String
Phone number
smsMarketingConsent ● CustomerSmsMarketingConsentState
Sms subscription status
More
state ● CustomerState
Customer status
More
tags ● [String]
Tag
taxExempt ● Boolean
The customer's order can be marked as tax-free, true: tax-free, false: not tax-free
taxExemptions ● [FreeAreas]
Customer's tax-free list
More
updatedAt ● Date
Update time
validEmailAddress ● Boolean
Email address verification does not guarantee the authenticity of the email address
verifiedEmail ● Boolean
Email verification or not
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
get customer details
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?