# RezoSoft API > REST API of RezoSoft Gestiune, a Romanian invoicing, inventory, POS and e-Factura (ANAF) application. Spec version 1.8.0. Descriptions are in Romanian; field names, paths and enum values are in English. - Base URL: `https://api.rezosoft.ro/v2/external` - Auth: send the header `x-api-key: ` on every request. Keys are created in the app under Setări → Integrări → Chei API; the company needs the "Acces API" module. - Format: JSON request and response bodies (`Content-Type: application/json`). - Rate limit: 150 requests per minute per IP; over it you get 429 with `Retry-After` (seconds). - Errors: `{"status": "error", "message": "..."}`, plus a stable `code` on document actions; validation errors are 422 `{"message": "...", "errors": {"field": ["..."]}}`. ## Docs - [Full reference (Markdown)](https://api.rezosoft.ro/llms-full.txt): every endpoint with parameters, bodies, responses and a curl example, generated from the OpenAPI spec. - [OpenAPI 3.1 spec (JSON)](https://api.rezosoft.ro/docs/openapi.json): the source of truth; use it to generate a client. - [Human documentation](https://api.rezosoft.ro/docs): the same content, rendered. ## Implementation notes for agents - Call the API from a server. Browsers on other origins are blocked by CORS (`x-api-key` is not an allowed header), and the key must never ship in frontend or mobile code. - Read IDs instead of hard-coding them: `GET /document-series/{documentType}` (series), `GET /document-templates` (PDF template), `GET /inventories` (warehouse, needed to move stock). - Create documents safely: send `external_id` (your order id) with `"idempotent": true` on `POST /documents`. Retrying the same request returns the same document with `"existing": true` instead of issuing a second invoice. - On 409 `in_progress` (the first request with that `external_id` is still running; a duplicate waits up to 10 s before answering 409), a network error or a 5xx, retry the identical request (same body, same `external_id`) after a few seconds. On 429, wait `Retry-After` seconds. - The document date is always today (Romania time); it cannot be set. - Order already paid (e.g. an online shop, card payment): send `payment: {"type": "online_card"}` in the same `POST /documents`, so issuing and collecting stay one idempotent call. Use `POST /documents/invoice/{id}/payments` only for later payments. - With `update_stock: true` (and `inventory_id`), each line is matched to a product by `product_id` or `code`; a line with no match is issued as free text and moves no stock. Insufficient stock never blocks the invoice: stock can go negative. - e-Factura: API invoices behave like invoices made in the app. If the company has automatic e-Factura sending enabled, ANAF submission happens on its own after the configured delay (1–4 days); do not try to submit them yourself. Clients outside Romania are not sent. - VAT is a percentage (e.g. `21`), not an id, and that rate must exist in the company settings, otherwise 422. Currencies: `RON` or `EUR` (EUR uses the BNR rate of the day). - In document detail responses, money is a string with 2 decimals and quantities/unit prices a string with 4: parse them as decimals, not floats. - `GET /documents/{documentType}/{documentId}/download-pdf` returns the PDF base64-encoded in JSON (`content`); the `pdf_url` from create/detail is a public link. - Incremental sync: page with `after_id` until `pagination.next_after_id` is null; then poll with `updated_since` set to the `server_time` of the first response of the previous run (never the client clock); upsert rows by `id` (rows with `deleted_at` were deleted). - Dates and times are Romania local time (Europe/Bucharest). A `to` date without a time covers the whole day. - New response fields can appear in any minor version: ignore fields you do not know. Check `info.version` and the changelog at the end of the introduction. ## Endpoints ### Conexiune - `GET /connection`: Test conexiune ### Resurse - `GET /document-templates`: Lista template-uri documente - `GET /document-series/{documentType}`: Lista serii documente - `GET /inventories`: Lista gestiuni ### Produse - `POST /products`: Creare produs - `GET /products`: Lista produse - `GET /products/{value}`: Detalii produs ### Documente - `POST /documents`: Creare document - `GET /documents/{documentType}`: Listare documente emise - `GET /documents/{documentType}/{documentId}`: Detalii document - `GET /documents/{documentType}/{documentId}/download-pdf`: Descărcare PDF - `POST /documents/{documentType}/{documentId}/send-email`: Trimitere email - `POST /documents/invoice/{documentId}/payments`: Încasare pe factură - `PUT /documents/proform/{documentId}`: Modificare proformă - `POST /documents/proform/{documentId}/cancel`: Anulare proformă - `POST /documents/proform/{documentId}/invoice`: Factură din proformă ### Note de recepție (NIR) - `POST /reception-notes`: Creare notă de recepție (NIR) - `GET /reception-notes`: Listare note de recepție - `GET /reception-notes/{id}`: Vizualizare notă de recepție - `GET /reception-notes/{id}/download-pdf`: Descărcare PDF notă de recepție ### e-Factura - `GET /efactura/received`: Listare facturi primite (e-Factura) - `GET /efactura/received/{id}/download-pdf`: Descărcare PDF factură primită - `GET /efactura/received/{id}/download-xml`: Descărcare XML UBL factură primită ### Rapoarte - `GET /reports/pos/incomes`: Raport încasări POS - `GET /reports/pos/products`: Raport produse vândute POS - `GET /reports/pos/receipts`: Raport bonuri POS - `GET /reports/pos/z`: Raport Z POS - `GET /reports/pos/tables`: Mese deschise (live) - `GET /reports/pos/orders`: Istoric comenzi de bucătărie - `GET /reports/pos/cancelled-items`: Linii anulate - `GET /reports/stock/movements`: Mișcări de stoc - `GET /recipes`: Rețete ### Județe și localități - `GET /map/counties`: Lista județe - `GET /map/cities`: Lista localități per județ ### Webhook-uri - `GET /webhooks/events`: Evenimente disponibile - `GET /webhooks`: Listare webhook-uri - `POST /webhooks`: Creare webhook - `GET /webhooks/{id}`: Detaliu webhook - `PATCH /webhooks/{id}`: Modificare webhook - `DELETE /webhooks/{id}`: Ștergere webhook - `POST /webhooks/{id}/pause`: Pauză webhook - `POST /webhooks/{id}/resume`: Reluare webhook - `POST /webhooks/{id}/rotate-secret`: Rotire secret - `POST /webhooks/{id}/test`: Trimitere test - `GET /webhooks/{id}/deliveries`: Jurnal livrări - `POST /webhooks/{id}/deliveries/retry-failed`: Retrimite livrările eșuate - `POST /webhooks/{id}/deliveries/{deliveryId}/retry`: Retrimite o livrare - `POST product-update`: Webhook: Actualizare produs - `POST pos.receipt.created`: Eveniment: Bon creat - `POST pos.receipt.updated`: Eveniment: Bon modificat - `POST pos.receipt.voided`: Eveniment: Bon anulat - `POST pos.order.created`: Eveniment: Comandă nouă - `POST pos.order.status_changed`: Eveniment: Comandă: status schimbat - `POST pos.table.updated`: Eveniment: Masă modificată - `POST product.created`: Eveniment: Produs creat - `POST product.updated`: Eveniment: Produs modificat - `POST product.deleted`: Eveniment: Produs șters - `POST product.stock_changed`: Eveniment: Stoc modificat