AfipGetLastVoucher
Description
Section titled “Description”Queries Argentina’s AFIP for the last authorized voucher number for a specific point of sale and voucher type. Returns both the last number (last_voucher) and the next one to use (next_voucher = last_voucher + 1).
This node is useful as a step before AfipCreateInvoice when you need to know the next number before building the full invoice payload.
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 |
Credentials
Section titled “Credentials”Requires an afip credential type:
- Server URL: URL of the AFIP SDK server
- Token: Authentication token (optional)
- CUIT: Tax ID of the company
- Environment:
homologationorproduction
Output
Section titled “Output”{ "success": true, "last_voucher": 41, "next_voucher": 42, "voucher_type": 6, "point_of_sale": 1, "raw": { ... }}Usage Example
Section titled “Usage Example”{ "credentials_id": "cred-afip-prod", "voucher_type": "6", "point_of_sale": "1"}- If no voucher of that type has ever been issued at that point of sale, returns
last_voucher: 0andnext_voucher: 1 voucher_typeandpoint_of_salecan also come from thedataobject if not set in the node config
Related Nodes
Section titled “Related Nodes”- AfipCreateInvoice - Issue an electronic invoice
- AfipQueryInvoice - Query an already issued voucher