curl --request POST \
--url https://api.cufea.com/v1/notes/{kind}/{document_id}/send \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cufea.com/v1/notes/{kind}/{document_id}/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.cufea.com/v1/notes/{kind}/{document_id}/send"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"cude": "<string>",
"customer": {
"id_number": "<string>",
"id_type": "<string>",
"name": "<string>"
},
"delivery": {
"status": "pending",
"attempts": 0,
"manual": false,
"reason": "<string>",
"recipient": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"document_id": "<string>",
"issue_datetime": "2023-11-07T05:31:56Z",
"kind": "credit_note",
"lines": [
{
"description": "<string>",
"discount_amount": "<string>",
"discount_rate": "<string>",
"gross_amount": "<string>",
"is_excluded": true,
"item_code": "<string>",
"line_id": 123,
"net_amount": "<string>",
"quantity": "<string>",
"taxes": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"unit_code": "<string>",
"unit_price": "<string>"
}
],
"number": 123,
"prefix": "<string>",
"qr": {
"content": "<string>",
"url": "<string>"
},
"send": "queued",
"state": "<string>",
"taxes": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"totals": {
"allowance_total": "<string>",
"charge_total": "<string>",
"line_extension": "<string>",
"payable": "<string>",
"rounding": "<string>",
"tax_exclusive": "<string>",
"tax_inclusive": "<string>"
},
"withholdings": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"dian_errors": [
{
"rule": "<string>",
"severity": "<string>",
"text": "<string>"
}
],
"dian_status_code": "<string>",
"dian_status_description": "<string>",
"notes": [
"<string>"
],
"reference": "<string>",
"sent_at": "2023-11-07T05:31:56Z"
}{
"cude": "<string>",
"customer": {
"id_number": "<string>",
"id_type": "<string>",
"name": "<string>"
},
"delivery": {
"status": "pending",
"attempts": 0,
"manual": false,
"reason": "<string>",
"recipient": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"document_id": "<string>",
"issue_datetime": "2023-11-07T05:31:56Z",
"kind": "credit_note",
"lines": [
{
"description": "<string>",
"discount_amount": "<string>",
"discount_rate": "<string>",
"gross_amount": "<string>",
"is_excluded": true,
"item_code": "<string>",
"line_id": 123,
"net_amount": "<string>",
"quantity": "<string>",
"taxes": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"unit_code": "<string>",
"unit_price": "<string>"
}
],
"number": 123,
"prefix": "<string>",
"qr": {
"content": "<string>",
"url": "<string>"
},
"send": "queued",
"state": "<string>",
"taxes": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"totals": {
"allowance_total": "<string>",
"charge_total": "<string>",
"line_extension": "<string>",
"payable": "<string>",
"rounding": "<string>",
"tax_exclusive": "<string>",
"tax_inclusive": "<string>"
},
"withholdings": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"dian_errors": [
{
"rule": "<string>",
"severity": "<string>",
"text": "<string>"
}
],
"dian_status_code": "<string>",
"dian_status_description": "<string>",
"notes": [
"<string>"
],
"reference": "<string>",
"sent_at": "2023-11-07T05:31:56Z"
}{
"code": "unauthorized",
"detail": "Missing or invalid API key.",
"request_id": "3668a7374b1e4314b2f932a5620da1f1",
"status": 401,
"title": "Unauthorized",
"type": "urn:cufea:problem:unauthorized"
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "validation_error",
"detail": "The request is not valid; see `errors` for the offending fields.",
"errors": [
{
"loc": [
"body",
"customer"
],
"msg": "Field required"
},
{
"loc": [
"body",
"lines"
],
"msg": "List should have at least 1 item after validation, not 0"
}
],
"request_id": "88272d6eb903438690d3193e3113270a",
"status": 422,
"title": "Request validation failed",
"type": "urn:cufea:problem:validation_error"
}{
"code": "rate_limited",
"detail": "This API key made more than 120 requests in the current window. Retry after 17 seconds.",
"request_id": "5d1c0b6f2e8a4f0c9a7b3e2d1c0f9a8b",
"status": 429,
"title": "Too Many Requests",
"type": "urn:cufea:problem:rate_limited"
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}Send a credit or debit note to the DIAN
Queues the sending of a stored note to the DIAN of this key’s stage and answers at once with 202; a worker sends it and records the DIAN’s answer. In the test stage, until the DIAN accepts the tenant’s test set, it goes with SendTestSetAsync to that set and the worker polls GetStatusZip; afterwards, and always in production, with SendBillSync, whose answer is final. Follow it with GET /v1/notes/{kind}/{document_id}. {kind} is credit for the credit-note series (credit_note, DIAN 91) or debit for the debit-note series (debit_note, DIAN 92); each series has its own counter.
Safe to repeat: at most one send is queued per note. send in the answer says what happened: queued (this call queued it), pending (a send was already queued or running, 202) or sent (the DIAN already has the note or answered it, nothing queued, 200). Supports Idempotency-Key.
curl --request POST \
--url https://api.cufea.com/v1/notes/{kind}/{document_id}/send \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.cufea.com/v1/notes/{kind}/{document_id}/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.cufea.com/v1/notes/{kind}/{document_id}/send"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"cude": "<string>",
"customer": {
"id_number": "<string>",
"id_type": "<string>",
"name": "<string>"
},
"delivery": {
"status": "pending",
"attempts": 0,
"manual": false,
"reason": "<string>",
"recipient": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"document_id": "<string>",
"issue_datetime": "2023-11-07T05:31:56Z",
"kind": "credit_note",
"lines": [
{
"description": "<string>",
"discount_amount": "<string>",
"discount_rate": "<string>",
"gross_amount": "<string>",
"is_excluded": true,
"item_code": "<string>",
"line_id": 123,
"net_amount": "<string>",
"quantity": "<string>",
"taxes": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"unit_code": "<string>",
"unit_price": "<string>"
}
],
"number": 123,
"prefix": "<string>",
"qr": {
"content": "<string>",
"url": "<string>"
},
"send": "queued",
"state": "<string>",
"taxes": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"totals": {
"allowance_total": "<string>",
"charge_total": "<string>",
"line_extension": "<string>",
"payable": "<string>",
"rounding": "<string>",
"tax_exclusive": "<string>",
"tax_inclusive": "<string>"
},
"withholdings": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"dian_errors": [
{
"rule": "<string>",
"severity": "<string>",
"text": "<string>"
}
],
"dian_status_code": "<string>",
"dian_status_description": "<string>",
"notes": [
"<string>"
],
"reference": "<string>",
"sent_at": "2023-11-07T05:31:56Z"
}{
"cude": "<string>",
"customer": {
"id_number": "<string>",
"id_type": "<string>",
"name": "<string>"
},
"delivery": {
"status": "pending",
"attempts": 0,
"manual": false,
"reason": "<string>",
"recipient": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
},
"document_id": "<string>",
"issue_datetime": "2023-11-07T05:31:56Z",
"kind": "credit_note",
"lines": [
{
"description": "<string>",
"discount_amount": "<string>",
"discount_rate": "<string>",
"gross_amount": "<string>",
"is_excluded": true,
"item_code": "<string>",
"line_id": 123,
"net_amount": "<string>",
"quantity": "<string>",
"taxes": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"unit_code": "<string>",
"unit_price": "<string>"
}
],
"number": 123,
"prefix": "<string>",
"qr": {
"content": "<string>",
"url": "<string>"
},
"send": "queued",
"state": "<string>",
"taxes": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"totals": {
"allowance_total": "<string>",
"charge_total": "<string>",
"line_extension": "<string>",
"payable": "<string>",
"rounding": "<string>",
"tax_exclusive": "<string>",
"tax_inclusive": "<string>"
},
"withholdings": [
{
"name": "<string>",
"percent": "<string>",
"scheme": "01",
"tax_amount": "<string>",
"taxable_amount": "<string>",
"is_excluded": false
}
],
"dian_errors": [
{
"rule": "<string>",
"severity": "<string>",
"text": "<string>"
}
],
"dian_status_code": "<string>",
"dian_status_description": "<string>",
"notes": [
"<string>"
],
"reference": "<string>",
"sent_at": "2023-11-07T05:31:56Z"
}{
"code": "unauthorized",
"detail": "Missing or invalid API key.",
"request_id": "3668a7374b1e4314b2f932a5620da1f1",
"status": 401,
"title": "Unauthorized",
"type": "urn:cufea:problem:unauthorized"
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "validation_error",
"detail": "The request is not valid; see `errors` for the offending fields.",
"errors": [
{
"loc": [
"body",
"customer"
],
"msg": "Field required"
},
{
"loc": [
"body",
"lines"
],
"msg": "List should have at least 1 item after validation, not 0"
}
],
"request_id": "88272d6eb903438690d3193e3113270a",
"status": 422,
"title": "Request validation failed",
"type": "urn:cufea:problem:validation_error"
}{
"code": "rate_limited",
"detail": "This API key made more than 120 requests in the current window. Retry after 17 seconds.",
"request_id": "5d1c0b6f2e8a4f0c9a7b3e2d1c0f9a8b",
"status": 429,
"title": "Too Many Requests",
"type": "urn:cufea:problem:rate_limited"
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}{
"code": "<string>",
"detail": "<string>",
"request_id": "<string>",
"status": 123,
"title": "<string>",
"type": "<string>",
"dian": {
"rule": "<string>",
"text": "<string>"
}
}Authorizations
Headers
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.
1 - 255Path Parameters
Response
The DIAN already has the note; nothing was queued.
The note after a send request.