Customers
Query
customer — Returns Customer
Scopes Required: see_customers
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the customer to retrieve |
Example Query
query GetCustomer($id: ID!) {
customer(id: $id) {
id,
name,
parent,
deleted,
clientId
}
}
# Example variables
{
"id": "<ID>"
}Query
customerPayment — Returns CustomerPayment
Scopes Required: see_customers
| Arguments | Type | Description |
|---|---|---|
|
id |
The ID of the customer payment to retrieve |
Example Query
query GetCustomerPayment($id: ID!) {
customerPayment(id: $id) {
id,
reference,
status,
startBalance,
amount
}
}
# Example variables
{
"id": "<ID>"
}Query
customerPayments — Returns ConnectionType of CustomerPayment
Scopes Required: see_customers
Sortable Fields
Fields from CustomerPayment that can be used to sort the connection items
- timestamp
- amount
| Arguments | Type | Description |
|---|---|---|
|
customer |
The customer to retrieve the payments for, if not specified payments for all customers will be returned |
|
|
status |
The status of payments to retrieve |
Example Query
query GetCustomerPayments($customer: ID) {
customerPayments(customer: $customer) {
edges {
node {
id,
reference,
status,
startBalance,
amount
}
},
pageInfo {
hasNextPage,
endCursor
}
}
}
# Example variables
{
"customer": "<CUSTOMER>"
}Query
customers — Returns ConnectionType of Customer
Scopes Required: see_customers
Sortable Fields
Fields from Customer that can be used to sort the connection items
- firstName
- lastName
- company
| Arguments | Type | Description |
|---|---|---|
|
codes |
[String!] |
Return the customers which have these customer codes |
|
hasLoyaltyPoints |
Boolean |
Whether the customers has loyalty points or not, if unset loyalty points will be ignored |
|
hasAccountBalance |
Boolean |
Whether the customers has account balances or not, if unset account balance will be ignored |
|
customerGroup |
Filters the customers by their customer group, null will select customers without customer groups, if unset customer groups will be ignored |
|
|
createdBefore |
Filters users that have been created before or on the provided date time |
|
|
createdAfter |
Filters users that have been created after or on the provided date time |
|
|
lastSaleBefore |
Get the customers that have had a sale before this date (inclusive) |
|
|
lastSaleAfter |
Get the customers that have had a sale after this date (inclusive) |
|
|
name |
String |
Filters customers by their name |
|
|
Filters customers to return those which contain this email address |
|
|
phone |
String |
Filters customers to return those which contain this phone number |
Example Query
query GetCustomers($codes: [String!]) {
customers(codes: $codes) {
edges {
node {
id,
name,
parent,
deleted,
clientId
}
},
pageInfo {
hasNextPage,
endCursor
}
}
}
# Example variables
{
"codes": [
"<CODES>"
]
}