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 ARCAnumber— the authorized voucher numberamounts—{ computedTotal, sentTotal, vatAdjustment }, all in centavoscaeExpirationDate— 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.
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.
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.
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.