SendInvoice-TestSetId Productos Gratis
Endpoint
- Método: POST
- Ruta:
/public/api/ubl2.1/invoice - URL ejemplo:
http://apidian2023.oo/public/api/ubl2.1/invoice
Descripción
ENVIO DE FACTURA CON PRODUCTOS GRATIS
-
Aplica la misma documentacion que el PRIMER ENVIO DE FACTURA de la seccion 02 - PRIMEROS ENVIOS.
-
Este ejemplo ilustra como se debe utilizar la API para enviar una factura que incluya articulos que no seran cobrados, es decir obsequios, o productos gratis, el campo que especifica esta situacion es free_of_charge_indicator
Autenticación
- Tipo: Bearer Token
- Header:
Authorization: Bearer {{API_TOKEN}}
Headers
| Key | Value |
|---|---|
Content-Type | application/json |
Accept | application/json |
Body
{
"number": 990000367,
"type_document_id": 1,
"date": "2021-08-17",
"time": "22:09:34",
"resolution_number": "18760000001",
"prefix": "SETP",
"sendmail": false,
"customer": {
"identification_number": 1053005500,
"dv": 8,
"name": "DANIEL JOSÉ ACOSTA RODRIGUEZ",
"phone": "0000000",
"address": "Sin definir",
"email": "sin_informacion@sin_informacion.com",
"merchant_registration": "0000000-00",
"type_document_identification_id": 3,
"type_organization_id": 2,
"municipality_id": 150,
"type_regime_id": 2
},
"payment_form": {
"payment_form_id": 1,
"payment_method_id": 30,
"payment_due_date": "2021-09-17",
"duration_measure": 30
},
"allowance_charges": [
{
"discount_id": 12,
"charge_indicator": false,
"allowance_charge_reason": "BECA ESPECIAL ",
"amount": 438901.0,
"base_amount": 438901.0
}
],
"legal_monetary_totals": {
"line_extension_amount": 463992.0,
"tax_exclusive_amount": 463992.0,
"tax_inclusive_amount": 463992.0,
"allowance_total_amount": 438901.0,
"charge_total_amount": 0.0,
"payable_amount": 25091.0
},
"tax_totals": [
{
"tax_id": 1,
"tax_amount": 0.0,
"percent": 0.0,
"taxable_amount": 0.0
}
],
"invoice_lines": [
{
"unit_measure_id": 70,
"invoiced_quantity": 1,
"line_extension_amount": 4389.0,
"free_of_charge_indicator": false,
"tax_totals": [
{
"tax_id": 1,
"tax_amount": 0.0,
"percent": 0.0,
"taxable_amount": 4389.0
}
],
"description": "ESTAMPILLA PREGRADO",
"code": "000883",
"type_item_identification_id": 4,
"price_amount": 4389.0,
"base_quantity": 1
},
{
"unit_measure_id": 70,
"invoiced_quantity": 1,
"line_extension_amount": 20702.0,
"free_of_charge_indicator": false,
"tax_totals": [
{
"tax_id": 1,
"tax_amount": 0.0,
"percent": 0.0,
"taxable_amount": 20702.0
}
],
"description": "DERECHOS ESPERIALES PREGRADO",
"code": "000882",
"type_item_identification_id": 4,
"price_amount": 20702.0,
"base_quantity": 1
},
{
"unit_measure_id": 70,
"invoiced_quantity": 1,
"line_extension_amount": 438901.0,
"allowance_charges": [
{
"discount_id": 12,
"charge_indicator": false,
"allowance_charge_reason": "BECA ESPECIAL ",
"amount": 438901.0,
"base_amount": 438901.0
}
],
"tax_totals": [
{
"tax_id": 1,
"tax_amount": 0.0,
"percent": 0.0,
"taxable_amount": 438901.0
}
],
"description": "MATRICULA PREGRADO",
"code": "000880",
"type_item_identification_id": 4,
"price_amount": 438901.0,
"base_quantity": 1,
"reference_price_id": 1,
"free_of_charge_indicator": true
}
]
}
cURL
curl -X POST "http://apidian2023.oo/public/api/ubl2.1/invoice" \
-H "Authorization: Bearer {API_TOKEN}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"number": 990000367,
"type_document_id": 1,
"date": "2021-08-17",
"time": "22:09:34",
"resolution_number": "18760000001",
"prefix": "SETP",
"sendmail": false,
"customer": {
"identification_number": 1053005500,
"dv": 8,
"name": "DANIEL JOSÉ ACOSTA RODRIGUEZ",
"phone": "0000000",
"address": "Sin definir",
"email": "sin_informacion@sin_informacion.com",
"merchant_registration": "0000000-00",
"type_document_identification_id": 3,
"type_organization_id": 2,
"municipality_id": 150,
"type_regime_id": 2
},
"payment_form": {
"payment_form_id": 1,
"payment_method_id": 30,
"payment_due_date": "2021-09-17",
"duration_measure": 30
},
"allowance_charges": [
{
"discount_id": 12,
"charge_indicator": false,
"allowance_charge_reason": "BECA ESPECIAL ",
"amount": 438901.0,
"base_amount": 438901.0
}
],
"legal_monetary_totals": {
"line_extension_amount": 463992.0,
"tax_exclusive_amount": 463992.0,
"tax_inclusive_amount": 463992.0,
"allowance_total_amount": 438901.0,
"charge_total_amount": 0.0,
"payable_amount": 25091.0
},
"tax_totals": [
{
"tax_id": 1,
"tax_amount": 0.0,
"percent": 0.0,
"taxable_amount": 0.0
}
],
"invoice_lines": [
{
"unit_measure_id": 70,
"invoiced_quantity": 1,
"line_extension_amount": 4389.0,
"free_of_charge_indicator": false,
"tax_totals": [
{
"tax_id": 1,
"tax_amount": 0.0,
"percent": 0.0,
"taxable_amount": 4389.0
}
],
"description": "ESTAMPILLA PREGRADO",
"code": "000883",
"type_item_identification_id": 4,
"price_amount": 4389.0,
"base_quantity": 1
},
{
"unit_measure_id": 70,
"invoiced_quantity": 1,
"line_extension_amount": 20702.0,
"free_of_charge_indicator": false,
"tax_totals": [
{
"tax_id": 1,
"tax_amount": 0.0,
"percent": 0.0,
"taxable_amount": 20702.0
}
],
"description": "DERECHOS ESPERIALES PREGRADO",
"code": "000882",
"type_item_identification_id": 4,
"price_amount": 20702.0,
"base_quantity": 1
},
{
"unit_measure_id": 70,
"invoiced_quantity": 1,
"line_extension_amount": 438901.0,
"allowance_charges": [
{
"discount_id": 12,
"charge_indicator": false,
"allowance_charge_reason": "BECA ESPECIAL ",
"amount": 438901.0,
"base_amount": 438901.0
}
],
"tax_totals": [
{
"tax_id": 1,
"tax_amount": 0.0,
"percent": 0.0,
"taxable_amount": 438901.0
}
],
"description": "MATRICULA PREGRADO",
"code": "000880",
"type_item_identification_id": 4,
"price_amount": 438901.0,
"base_quantity": 1,
"reference_price_id": 1,
"free_of_charge_indicator": true
}
]
}'