AfipCreateInvoice
Description
Section titled “Description”Issues an electronic voucher (Invoice A, B or C) to Argentina’s AFIP through the AFIP SDK server. The node automatically computes the next voucher number by querying the last authorized one, and retrieves the CAE (Electronic Authorization Code) required for the invoice to be legally valid.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | AFIP SDK server credential |
| voucher_type | select | No | Type: 1=Invoice A, 6=Invoice B, 11=Invoice C (default: 6) |
| point_of_sale | number | Yes | Point of sale number registered in AFIP |
| concept | select | No | 1=Products, 2=Services, 3=Both (default: 1) |
| doc_type | select | No | 99=Final Consumer, 80=CUIT, 96=DNI (default: 99) |
| doc_number | text | No | Receiver document number (0 for final consumer) |
| total_amount | number | Yes | Total amount including VAT |
| iva_rate | select | No | VAT rate: 21%, 10.5% or 0% (default: 21%) |
| currency | select | No | PES=Pesos, DOL=Dollars (default: PES) |
| issue_date | text | No | Issue date YYYYMMDD (default: today) |
Credentials
Section titled “Credentials”This module requires an afip credential type with the following fields:
- Server URL: URL of the AFIP SDK server (e.g.
http://localhost:4000) - Token: Authentication token for the SDK server (optional depending on configuration)
- CUIT: Tax ID of the issuing company
- Environment:
homologation(testing) orproduction
Output
Section titled “Output”{ "success": true, "cae": "71234567890123", "cae_fch_vto": "20251231", "voucher_number": 42, "voucher_type": 6, "point_of_sale": 1, "issue_date": "20251201", "total_amount": 1210, "raw": { ... }}Usage Example
Section titled “Usage Example”Invoice B for $1,210 to a final consumer
Section titled “Invoice B for $1,210 to a final consumer”{ "credentials_id": "cred-afip-prod", "voucher_type": "6", "point_of_sale": "1", "concept": "1", "doc_type": "99", "doc_number": "0", "total_amount": "1210", "iva_rate": "21"}Invoice A for services to a company
Section titled “Invoice A for services to a company”{ "credentials_id": "cred-afip-prod", "voucher_type": "1", "point_of_sale": "1", "concept": "2", "doc_type": "80", "doc_number": "30123456789", "total_amount": "5000", "iva_rate": "21"}Typical Flow
Section titled “Typical Flow”- AfipGetLastVoucher — query the last authorized number
- AfipCreateInvoice — issue the invoice (next number is computed internally)
- Save CAE to database
- The voucher number is automatically incremented by querying the last authorized one
- For Invoice B to final consumers (doc_type=99), VAT is not itemized in the AFIP XML
- If the SDK server does not return a CAE, the node returns an error even if the HTTP status is 200
- The
rawfield contains the full SDK server response for debugging
Related Nodes
Section titled “Related Nodes”- AfipGetLastVoucher - Query last authorized voucher
- AfipQueryInvoice - Query an already issued voucher