Saltar al contenido principal
POST
Create a signed credit or debit note

Autorizaciones

Authorization
string
header
requerido

Send your Cufea API key as Authorization: Bearer <key>.

Encabezados

Idempotency-Key
string | null

Makes the call safe to retry. Same key and same request: the first response is replayed with Idempotent-Replayed: true and nothing is done again. Same key and another request: 422 idempotency_key_reused. Same key while the first request still runs: 409 idempotency_in_progress. Keys belong to your account; they expire 24 hours after first use, after which the same key is usable again for a new request. A 5xx, 403, 404 or 409 answer is not stored, so the same key can be retried after it.

Required string length: 1 - 255

Cuerpo

application/json

A credit (91) or debit (92) note on an invoice the DIAN accepted.

concept
requerido

DiscrepancyResponse/ResponseCode of a credit note. Toolbox ConceptoNotaCredito-2.1.gc.

Opciones disponibles:
1,
2,
3,
4,
5
concept_description
string
requerido

DiscrepancyResponse/Description of the correction.

customer
CustomerIn · object
requerido

An identified buyer: a natural or legal person with real identification data.

Only the identification and the name are required. Without address the XML leaves out PhysicalLocation and RegistrationAddress, both 0..1 for the buyer (Anexo 1.9 FAK07/FAK28); a sale outside the issuer's premises still needs it (FAK07).

invoice_id
string
requerido

Prefix and number of the referenced invoice, e.g. SETP990000000.

Required string length: 1 - 20
kind
enum<string>
requerido

91 credit note, 92 debit note.

Opciones disponibles:
91,
92
lines
LineIn · object[]
requerido
Required array length: 1 - 500 elements
payment
PaymentIn · object
requerido
issue_datetime
string<date-time> | null

Issue instant with a UTC offset. Default: now, in Colombian time.

notes
string[]

Free-text legends printed on the document, such as the return policy, the warranty or "Gracias por su compra": one cbc:Note each, in order, 5-5000 characters each, at most 20. They appear on the PDF and in the JSON record. Default: none.

Maximum array length: 20
Required string length: 5 - 5000
Ejemplo:
observation
string | null

Factus's name for a single note, 5-5000 characters: the same as notes with one item. Send notes or observation, not both.

Required string length: 5 - 5000
Ejemplo:

"Gracias por su compra"

prefix
string | null

Note prefix, 0-4 alphanumerics. Notes have no authorized range. Default: NC for a credit note and ND for a debit note, so the two series never share a document id (and therefore never the same CUDE). Send "" for unprefixed numbers.

Maximum string length: 4
Pattern: ^[A-Za-z0-9]*$
reference
string | null

Your own reference of the document (1-100 characters of A-Z a-z 0-9 . _ : -), unique per stage and document kind. Find the document by it with GET /v1/documents?reference=...&kind=..., e.g. after a create whose answer was lost. A create reusing a reference answers 409 reference_conflict, even with the same body, unless it is the replay of the same request through its Idempotency-Key; resolve it with that lookup.

Required string length: 1 - 100
Pattern: ^[A-Za-z0-9._:-]{1,100}$
Ejemplo:

"ORDER-2026-000123"

reference_id
string | null

Optional DiscrepancyResponse/ReferenceID of the corrected invoice section.

send
boolean
predeterminado:false

Also queue the note for sending to the DIAN right after it is stored. If queueing fails the note is still created and the response says send: not_queued.

send_email
boolean
predeterminado:true

Email the buyer after the DIAN accepts the document (default true, like Factus): a ZIP with the signed AttachedDocument and the PDF goes to the buyer's email, from no-reply@cufea.com under your company's name, answers to your company's email. Only in production: the sandbox and the DIAN test stage never email anyone (delivery.status skipped). Send false to deliver it yourself with GET .../email-content or POST .../send-email.

Respuesta

Successful Response

cude
string
requerido

CUDE: 96 hexadecimal characters (SHA-384).

customer
CustomerOut · object
requerido

The buyer. Read from the signed XML, so it is exactly what the DIAN received. Amounts are decimal strings with 2 decimals.

delivery
Delivery · object
requerido

The email of the note to its buyer.

document_id
string
requerido

Prefix and number, e.g. NC1.

issue_datetime
string<date-time>
requerido
kind
enum<string>
requerido

credit_note (DIAN 91) or debit_note (DIAN 92).

Opciones disponibles:
credit_note,
debit_note
lines
LineSummaryOut · object[]
requerido

The lines in order. Read from the signed XML, so it is exactly what the DIAN received. Amounts are decimal strings with 2 decimals.

number
integer
requerido
prefix
string
requerido
qr
QrOut · object
requerido
state
string
requerido

prepared until the document is sent; then the latest DIAN outcome (accepted, rejected, closed...).

taxes
TaxAmountOut · object[]
requerido

Taxes per code and percent, ordered by code and percent, then the IVA-excluded entry when a line has no IVA. Read from the signed XML, so it is exactly what the DIAN received. Amounts are decimal strings with 2 decimals.

totals
DocumentTotals · object
requerido

Monetary totals. Read from the signed XML, so it is exactly what the DIAN received. Amounts are decimal strings with 2 decimals.

withholdings
TaxAmountOut · object[]
requerido

Withholdings per code and percent; empty on notes. Read from the signed XML, so it is exactly what the DIAN received. Amounts are decimal strings with 2 decimals.

xml_base64
string
requerido

The signed UBL XML, base64 encoded.

dian_errors
DianMessage · object[]

Rule messages of the latest DIAN answer.

dian_status_code
string | null

StatusCode of the latest DIAN answer, e.g. 00; none yet.

dian_status_description
string | null

StatusDescription of the latest DIAN answer.

notes
string[]

The note's cbc:Note legends as signed, in order (notes, or the observation, given on create); empty when none.

reference
string | null

The reference given on create; null when none was given.

send
enum<string> | null

Only when send was requested: queued, or not_queued if the job queue failed (send it with POST /v1/notes/{kind}/{document_id}/send).

Opciones disponibles:
queued,
pending,
sent,
not_queued
sent_at
string<date-time> | null

When the DIAN last received the note; none if never.