On this page

Numbering ranges

List the DIAN-authorized numbering ranges of your AdapterDian account and declare the right numbering_prefix when you issue.

Every document you issue consumes a number from a range the DIAN authorized for you. With a single active range per document type you don’t need to do anything. With more than one active range of the same type, declaring the right numbering_prefix is the only thing that prevents the document from being rejected.

List your ranges

GET /invoices/v1/numbering-ranges
curl https://adapterdian.piensait.com/functions/v1/invoices/v1/numbering-ranges \
  -H "Authorization: Bearer $ADAPTERDIAN_API_KEY"

Payroll has its own ranges: GET /payrolls/v1/numbering-ranges.

Each range returns:

Field Meaning
prefix The value you declare as numbering_prefix when issuing.
kind Document type, in this contract’s vocabulary. null when the range is for a type AdapterDian doesn’t issue yet.
from, to Authorized limits.
current Last consecutive number consumed.
is_active Whether the range can be used.

Declare the prefix

Add numbering_prefix (1 to 10 characters) to the issuing body:

{
  "numbering_prefix": "<prefix>",
  "customer": { … },
  "items": [ … ],
  "payment_details": [ … ]
}

Watch current against to

When current gets close to to, request a new resolution from the DIAN before the range runs out.