Query: Get User

Retrieve user information for the logged in user.

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

Query: List Businesses

Retrieve the id and name fields of each business.

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.

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

Query: Get Customer

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 Errors for additional information about error cases.

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