Errors & Troubleshooting
Where an operation can fail
- The token request. A 400 response with InvalidCredentials or unknown applicationId.
- The authorization. An error with extensions.code VALIDATION_ERROR when the token is missing or invalid, or when your user lacks the Accounting permission.
- The query. An errors array at the top level when the query is invalid. The HTTP status is still 200.
- The mutation result. errorCode, errorMessage and errorData when purchaseInvoiceCreate fails a rule.
Authorization errors
{
"errors": [
{
"message": "You are not authorized to run this query.\nRequired claim 'ConnectAccounting' is not present.",
"extensions": {
"code": "VALIDATION_ERROR"
}
}
]
}The message names the permission that is missing. Ask Expressoft to add ConnectAccounting to your user.
Error codes of purchaseInvoiceCreate
The codes start at 0. See Purchase Invoices for the likely cause of each one.
errorCode | Name |
|---|---|
0 | DocumentTypeNotSupported |
1 | InvalidOrganization |
2 | InvalidWarehouse |
3 | InvalidCompany |
4 | InvalidProduct |
5 | InvalidCurrency |
6 | InvalidVATRate |
7 | EmptyDocument |
Common problems
Symptom | Likely cause | Fix |
|---|---|---|
404 when you open the endpoint in a browser | You sent a GET request. | The endpoint only accepts POST. |
400 on the token request | Wrong user, password or applicationId. | Check the credentials and use CloudInteropApplication. |
An authorization error right after it worked | The token expired. | Get a new token and retry. |
Required claim 'ConnectAccounting' is not present | Your user doesn't have the Accounting permission. | Ask Expressoft to add it. |
HTTP 200 with a top-level errors array | Invalid query: unknown field, wrong type, bad syntax. | Check field and argument names in the GraphQL Playground. |
purchaseInvoiceCreate returns an errorCode | A rule failed. | Read errorCode and errorMessage. Fix the keys or the lines and retry. |
items: [] | No document matches the filters. | Not an error. Check organization, dateBegin and dateEnd. |
Missing documents | Only the first page was read. | Page through the results until hasNextPage is false. |
Data saved in sandbox is gone | The DEMO database is restored periodically. | Don't rely on sandbox data. Create your test data again. |
The Playground doesn't load in production | The Playground exists only in sandbox. | Call the endpoint directly. |