Alya Books

    Help centre

    Guides for Alya Books and UAE e-invoicing

    API errors and status codes

    What each HTTP status and error code from the Alya Books API means and how to react.

    Every API error is a JSON body with the same shape, so one handler covers them all:

    { "code": "E_VALIDATION", "statusCode": 400, "message": "…", "field": "items", "extra": { … } }
    

    code is the machine-readable reason, field points to the offending input when there is one, and extra carries details such as PINT AE errors or batch results.

    Status codes

    StatusCodeMeaningWhat to do
    400E_VALIDATIONThe payload is invalid or the invoice fails PINT AEFix the field named in field; read extra.errors for business terms
    401UNAUTHORIZEDMissing, malformed, unknown, revoked or expired keySee the 401 article
    403FORBIDDENKey lacks the scope, or X-Organization-Id is not a managed clientCreate a key with the right scopes
    404NOT_FOUNDNo such invoice, import, customer or fileCheck the id
    409CONFLICTThe action is not allowed in the current state, for example deleting an accepted invoice or reusing a SKUChange the state first (archive instead of delete)
    413PAYLOAD_TOO_LARGEUploaded file over 20 MBSplit or compress
    422E_VALIDATIONA received document failed validation on importThe import is logged; read extra.validation
    429RATE_LIMITEDMore than 600 requests per minute for this keyWait for the seconds in Retry-After
    503SERVICE_UNAVAILABLEA PDF of a received invoice's visualisation was requested where no HTML-to-PDF service is configured (invoice, credit note, debit note and proforma PDFs always work)Request ?format=html or xml
    500INTERNAL_SERVER_ERRORUnexpected failureRetry; contact support@alyabooks.ai with X-Request-Id

    Batches

    When one invoice in a batch fails, the response takes the status of the first failure (usually 400) and extra.results lists every element with index, success and its own error. Elements with success: true were created; retry only the others.

    Good to know

    • Every response carries X-Request-Id, and error bodies repeat it as requestId. The Recent requests tab on the API access page shows the same id under each request, with status and timing.
    • Webhook deliveries retry after at least 1 min, 5 min, 30 min, 2 h and 12 h (retries are sent by a job that runs every 5 minutes); the deliveries dialog shows attempts and lets you retry by hand.

    Still stuck? Contact support