Customerscustomers
HelpStatusOpen portal

Customers

A customer is a person who has applied or bought through one of your checkouts. You get contact and address details to match them to your own records.

customersQuery

Your customers with contact and address details. Search by name or email, filter to exact emails or ids, and paginate.

By default, customers are sorted by their most recent order with you, newest first. Ties are ordered by customer ID, newest first. Customers with no order with you come last. Use customerIds for a batch lookup from your own ids, and email for an exact match when you already know the address.

POST/graphql

customers(input: CustomersInput): CustomerConnection!

Arguments

NameTypeDescription
input.firstIntPage size, 1–100. Defaults to 25.
input.afterStringThe endCursor from the previous page. Omit it for the first page.
input.searchStringMatches name or email, case-insensitive.
input.emailStringAn exact email match.
input.customerIds[ID!]Only these customers.
input.sortByCustomerSortFieldSort field. Defaults to LAST_ORDER_DATE. By default, customers are sorted by their most recent order with you, newest first. Ties are ordered by customer ID, newest first. Customers with no order with you come last.
input.sortDescBooleanSort descending. Defaults to true (newest first) for LAST_ORDER_DATE and ID, and false (A to Z) for LAST_NAME and EMAIL. Ties are ordered by customer ID, in the same direction.

Returns

FieldTypeDescription
totalCountInt!How many customers match your filter, across every page.
pageInfoPageInfo!hasNextPage tells you whether to keep going; endCursor is what you pass as after.
edges[].nodeCustomerOne Customer per edge, with its cursor beside it. The Customer fields follow.

Each Customer node

FieldTypeDescription
idID!The customer id. Pass it to customer.
firstNameString!Given name.
lastNameString!Family name.
emailString!Email address.
phoneNumberStringPhone in E.164 format. Null when missing.
addressAddressMailing address. Null when every address field is empty or only the country is set. Fields below.

Example

query Customers($input: CustomersInput) {
  customers(input: $input) {
    totalCount
    edges { node { id firstName lastName email phoneNumber address { city state zip } } }
  }
}
Variables
{
  "input": {
    "first": 3,
    "search": "example"
  }
}
Response
{
  "data": {
    "customers": {
      "totalCount": 1,
      "edges": [
        {
          "node": {
            "id": "9001",
            "firstName": "John",
            "lastName": "Example",
            "email": "[email protected]",
            "phoneNumber": "+15125550142",
            "address": {
              "city": "Austin",
              "state": "TX",
              "zip": "78701"
            }
          }
        }
      ]
    }
  }
}

customerQuery

Fetch one customer by id, with contact and address details. Null when the id isn’t found on your account.

Take the id from customers, an order or a risk row (customerId), or a webhook log.

POST/graphql

customer(id: ID!): Customer

Arguments

NameTypeDescription
idID!requiredThe customer id.

Returns

FieldTypeDescription
idID!The customer id.
firstNameString!Given name.
lastNameString!Family name.
emailString!Email address.
phoneNumberStringPhone in E.164 format. Null when missing.
addressAddressMailing address. Null when every address field is empty or only the country is set.

Example

query Customer($id: ID!) {
  customer(id: $id) {
    id firstName lastName email phoneNumber
    address { addressLine1 addressLine2 city state zip country }
  }
}
Variables
{
  "id": "9001"
}
Response
{
  "data": {
    "customer": {
      "id": "9001",
      "firstName": "John",
      "lastName": "Example",
      "email": "[email protected]",
      "phoneNumber": "+15125550142",
      "address": {
        "addressLine1": "100 Congress Ave",
        "addressLine2": null,
        "city": "Austin",
        "state": "TX",
        "zip": "78701",
        "country": "US"
      }
    }
  }
}

Types

AddressObject

The address object on a customer.

NameTypeDescription
addressLine1String!Street address.
addressLine2StringUnit or suite.
addressLine3StringA third line, rarely used.
cityString!City.
stateString!State or region.
zipString!Postal code.
countryStringCountry, when given.

CustomerSortFieldEnum

ValueMeaning
LAST_ORDER_DATEThe customer's most recent order with you (the default). Customers with no order with you come last.
LAST_NAMEFamily name.
EMAILEmail address.
IDThe customer id.