Skip to main content

AddToBatch Invoice

Endpoint

  • Método: POST
  • Ruta: /api/ubl2.1/add-to-batch/invoice/{batch_id}
  • URL ejemplo: {{BASE_URL}}/api/ubl2.1/add-to-batch/invoice/batch1

Descripción

Agrega una Factura al lote (batch) indicado en la URL. Luego podrás enviarlo con SendBatch.

Flujo recomendado:

  1. Llama este endpoint por cada documento que quieras agregar al lote.
  2. Cuando completes el lote, ejecuta SendBatch.

Parámetros en la URL

  • batch_id: identificador del lote. Ejemplo: batch1.

Autenticación

  • Tipo: Bearer Token
  • Header: Authorization: Bearer {{API_TOKEN}}

Headers

KeyValue
AuthorizationBearer {{API_TOKEN}}
Content-Typeapplication/json
Acceptapplication/json

Body

{
"number": 990000210,
"type_document_id": 1,
"date": "2020-12-18",
"time": "04:08:12",
"resolution_number": "18760000001",
"prefix": "SETP",
"establishment_name": "TORRE SOFTWARE",
"sendmail": true,
"customer": {
"identification_number": 900166483,
"dv": 1,
"name": "INVERSIONES DAVAL SAS",
"phone": 3103891693,
"address": "CLL 4 NRO 33-90",
"email": "alexanderobandolondono@gmail.com",
"merchant_registration": "0000000-00",
"type_document_identification_id": 6,
"type_organization_id": 1,
"type_liability_id": 7,
"municipality_id": 822,
"type_regime_id": 1
},
"payment_form": {
"payment_form_id": 2,
"payment_method_id": 30,
"payment_due_date": "2021-01-18",
"duration_measure": "30"
},
"allowance_charges": [
{
"discount_id": 1,
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "0.00",
"base_amount": "840336.13"
}
],
"legal_monetary_totals": {
"line_extension_amount": "840336.13",
"tax_exclusive_amount": "840336.13",
"tax_inclusive_amount": "1000000.00",
"allowance_total_amount": "0.00",
"charge_total_amount": "0.00",
"payable_amount": "1000000.00"
},
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "159663.86",
"percent": "19",
"taxable_amount": "840336.13"
}
],
"invoice_lines": [
{
"unit_measure_id": 70,
"invoiced_quantity": "1",
"line_extension_amount": "840336.13",
"free_of_charge_indicator": false,
"allowance_charges": [
{
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "0.00",
"base_amount": "1000000.00"
}
],
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "159663.86",
"taxable_amount": "840336.13",
"percent": "19.00"
}
],
"description": "COMISION POR SERVICIOS",
"code": "COMISION",
"type_item_identification_id": 4,
"price_amount": "840336.13",
"base_quantity": "1"
}
]
}

Ejemplo cURL

curl -X POST '{{BASE_URL}}/api/ubl2.1/add-to-batch/invoice/batch1' \
-H 'Authorization: Bearer {{API_TOKEN}}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"number": 990000210,
"type_document_id": 1,
"date": "2020-12-18",
"time": "04:08:12",
"resolution_number": "18760000001",
"prefix": "SETP",
"establishment_name": "TORRE SOFTWARE",
"sendmail": true,
"customer": {
"identification_number": 900166483,
"dv": 1,
"name": "INVERSIONES DAVAL SAS",
"phone": 3103891693,
"address": "CLL 4 NRO 33-90",
"email": "alexanderobandolondono@gmail.com",
"merchant_registration": "0000000-00",
"type_document_identification_id": 6,
"type_organization_id": 1,
"type_liability_id": 7,
"municipality_id": 822,
"type_regime_id": 1
},
"payment_form": {
"payment_form_id": 2,
"payment_method_id": 30,
"payment_due_date": "2021-01-18",
"duration_measure": "30"
},
"allowance_charges": [
{
"discount_id": 1,
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "0.00",
"base_amount": "840336.13"
}
],
"legal_monetary_totals": {
"line_extension_amount": "840336.13",
"tax_exclusive_amount": "840336.13",
"tax_inclusive_amount": "1000000.00",
"allowance_total_amount": "0.00",
"charge_total_amount": "0.00",
"payable_amount": "1000000.00"
},
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "159663.86",
"percent": "19",
"taxable_amount": "840336.13"
}
],
"invoice_lines": [
{
"unit_measure_id": 70,
"invoiced_quantity": "1",
"line_extension_amount": "840336.13",
"free_of_charge_indicator": false,
"allowance_charges": [
{
"charge_indicator": false,
"allowance_charge_reason": "DESCUENTO GENERAL",
"amount": "0.00",
"base_amount": "1000000.00"
}
],
"tax_totals": [
{
"tax_id": 1,
"tax_amount": "159663.86",
"taxable_amount": "840336.13",
"percent": "19.00"
}
],
"description": "COMISION POR SERVICIOS",
"code": "COMISION",
"type_item_identification_id": 4,
"price_amount": "840336.13",
"base_quantity": "1"
}
]
}'

Probar endpoint

POST
AddToBatch Invoice
BASE URL
Se guarda localmente en tu navegador.
BEARER TOKEN
Se guarda solo en esta sesión/pestaña.
PATH PARAMS
batch_id
URL FINAL
/api/ubl2.1/add-to-batch/invoice/batch1
BODY JSON
RESPUESTA
Envía la solicitud para ver la respuesta aquí.