Customers

Create a Customer

mutation {
  createCustomer(
    email: "[email protected]"
    firstName: "John"
    lastName: "Doe"
    country: "VHlwZXM6OkNvdW50cnktNjNjNTQyZDUtOTRhZC00NWIyLWE0YzQtOWI5ZGExOTU5ZjA1"
  ) {
    id
    email
    firstName
    lastName
  }
}
Argument
Type
Required
Description

email

String!

Yes

Customer’s email (must be unique per account).

firstName

String!

Yes

First name.

lastName

String!

Yes

Last name.

country

ID!

Yes

Global ID of a country from availableCountries.

The mutation returns the new customer’s global id, which you’ll reference in future calls (e.g., adding a payment method).


List Customers

query {
  account {
    merchantCustomers {
      nodes {
        id
        email
        firstName
        lastName
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}

merchantCustomers is a Relay-style connection. To fetch the next page, pass after: <endCursor>:

query {
  account {
    merchantCustomers(after: "Mg") {
      nodes {
        id
        email
        firstName
        lastName
      }
      pageInfo {
        endCursor
        hasNextPage
      }
    }
  }
}

Last updated