Request Structure
Every request is a POST to the GraphQL endpoint.
POST https://sandbox.expressoft.eu/connect/api/interopgql
Authorization: Bearer <token>
Content-Type: application/json{
"query": "<query or mutation>",
"variables": {}
}variables carries the arguments of the operation.
Entry points
The queries start at customers, loyalty, order and organization. The mutations start at customer and organization.
Entry point | Used for |
|---|---|
customers.customer | Customers, with their loyalty data |
order.orders | Orders and receipts, with the points of each receipt |
loyalty.promotion | Promotions |
organization | Reference data: currencies, VAT categories, organizations, marketing actions |
customer.* (mutation) | Create, update and delete customers and their addresses |
organization.createGiftCard (mutation) | Create a gift card |
Lists and paging
Lists that return a connection use cursors. They accept first, after, last and before, and return totalCount, pageInfo and items.
customers {
customer(first: 30, after: $after) {
totalCount
pageInfo {
hasNextPage
endCursor
}
items {
publicKey
}
}
}To read the next page, send the endCursor of the previous page as after. Stop when hasNextPage is false.
orderBy takes a sort value. For customers: FIRST_NAME, FIRST_NAME_DESC, LAST_NAME, LAST_NAME_DESC.
Mutation results
Every mutation returns the same wrapper:
result { publicKey }
errorCode
errorMessage
errorDataerrorCode is null when the operation succeeds. See Errors & Troubleshooting.
Common mistakes
Mistake | What happens |
|---|---|
GET request on the endpoint | 404 |
No Authorization header | 401 |
Basic authentication instead of Bearer | 401 |
Unknown field or wrong type in the query | HTTP 200 with an errors array at the top level |
orders without order keys or a period | The request is rejected. See Points Balance & Transactions. |