Getting startedPagination and errors

Pagination and errors

Additional page loads, application codes and API limits.

Document pagination

For POST /v2/documents, use searchAfter:

  1. Send the first request without data.searchAfter and set the sort order, for example orderBy: "issue_date".
  2. Process the returned documents.
  3. If the response contains a non-empty searchAfter, transfer the entire field without modification to data.searchAfter of the next request. Maintain organization, filters, and sorting.
  4. At APP_NO_MORE_DATA, stop loading. If the next token is missing or the token is repeated, do not send the same request in an infinite loop.

The field continuationToken is marked as obsolete in this schema.

For /v2/documents, the specification states a limit of 2,000 exported documents per request. For APP_MAX_EXPORT_LIMIT_EXCEEDED, narrow the range of filters, for example period.

Bank transactions have their own pagination scheme. Their searchAfter can contain both strings and numbers. Keep the original value types.

Result limit and summary answers

Endpointdata.limitBehavior at limit: 0
/v1/unprocessed-documents0–50. Without a value, the server's default page size will be usedOnly numbers totalDocuments and notApprovedDocuments, without documents
/v1/organization/bank-transactions0–50, by default 50Only available bank account balances, no transactions

Use 1–50 and cursor searchAfter to page items. The limit: 0 mode is used for summary data. These limits do not automatically apply to /v2/documents, which has its own rules listed above.

HTTP and application errors

Check both HTTP status and JSON response. The structure and available codes vary by endpoint.

Status or codeMeaning and further procedure
HTTP 400Invalid input or operation business rule. When uploading, also verify the accounting settings. Evaluate the eInvoice data.reason and data.message.
HTTP 401Invalid API key for bank transactions.
HTTP 409When uploading a file, the file already exists. Verify the status before retrying the request.
HTTP 403The request is not authorized. Check the key and permissions.
HTTP 404The requested resource was not found. Verify the path and identifiers.
HTTP 500Server error. Record the time and response for diagnostics without an API key.
APP_UNAUTHENTICATEDCheck header authentication api_key.
APP_INCORRECT_INPUT_DATAVerify input fields, filters, types and allowed values against the schema.
APP_ORGANIZATION_NOT_FOUND_CODEThe organization specified company identification number (IČO) was not found.
APP_MAX_EXPORT_LIMIT_EXCEEDEDNarrow down the scope of document export.
APP_READ_DATA_ERRORError loading data.
APP_NO_MORE_DATAEnd of available data when loading documents.

Errors in issuing and sending eInvoices

When issuing via v2 and with invoice-send, HTTP 400 can contain success: false, code and details in data.reason and data.message. For invoice-finalize Swagger does not list a separate 400 response. Evaluate the result here as well according to the actual answer.

data.reasonWhat to verify
NUMERIC_CODE_NOT_FOUND, NUMERIC_CODE_INVALID_FOR_INVOICE_TYPEnumber sequences and its applicability for the type of invoice when issuing via v2.
INVOICE_NOT_APPROVEDInvoice approval if required by the organization.
PEPPOL_SEND_SCOPE_MISSINGActivated authorization of the organization to send via Peppol.
INVALID_RESOURCE_TYPE, INVOICE_NOT_SENDABLEInvoice type and status.
INVOICE_ALREADY_SENTExisting submission. Load its state before trying again.
SEND_FAILED, SEND_REJECTEDError details and delivery status.

Save documentId and deliveryId after sending. Check the status via invoice-send-status. Evaluate the result delivery and taxReporting separately. Acceptance of request or HTTP 200 does not mean confirmed delivery.

API connection limits

According to the API connections API will return HTTP 429 Too Many Requests after the set daily or monthly limit is exhausted. The answer contains information about the exceeded limit. Requests rejected in this way will not appear in the Activity History.

API key usage limits are different from the limit on the number of documents per export request. The number of units for each operation and error rules can be found on Pricing.

Repetition of requests

In the case of a temporary loading error, we recommend a limited number of repetitions with increasing distance. After an authentication or login error, first correct the cause.

When issuing or finalizing an invoice, sending via Peppol, sending an email or other data changes, do not automatically resend the request after the timeout. First, verify the resulting status. The specification does not guarantee idempotency or define an idempotency key.

Source of technical parameters: Doklado OpenAPI specification.