Skip to content

AfipGetLastVoucher

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.

FieldTypeRequiredDescription
credentials_idcredentialsYesAFIP SDK server credential
voucher_typeselectNoType: 1=Invoice A, 6=Invoice B, 11=Invoice C (default: 6)
point_of_salenumberYesPoint of sale number registered in AFIP

Requires an afip credential type:

  • Server URL: URL of the AFIP SDK server
  • Token: Authentication token (optional)
  • CUIT: Tax ID of the company
  • Environment: homologation or production
{
"success": true,
"last_voucher": 41,
"next_voucher": 42,
"voucher_type": 6,
"point_of_sale": 1,
"raw": { ... }
}
{
"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: 0 and next_voucher: 1
  • voucher_type and point_of_sale can also come from the data object if not set in the node config