Skip to main content
Every call to arca.issue() — and to issueCreditNote() and issueDebitNote() — resolves to a discriminated union. The union’s kind field tells you exactly what happened and what you need to do next. Exhaustively handling all four outcomes is the correct pattern; TypeScript’s type narrowing ensures you never accidentally treat a rejected voucher as authorized.

The four outcomes

Handling outcomes in TypeScript

authorized — save the CAE

An authorized result contains factura.voucher with the full fiscal record:
  • cae — the Código de Autorización Electrónica issued by ARCA
  • number — the authorized voucher number
  • amounts{ computedTotal, sentTotal, vatAdjustment }, all in centavos
  • caeExpirationDate — the CAE’s expiration date

recoveredByMatch: true

When factura.recoveredByMatch is true, issue() found the reserved number already authorized in ARCA and confirmed that the stored input matched the authorized voucher’s identity. This proves consistency — the reservation and the ARCA record agree — but it does not prove authorship. It means issue() did not send a new authorization request; the voucher was authorized in a previous call.
Treat recoveredByMatch: true the same as a fresh authorization: save the voucher and CAE just as you would for any authorized result.

rejected — review ARCA’s issues

A rejected result means ARCA received and processed the request but declined to authorize the voucher. The issues array contains the fiscal error codes and messages from ARCA. Common causes include an invalid recipient condition for the issuer class, a mismatched VAT rate, a sales point not enabled for your CUIT, or an exceeded identification threshold with no document provided.
After a rejection, the idempotency key remains permanently bound to the input that was rejected. To retry with a corrected input, use a new idempotency key. Reusing the same key with a different input throws ARCA_INPUT_IDEMPOTENCY_MISMATCH.

indeterminate — preserve and reconcile

An indeterminate result means issue() could not confirm whether ARCA authorized or rejected the voucher. This happens after a network timeout, an ambiguous SOAP response, or a process crash after the reservation was written but before a clear response was received. The voucher number is reserved. Do not issue a new voucher for this sale.
Retrying issue() with the identical input and the same idempotency key is safe. The SDK finds the existing reservation and consults the stored number. If ARCA confirms the number is authorized, you get an authorized result back. If ARCA confirms it is empty, you get another indeterminate with lookup.kind === "not_found" — and the retry is still safe.
factura.attempted contains the evidence from the failed attempt, and factura.lookup contains the result of any identity consultation performed. Both are useful for support and audit trails.

conflict — stop and investigate

A conflict result means the voucher number that issue() reserved is already occupied by a different, authorized document in ARCA. This should not happen in normal operation.
A conflict outcome requires immediate manual investigation. Do not retry automatically. Do not issue a new voucher for the same sale without first understanding why the conflict occurred. This may indicate a concurrent write from another process, a misconfigured sales point shared across environments, or a store inconsistency.
factura.attempted describes what issue() tried to authorize. factura.found describes the voucher ARCA returned for the reserved number. Comparing them is the starting point for your investigation.