Query: Get User

Retrieve user information for the logged in user.

Operation
query {
  user {
    id
    firstName
    lastName
    defaultEmail
    createdAt
    modifiedAt
  }  
}

Query: List Businesses

Retrieve the id and name fields of each business.

Operation
query {
  businesses {
    edges {
      node {
        id
        name
      }
    }
  }
}

Query: List Customers

For a specific business, retrieve the first 50 customers. Fetches each customer's id, name, and email.

See Pagination for an explanation of page and pageSize.

Operation
query {
  business(id: "<BUSINESS_ID>") {
    id
    name
    customers(page: 1, pageSize: 50) {
      edges {
        node {
          id
          name
          email
        }
      }
    }
  }
}

Query: Get Customer

Operation
query {
  business(id: "<BUSINESS_ID>") {
    customer(id: "<CUSTOMER_ID>") {
      id
      name
      firstName
      lastName
      email
      mobile
      phone
      fax
      tollFree
      website
      address {
        addressLine1
        addressLine2
        city
        province {
          name
        }
        country {
          name
        }
        postalCode
      }
      shippingDetails {
        name
        phone
        instructions
        address {
          addressLine1
          addressLine2
          city
          province {
            name
          }
          country {
            name
          }
          postalCode
        }
      }
      currency {
        code
      }
      createdAt
      modifiedAt
    }
  }
}

Mutation: Create Customer

Create a customer under a business. Includes optional data firstName, lastName, email, and currency.

See Variables for how to pass in String data as arguments.

See Errors for additional information about error cases.

Operation
mutation ($input: CustomerCreateInput!) {
  customerCreate(input: $input) {
    didSucceed
    inputErrors {
      code
      message
      path
    }
    customer {
      id
      name
      firstName
      lastName
      email
      currency {
        code
      }
    }
  }
}
Operation Variables
{
  "input": {
    "businessId": "<BUSINESS_ID>",
    "name": "Smith Consulting",
    "firstName": "Jane",
    "lastName": "Smith",
    "email": "jsmith@example.com",
    "currency": "CAD"
  }
}
Updated: