FACTURA GRAVADA - GRATUITA
POST/api/documents
Generar una factura con item gravado y gratuito.
Ejemplo:
- Método: POST
- URL: https://demo.pro5.fastura.app/api/documents
- TOKEN: HOHYgwd4atPalTxqi2IIspythpLAU7eP239oByfjk9VuveiOpfUTm4Yg0Szt
Request
- application/json
- application/xml
- application/x-www-form-urlencoded
Body
required
- JSON A ENVIAR
Array [
]
serie_documentostringrequired
Example:
F001
numero_documentostringrequired
Example:
#
fecha_de_emisiondaterequired
Example:
2018-10-09
hora_de_emisiontimerequired
Example:
10:11:11
codigo_tipo_operacionstringrequired
Example:
0101
codigo_tipo_documentostringrequired
Example:
01
codigo_tipo_monedastringrequired
Example:
PEN
fecha_de_vencimientodaterequired
Example:
2018-10-09
numero_orden_de_comprastring
Example:
0045467898
datos_del_cliente_o_receptor
object
required
codigo_tipo_documento_identidadstring
Example:
6
numero_documentostring
Example:
10414711225
apellidos_y_nombres_o_razon_socialstring
Example:
EMPRESA XYZ S.A.
codigo_paisstring
Example:
PE
ubigeostring
Example:
150101
direccionstring
Example:
Av. 2 de Mayo
correo_electronicostring
Example:
demo@gmail.com
telefonostring
Example:
427-1148
totales
object
required
total_exportacionfloat
Example:
0
total_operaciones_gravadasfloat
Example:
100
total_operaciones_inafectasfloat
Example:
0
total_operaciones_exoneradasfloat
Example:
0
total_operaciones_gratuitasfloat
Example:
100
total_igvfloat
Example:
18
total_impuestosfloat
Example:
18
total_valorfloat
Example:
100
total_ventafloat
Example:
118
items
object[]
required
codigo_internostring
Example:
P0121
descripcionstring
Example:
Inca Kola 250 ml
codigo_producto_sunatstring
Example:
unidad_de_medidastring
Example:
NIU
cantidadint32
Example:
2
valor_unitariofloat
Example:
50
codigo_tipo_preciostring
Example:
01
precio_unitariofloat
Example:
59
codigo_tipo_afectacion_igvstring
Example:
10
total_base_igvfloat
Example:
100
porcentaje_igvfloat
Example:
18
total_igvfloat
Example:
18
total_impuestosfloat
Example:
18
total_valor_itemfloat
Example:
100
total_itemfloat
Example:
118
Body
required
- JSON A ENVIAR
Array [
]
serie_documentostringrequired
Example:
F001
numero_documentostringrequired
Example:
#
fecha_de_emisiondaterequired
Example:
2018-10-09
hora_de_emisiontimerequired
Example:
10:11:11
codigo_tipo_operacionstringrequired
Example:
0101
codigo_tipo_documentostringrequired
Example:
01
codigo_tipo_monedastringrequired
Example:
PEN
fecha_de_vencimientodaterequired
Example:
2018-10-09
numero_orden_de_comprastring
Example:
0045467898
datos_del_cliente_o_receptor
object
required
codigo_tipo_documento_identidadstring
Example:
6
numero_documentostring
Example:
10414711225
apellidos_y_nombres_o_razon_socialstring
Example:
EMPRESA XYZ S.A.
codigo_paisstring
Example:
PE
ubigeostring
Example:
150101
direccionstring
Example:
Av. 2 de Mayo
correo_electronicostring
Example:
demo@gmail.com
telefonostring
Example:
427-1148
totales
object
required
total_exportacionfloat
Example:
0
total_operaciones_gravadasfloat
Example:
100
total_operaciones_inafectasfloat
Example:
0
total_operaciones_exoneradasfloat
Example:
0
total_operaciones_gratuitasfloat
Example:
100
total_igvfloat
Example:
18
total_impuestosfloat
Example:
18
total_valorfloat
Example:
100
total_ventafloat
Example:
118
items
object[]
required
codigo_internostring
Example:
P0121
descripcionstring
Example:
Inca Kola 250 ml
codigo_producto_sunatstring
Example:
unidad_de_medidastring
Example:
NIU
cantidadint32
Example:
2
valor_unitariofloat
Example:
50
codigo_tipo_preciostring
Example:
01
precio_unitariofloat
Example:
59
codigo_tipo_afectacion_igvstring
Example:
10
total_base_igvfloat
Example:
100
porcentaje_igvfloat
Example:
18
total_igvfloat
Example:
18
total_impuestosfloat
Example:
18
total_valor_itemfloat
Example:
100
total_itemfloat
Example:
118
Body
required
- JSON A ENVIAR
Array [
]
serie_documentostringrequired
Example:
F001
numero_documentostringrequired
Example:
#
fecha_de_emisiondaterequired
Example:
2018-10-09
hora_de_emisiontimerequired
Example:
10:11:11
codigo_tipo_operacionstringrequired
Example:
0101
codigo_tipo_documentostringrequired
Example:
01
codigo_tipo_monedastringrequired
Example:
PEN
fecha_de_vencimientodaterequired
Example:
2018-10-09
numero_orden_de_comprastring
Example:
0045467898
datos_del_cliente_o_receptor
object
required
codigo_tipo_documento_identidadstring
Example:
6
numero_documentostring
Example:
10414711225
apellidos_y_nombres_o_razon_socialstring
Example:
EMPRESA XYZ S.A.
codigo_paisstring
Example:
PE
ubigeostring
Example:
150101
direccionstring
Example:
Av. 2 de Mayo
correo_electronicostring
Example:
demo@gmail.com
telefonostring
Example:
427-1148
totales
object
required
total_exportacionfloat
Example:
0
total_operaciones_gravadasfloat
Example:
100
total_operaciones_inafectasfloat
Example:
0
total_operaciones_exoneradasfloat
Example:
0
total_operaciones_gratuitasfloat
Example:
100
total_igvfloat
Example:
18
total_impuestosfloat
Example:
18
total_valorfloat
Example:
100
total_ventafloat
Example:
118
items
object[]
required
codigo_internostring
Example:
P0121
descripcionstring
Example:
Inca Kola 250 ml
codigo_producto_sunatstring
Example:
unidad_de_medidastring
Example:
NIU
cantidadint32
Example:
2
valor_unitariofloat
Example:
50
codigo_tipo_preciostring
Example:
01
precio_unitariofloat
Example:
59
codigo_tipo_afectacion_igvstring
Example:
10
total_base_igvfloat
Example:
100
porcentaje_igvfloat
Example:
18
total_igvfloat
Example:
18
total_impuestosfloat
Example:
18
total_valor_itemfloat
Example:
100
total_itemfloat
Example:
118
Responses
- 200
- 400
- 422
JSON RESPUESTA
- application/json
- application/xml
- Schema
- Example (from schema)
Schema
successboolean
Example:
true
data
object
required
numberstring
Example:
F001-28
filenamestring
Example:
20302019010-01-F001-28
external_idstring
Example:
3eefb33e-2045-4bdd-b661-1462b889f7a9
state_type_idstring
Example:
09
state_type_descriptionstring
Example:
Rechazado
number_to_letterstring
Example:
Ciento dieciocho con 00/100
hashstring
Example:
dU/4QSox0DKpsGz/yaD8D+nUGqY=
qrstring
Example:
iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAIAAACzY+a1AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4AQCbgGR/Af///wAAAMPNxEJsyosTAAAAAElFTkSuQmCC
idinteger
Example:
324
links
object
xmlstring
Example:
https://demo.pro5.fastura.app/downloads/document/xml/3eefb33e-2045-4bdd-b661-1462b889f7a9
pdfstring
Example:
https://demo.pro5.fastura.app/downloads/document/pdf/3eefb33e-2045-4bdd-b661-1462b889f7a9
cdrstring
Example:
https://demo.pro5.fastura.app/downloads/document/cdr/3eefb33e-2045-4bdd-b661-1462b889f7a9
response
object
codestring
Example:
3272
descriptionstring
Example:
La base imponible a nivel de línea difiere de la información consignada en el comprobante - Detalle: xxx.xxx.xxx value='ticket: 1695423268586 error: Error en la linea: 2: 3272 (nodo: "cac:TaxSubtotal/cbc:TaxableAmount" valor: "100.00")'
{
"success": true,
"data": {
"number": "F001-28",
"filename": "20302019010-01-F001-28",
"external_id": "3eefb33e-2045-4bdd-b661-1462b889f7a9",
"state_type_id": "09",
"state_type_description": "Rechazado",
"number_to_letter": "Ciento dieciocho con 00/100",
"hash": "dU/4QSox0DKpsGz/yaD8D+nUGqY=",
"qr": "iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAIAAACzY+a1AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4AQCbgGR/Af///wAAAMPNxEJsyosTAAAAAElFTkSuQmCC",
"id": 324
},
"links": {
"xml": "https://demo.pro5.fastura.app/downloads/document/xml/3eefb33e-2045-4bdd-b661-1462b889f7a9",
"pdf": "https://demo.pro5.fastura.app/downloads/document/pdf/3eefb33e-2045-4bdd-b661-1462b889f7a9",
"cdr": "https://demo.pro5.fastura.app/downloads/document/cdr/3eefb33e-2045-4bdd-b661-1462b889f7a9"
},
"response": {
"code": "3272",
"description": "La base imponible a nivel de línea difiere de la información consignada en el comprobante - Detalle: xxx.xxx.xxx value='ticket: 1695423268586 error: Error en la linea: 2: 3272 (nodo: \"cac:TaxSubtotal/cbc:TaxableAmount\" valor: \"100.00\")'"
}
}
- Schema
- Example (from schema)
Schema
successboolean
Example:
true
data
object
required
numberstring
Example:
F001-28
filenamestring
Example:
20302019010-01-F001-28
external_idstring
Example:
3eefb33e-2045-4bdd-b661-1462b889f7a9
state_type_idstring
Example:
09
state_type_descriptionstring
Example:
Rechazado
number_to_letterstring
Example:
Ciento dieciocho con 00/100
hashstring
Example:
dU/4QSox0DKpsGz/yaD8D+nUGqY=
qrstring
Example:
iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAIAAACzY+a1AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4AQCbgGR/Af///wAAAMPNxEJsyosTAAAAAElFTkSuQmCC
idinteger
Example:
324
links
object
xmlstring
Example:
https://demo.pro5.fastura.app/downloads/document/xml/3eefb33e-2045-4bdd-b661-1462b889f7a9
pdfstring
Example:
https://demo.pro5.fastura.app/downloads/document/pdf/3eefb33e-2045-4bdd-b661-1462b889f7a9
cdrstring
Example:
https://demo.pro5.fastura.app/downloads/document/cdr/3eefb33e-2045-4bdd-b661-1462b889f7a9
response
object
codestring
Example:
3272
descriptionstring
Example:
La base imponible a nivel de línea difiere de la información consignada en el comprobante - Detalle: xxx.xxx.xxx value='ticket: 1695423268586 error: Error en la linea: 2: 3272 (nodo: "cac:TaxSubtotal/cbc:TaxableAmount" valor: "100.00")'
<root>
<success>true</success>
<data>
<number>F001-28</number>
<filename>20302019010-01-F001-28</filename>
<external_id>3eefb33e-2045-4bdd-b661-1462b889f7a9</external_id>
<state_type_id>09</state_type_id>
<state_type_description>Rechazado</state_type_description>
<number_to_letter>Ciento dieciocho con 00/100</number_to_letter>
<hash>dU/4QSox0DKpsGz/yaD8D+nUGqY=</hash>
<qr>iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAIAAACzY+a1AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4AQCbgGR/Af///wAAAMPNxEJsyosTAAAAAElFTkSuQmCC</qr>
<id>324</id>
</data>
<links>
<xml>https://demo.pro5.fastura.app/downloads/document/xml/3eefb33e-2045-4bdd-b661-1462b889f7a9</xml>
<pdf>https://demo.pro5.fastura.app/downloads/document/pdf/3eefb33e-2045-4bdd-b661-1462b889f7a9</pdf>
<cdr>https://demo.pro5.fastura.app/downloads/document/cdr/3eefb33e-2045-4bdd-b661-1462b889f7a9</cdr>
</links>
<response>
<code>3272</code>
<description>La base imponible a nivel de línea difiere de la información consignada en el comprobante - Detalle: xxx.xxx.xxx value='ticket: 1695423268586 error: Error en la linea: 2: 3272 (nodo: "cac:TaxSubtotal/cbc:TaxableAmount" valor: "100.00")'</description>
</response>
</root>
Invalid input
Validation exception