On this page

Errors

How the Lynx API reports errors — status codes, the error body, and the 422 business-rule case.

The invoicing Edge Function returns a JSON body with an error field on failure:

{ "error": "Falta org_id." }

Status codes

Status When
400 Missing or invalid input — e.g. no org_id, no invoice_ids, or more than 50 invoices.
401 No valid session.
403 The role is not enough — /integrations/* requires admin.
404 The resource doesn’t exist in this organization, or the route is unknown.
405 A method other than POST.
422 A business rule — for example, a credential that doesn’t authenticate. The body carries message.
500 Unexpected server error.

422 is a meaningful answer, not a crash

On /integrations/save, a key that fails to authenticate is not saved and the call returns 422 with a message. Treat it as a result, not a transport error.

Retries

/transmit accepts up to 50 invoices and processes each one independently: a failure on one invoice comes back in its results entry with status: "error" while the others still go out. Retry only the invoices that failed.