BOLETA GRAVADA - CONTINGENCIA
POSThttps://empresa1.demo3pro6.ibu.pe/api/documents
Para generar una factura de contingencia previamente debe registrar las series de contingencia, en el módulo Usuarios/Locales & Series sección Establecimientos.
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
serie_documentostringrequired
Example:
B001
numero_documentostringrequired
Example:
#
fecha_de_emisiondaterequired
Example:
2024-11-04
hora_de_emisiontimerequired
Example:
10:11:11
codigo_tipo_operacionstringrequired
Example:
0101
codigo_tipo_documentostringrequired
Example:
03
codigo_tipo_monedastringrequired
Example:
PEN
fecha_de_vencimientodaterequired
Example:
2019-09-03
datos_del_cliente_o_receptor
object
required
totales
object
required
items
object[]
required
Body
required
- JSON A ENVIAR
serie_documentostringrequired
Example:
B001
numero_documentostringrequired
Example:
#
fecha_de_emisiondaterequired
Example:
2024-11-04
hora_de_emisiontimerequired
Example:
10:11:11
codigo_tipo_operacionstringrequired
Example:
0101
codigo_tipo_documentostringrequired
Example:
03
codigo_tipo_monedastringrequired
Example:
PEN
fecha_de_vencimientodaterequired
Example:
2019-09-03
datos_del_cliente_o_receptor
object
required
totales
object
required
items
object[]
required
Body
required
- JSON A ENVIAR
serie_documentostringrequired
Example:
B001
numero_documentostringrequired
Example:
#
fecha_de_emisiondaterequired
Example:
2024-11-04
hora_de_emisiontimerequired
Example:
10:11:11
codigo_tipo_operacionstringrequired
Example:
0101
codigo_tipo_documentostringrequired
Example:
03
codigo_tipo_monedastringrequired
Example:
PEN
fecha_de_vencimientodaterequired
Example:
2019-09-03
datos_del_cliente_o_receptor
object
required
totales
object
required
items
object[]
required
Responses
- 200
- 400
- 422
JSON RESPUESTA
- application/json
- application/xml
- Schema
- Example (from schema)
Schema
successboolean
Example:
true
data
object
required
links
object
responsearray
Example:
[]
{
"success": true,
"data": {
"number": "0004-1",
"filename": "20415963255-03-0004-1",
"external_id": "346135d8-b730-48e2-81f4-d00c9690f4ca",
"number_to_letter": "Ciento dieciocho con 00/100",
"hash": "T3/grz45f3rK5xz7/PtlrNuhlCo=",
"qr": "iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAIAAACzY+a1AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEaUlEQVR4nO2d23LbMAwF607//5fTt9QTswhIHMvZ8e5jJYtszwCicOvt4+Pjl5D5/eoNyBQlxKOEeJQQjxLiUUI8SohHCfEoIR4lxKOEeJQQzdfVqdTI7308Zf+c3lLMh/R5QQz8iRTpgElCdRkt3ez4MRD5Hb+miFeJQQz8sc6SOTmuvUeK8sk4bZPlohHiXEo4R4MsMs40wiO3X/0e5akx7gVFdUjVaIRwnxPHGAV+SBF5TNHzi0ZmgplWqu0QrxKCGel1VzSwqtEI8S4lFCPEqIRwnxKCEeJcSjhHiUEI8S4lFCPEqIRwnx/AV6e7I2Yyb8aQAAAABJRU5ErkJggg=="
},
"links": {
"xml": "http://demo26.multifacturalonew.oo:8084/downloads/document/xml/346135d8-b730-48e2-81f4-d00c9690f4ca",
"pdf": "http://demo26.multifacturalonew.oo:8084/downloads/document/pdf/346135d8-b730-48e2-81f4-d00c9690f4ca",
"cdr": ""
},
"response": []
}
- Schema
- Example (from schema)
Schema
successboolean
Example:
true
data
object
required
links
object
responsearray
Example:
[]
<root>
<success>true</success>
<data>
<number>0004-1</number>
<filename>20415963255-03-0004-1</filename>
<external_id>346135d8-b730-48e2-81f4-d00c9690f4ca</external_id>
<number_to_letter>Ciento dieciocho con 00/100</number_to_letter>
<hash>T3/grz45f3rK5xz7/PtlrNuhlCo=</hash>
<qr>iVBORw0KGgoAAAANSUhEUgAAAJYAAACWCAIAAACzY+a1AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAEaUlEQVR4nO2d23LbMAwF607//5fTt9QTswhIHMvZ8e5jJYtszwCicOvt4+Pjl5D5/eoNyBQlxKOEeJQQjxLiUUI8SohHCfEoIR4lxKOEeJQQzdfVqdTI7308Zf+c3lLMh/R5QQz8iRTpgElCdRkt3ez4MRD5Hb+miFeJQQz8sc6SOTmuvUeK8sk4bZPlohHiXEo4R4MsMs40wiO3X/0e5akx7gVFdUjVaIRwnxPHGAV+SBF5TNHzi0ZmgplWqu0QrxKCGel1VzSwqtEI8S4lFCPEqIRwnxKCEeJcSjhHiUEI8S4lFCPEqIRwnx/AV6e7I2Yyb8aQAAAABJRU5ErkJggg==</qr>
</data>
<links>
<xml>http://demo26.multifacturalonew.oo:8084/downloads/document/xml/346135d8-b730-48e2-81f4-d00c9690f4ca</xml>
<pdf>http://demo26.multifacturalonew.oo:8084/downloads/document/pdf/346135d8-b730-48e2-81f4-d00c9690f4ca</pdf>
<cdr></cdr>
</links>
</root>
Invalid input
Validation exception
Authorization: oauth2
name: petstore_authtype: oauth2scopes:write:pets,read:pets
flows: { "implicit": { "authorizationUrl": "https://empresa1.demo3pro6.ibu.pe", "scopes": { "write:pets": "modify pets in your account", "read:pets": "read your pets" } } }
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://empresa1.demo3pro6.ibu.pe/api/documents");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"serie_documento\": \"B001\",\n \"numero_documento\": \"#\",\n \"fecha_de_emision\": \"2024-11-04\",\n \"hora_de_emision\": \"10:11:11\",\n \"codigo_tipo_operacion\": \"0101\",\n \"codigo_tipo_documento\": \"03\",\n \"codigo_tipo_moneda\": \"PEN\",\n \"fecha_de_vencimiento\": \"2019-09-03\",\n \"datos_del_cliente_o_receptor\": {\n \"codigo_tipo_documento_identidad\": \"6\",\n \"numero_documento\": \"10414711225\",\n \"apellidos_y_nombres_o_razon_social\": \"EMPRESA XYZ S.A.\",\n \"codigo_pais\": \"PE\",\n \"ubigeo\": \"150101\",\n \"direccion\": \"Av. 2 de Mayo\",\n \"correo_electronico\": \"demo@gmail.com\",\n \"telefono\": \"427-1148\"\n },\n \"totales\": {\n \"total_exportacion\": 0,\n \"total_operaciones_gravadas\": 100,\n \"total_operaciones_inafectas\": 0,\n \"total_operaciones_exoneradas\": 0,\n \"total_operaciones_gratuitas\": 0,\n \"total_igv\": 18,\n \"total_impuestos\": 18,\n \"total_valor\": 100,\n \"total_venta\": 118\n },\n \"items\": [\n {\n \"codigo_interno\": \"P0121\",\n \"descripcion\": \"Inca Kola 250 ml\",\n \"codigo_producto_sunat\": \"51121703\",\n \"unidad_de_medida\": \"NIU\",\n \"cantidad\": 2,\n \"valor_unitario\": 50,\n \"codigo_tipo_precio\": \"01\",\n \"precio_unitario\": 59,\n \"codigo_tipo_afectacion_igv\": \"10\",\n \"total_base_igv\": 100,\n \"porcentaje_igv\": 18,\n \"total_igv\": 18,\n \"total_impuestos\": 18,\n \"total_valor_item\": 100,\n \"total_item\": 118\n }\n ]\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear