Retenciones
Envia una retención a la autoridad tributaria
post/purchases/retentions/{id}/send-to-tax-authority
Request
- Base URL: https://api.datil.com (the document declares no server; this is the origin it was published from)
- URL: https://api.datil.com/purchases/retentions/{id}/send-to-tax-authority
- Auth: none declared
Path parameters
idstring required
Identificador único del documento, generado por Dátil.
Response
OK
Example response
{
"id": "81wxc0qk5cgz4a7z3550a3art3",
"series": "R001",
"sequence": 1,
"currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"country": {
"code": "PE",
"name": "Perú"
},
"type": "pe/purchase-retention",
"tax_clearance": {
"void_requests": [
{
"id": "81wxc0qk5cgz4a7z3550a3art3",
"type": "pe/void-request",
"series": "RA-20210315",
"sequence": 1,
"number": "RA-20210315-3",
"tax_clearance": {
"status": "cleared",
"status_description": "ACEPTADO",
"status_code": "0",
"ticket": "1234567890",
"date": "1791394186",
"message": "El documento ha sido aceptado.",
"ack_xml": "<xml></xml>",
"qr_data": "20602224886|6|F002|F002-29|1800.00|11800.00|02/10/2020|6|20877294591|",
"xml": "https://api.datil.com/documents/1234/xml",
"pdf": "https://api.datil.com/p/1234",
"warnings": [
{
"status_code": "0000",
"message": "Documento de pruebas"
}
]
}
}
],
"status": "cleared",
"status_description": "ACEPTADO",
"status_code": "0",
"ticket": "1234567890",
"date": "1791394186",
"message": "El documento ha sido aceptado.",
"ack_xml": "<xml></xml>",
"qr_data": "20602224886|6|F002|F002-29|1800.00|11800.00|02/10/2020|6|20877294591|",
"xml": "https://api.datil.com/documents/1234/xml",
"pdf": "https://api.datil.com/p/1234",
"warnings": [
{
"status_code": "0000",
"message": "Documento de pruebas"
}
]
},
"recipient_legal_name": "Jose Mario",
"recipient_tax_id": "20601595665",
"recipient_tax_id_type": {
"type": "pe-ruc",
"code": "6",
"name": "RUC"
},
"recipient_email": "prueba@prueba.com",
"recipient_address": {
"line_1": "Calle A",
"locality": "Lima",
"administrative_district_level_1": "Miraflores",
"administrative_district_level_2": "Lima",
"city": "Lima",
"province": "Lima",
"tax_code": "0000",
"country": {
"code": "PE",
"name": "Perú"
}
},
"vendor_legal_name": "Jose Mario",
"vendor_commercial_name": "Jose Mario",
"vendor_tax_id": "20601595665",
"vendor_tax_id_type": {
"type": "pe-ruc",
"code": "6",
"name": "RUC"
},
"vendor_address": {
"line_1": "Calle A",
"locality": "Lima",
"administrative_district_level_1": "Miraflores",
"administrative_district_level_2": "Lima",
"city": "Lima",
"province": "Lima",
"tax_code": "0000",
"country": {
"code": "PE",
"name": "Perú"
}
},
"retention_regime": "01",
"retention_rate": 1,
"note": "Nota sobre el documento",
"total": 100,
"total_in_words": "Ciento dieciocho soles.",
"total_paid_amount": 97,
"line_items": [
{
"affected_document_type": "01",
"affected_document_number": "R001-1",
"affected_document_order": "1",
"affected_document_issue_date": "2026-10-07T17:29:46Z",
"affected_document_total_amount": 12323.02,
"affected_document_currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"affected_document_payments": [
{
"date": "2026-10-07T17:29:46Z",
"amount": 1223.22,
"currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
}
}
],
"retention_amount": 10.02,
"retention_currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"retention_date": "2026-10-07T17:29:46Z",
"payable_amount": 10.02,
"payable_amount_currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"exchange_rate_source_currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"exchange_rate_target_currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"exchange_rate_calculation_rate": 3,
"exchange_rate_date": "2026-10-07T17:29:46Z"
}
],
"void_requests": [
{
"id": "81wxc0qk5cgz4a7z3550a3art3",
"issue_date": "2026-10-07T17:29:46Z",
"series": "F001",
"number": "FC01-1",
"currency": {
"code": "PEN",
"name": "Soles Peruanos",
"symbol": "S/."
},
"country": {
"code": "PE",
"name": "Perú"
},
"type": "pe/purchase-retention-void-request",
"recipient_legal_name": "Jose Mario",
"recipient_tax_id": "20601595665",
"recipient_tax_id_type": {
"type": "pe-ruc",
"code": "6",
"name": "RUC"
},
"recipient_email": "prueba@prueba.com",
"recipient_address": {
"line_1": "Calle A",
"locality": "Lima",
"administrative_district_level_1": "Miraflores",
"administrative_district_level_2": "Lima",
"city": "Lima",
"province": "Lima",
"tax_code": "0000",
"country": {
"code": "PE",
"name": "Perú"
}
},
"vendor_legal_name": "Jose Mario",
"vendor_commercial_name": "Jose Mario",
"vendor_tax_id": "20601595665",
"vendor_tax_id_type": {
"type": "pe-ruc",
"code": "6",
"name": "RUC"
},
"vendor_address": {
"line_1": "Calle A",
"locality": "Lima",
"administrative_district_level_1": "Miraflores",
"administrative_district_level_2": "Lima",
"city": "Lima",
"province": "Lima",
"tax_code": "0000",
"country": {
"code": "PE",
"name": "Perú"
}
},
"tax_clearance": {
"void_requests": [
{
"id": "81wxc0qk5cgz4a7z3550a3art3",
"type": "pe/void-request",
"series": "RA-20210315",
"sequence": 1,
"number": "RA-20210315-3",
"tax_clearance": {
"status": "cleared",
"status_description": "ACEPTADO",
"status_code": "0",
"ticket": "1234567890",
"date": "1791394186",
"message": "El documento ha sido aceptado.",
"ack_xml": "<xml></xml>",
"qr_data": "20602224886|6|F002|F002-29|1800.00|11800.00|02/10/2020|6|20877294591|",
"xml": "https://api.datil.com/documents/1234/xml",
"pdf": "https://api.datil.com/p/1234",
"warnings": [
{
"status_code": "0000",
"message": "Documento de pruebas"
}
]
}
}
],
"status": "cleared",
"status_description": "ACEPTADO",
"status_code": "0",
"ticket": "1234567890",
"date": "1791394186",
"message": "El documento ha sido aceptado.",
"ack_xml": "<xml></xml>",
"qr_data": "20602224886|6|F002|F002-29|1800.00|11800.00|02/10/2020|6|20877294591|",
"xml": "https://api.datil.com/documents/1234/xml",
"pdf": "https://api.datil.com/p/1234",
"warnings": [
{
"status_code": "0000",
"message": "Documento de pruebas"
}
]
},
"voided_documents": [
{
"number": "R001-1",
"series": "R001",
"document_type": "01",
"sequence": 1,
"void_reason": "Anulación por error en la información."
}
]
}
],
"custom_fields": [
{
"name": "Cedula del Pasajero",
"value": "1234556",
"code": "3001"
}
],
"notes": [
{
"text": "Documento tributario",
"code": "2008"
}
]
}Changes
No recorded changes to this operation across all 1 revision of this API.