{
  "info": {
    "_postman_id": "8600681a-2581-4d8f-adb4-4de4254e58ce",
    "name": "FactusEasy",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "_exporter_id": "32753319"
  },
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Register",
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"name\": \"Diego Jimenez\",\r\n  \"email\": \"diego@example.com\",\r\n  \"password\": \"12345678\",\r\n  \"password_confirmation\": \"12345678\"\r\n}\r\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{URL_FACTUS}}/register",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "register"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Login",
          "event": [
            {
              "listen": "test",
              "script": {
                "exec": [
                  "if (pm.response.code === 200) {\r",
                  "    let json = pm.response.json();\r",
                  "    pm.environment.set(\"TOKEN_LOGIN_FACTUS\", json.data);\r",
                  "}"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "noauth"
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"email\": \"diego@example.com\",\r\n  \"password\":\"12345678\"\r\n}\r\n",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{URL_FACTUS}}/login",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "login"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get User Info",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{token}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"email\": \"andres96jimenez@gmail.com\",\r\n  \"password\":\"123456\"\r\n}\r\n"
            },
            "url": {
              "raw": "{{URL_FACTUS}}/user",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "user"
              ]
            }
          },
          "response": []
        }
      ],
      "description": "En este apartado se encuentras las funcionalidades de la gestion de la autenticación del usuario"
    },
    {
      "name": "Company",
      "item": [
        {
          "name": "Create",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n    \"ruc\":\"0707012604001\",\r\n    \"name\":\"GRAMSA SA\",\r\n    \"business_name\":\"GRAMSA SA\",\r\n    \"address\":\"test\",\r\n    \"phone\":\"0992294342\",\r\n    \"accounting_required\":\"YES\",\r\n    \"special_taxpayer\":\"NO\",\r\n    \"major_taxpayer\":\"NO\",\r\n    \"large_taxpayer\":\"NO\",\r\n    \"email\": \"andresjimenez@gmail.com\"\r\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{URL_FACTUS}}/companie/register",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "companie",
                "register"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Upate",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "PUT",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n    \"ruc\":\"0791844433001\",\r\n    \"name\":\"Frupex\",\r\n    \"business_name\":\"FRUPEX SAS\",\r\n    \"address\":\"SITIO EL RECREO, VIA SANTA ROSA MACHALA, EL ORO, ECUADOR\",\r\n    \"phone\":\"0992294342\",\r\n    \"accounting_required\":\"YES\",\r\n    \"special_taxpayer\":\"NO\",\r\n    \"large_taxpayer\":\"NO\",\r\n    \"major_taxpayer\":\"NO\",\r\n    \"email\": \"andresjimenez@gmail.com\"\r\n\r\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{URL_FACTUS}}/companie/update/0791844433001",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "companie",
                "update",
                "0791844433001"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Upload Certificate",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "certify",
                  "type": "file",
                  "src": "/C:/Users/PERSONAL/Documents/trabajo/FIRMA FRUPEX.p12"
                },
                {
                  "key": "password",
                  "value": "1234Frupex",
                  "type": "text"
                },
                {
                  "key": "ruc",
                  "value": "0791844433001",
                  "type": "text"
                }
              ]
            },
            "url": {
              "raw": "{{URL_FACTUS}}/companie/certificate",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "companie",
                "certificate"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Upload Logo",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "formdata",
              "formdata": [
                {
                  "key": "ruc",
                  "value": "0707012605001",
                  "type": "text"
                },
                {
                  "key": "logo",
                  "type": "file",
                  "src": "/C:/Users/diego/Pictures/Saved Pictures/logo.jpeg"
                }
              ]
            },
            "url": {
              "raw": "{{URL_FACTUS}}/companie/upload/logo",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "companie",
                "upload",
                "logo"
              ]
            }
          },
          "response": []
        },
        {
          "name": "List Companies the user",
          "protocolProfileBehavior": {
            "disableBodyPruning": true
          },
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"email\": \"andres96jimenez@gmail.com\",\r\n  \"password\":\"123456\"\r\n}\r\n"
            },
            "url": {
              "raw": "{{URL_FACTUS}}/companie/list",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "companie",
                "list"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Documents",
      "item": [
        {
          "name": "Store Document Invoice",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "pm.environment.set('idempotency_key', pm.variables.replaceIn('{{$guid}}'));"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{idempotency_key}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"ruc\":\"0791844433001\",\r\n  \"tipo\": \"01\",\r\n  \"id_externo\": \"sale-60\",\r\n  \"factura\": {\r\n    \"fecha\": \"18/05/2026\",\r\n    \"establecimiento\": \"001\",\r\n    \"puntoEmision\": \"001\",\r\n    \"secuencial\": \"000000150\",\r\n    \"descuento\": 0,\r\n    \"propina\":0,\r\n    \"total\": 115,\r\n    \"cliente\": {\r\n      \"nombre\": \"Diego Jimenez\",\r\n      \"tipoIdentificacion\": \"05\",\r\n      \"documento\": \"0912345678\",\r\n      \"telefono\": \"0999999999\",\r\n      \"correo\": \"andres96jimenez@gmail.com\",\r\n      \"direccion\": \"Av. Siempre Viva\"\r\n    }\r\n  },\r\n  \"detalles\": [\r\n    {\r\n      \"codigoPrincipal\": \"P-001\",\r\n      \"descripcion\": \"Producto A\",\r\n      \"cantidad\": 2,\r\n      \"precioUnitario\": 50.00,\r\n      \"descuento\": 0,\r\n      \"precioTotalSinImpuesto\": 100.00,\r\n      \"detallesAdicionales\": [\r\n        { \"nombre\": \"Marca\", \"valor\": \"Chevrolet\" },\r\n        { \"nombre\": \"Modelo\", \"valor\": \"2012\" },\r\n        { \"nombre\": \"Chasis\", \"valor\": \"8LDETA03V20003289\" }\r\n      ],\r\n      \"impuestos\": [\r\n        { \"codigo\": \"2\", \"codigoPorcentaje\": \"4\", \"tarifa\": 15, \"baseImponible\": 100.00, \"valor\": 15.00 }\r\n      ]\r\n    }\r\n  ],\r\n  \"pagos\": [\r\n    { \"formaPago\": \"01\", \"total\": 115.00, \"plazo\": 0, \"unidadTiempo\": \"dias\" }\r\n  ],\r\n  \"notificaciones\": {\r\n    \"email\": \"andres96jimenez@gmail.com\",\r\n    \"webhook_url\": \"https://miapp.com/webhooks/sri\"\r\n  }\r\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{URL_FACTUS}}/document/register",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "register"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Store Document Note Credit",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "pm.environment.set('idempotency_key', pm.variables.replaceIn('{{$guid}}'));"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"ruc\": \"0791844433001\",\r\n  \"tipo\": \"04\",\r\n  \"id_externo\": \"NC-2026-25\",\r\n  \"nota\": {\r\n    \"tipo\":\"DEVOLUCION\",\r\n    \"fecha\": \"11/05/2026\",\r\n    \"establecimiento\": \"001\",\r\n    \"puntoEmision\": \"001\",\r\n    \"secuencial\": \"000000060\",\r\n    \"motivo\": \"DEVOLUCION\",\r\n    \"cliente\": {\r\n      \"nombre\": \"DIEGO JIMENEZ\",\r\n      \"tipoIdentificacion\": \"05\",\r\n      \"documento\": \"0707012605\",\r\n      \"correo\": \"andres96jimenez@gmail.com\",\r\n      \"direccion\": \"Av. Principal #123\"\r\n    },\r\n    \"docModificado\": {\r\n      \"tipo\": \"01\",\r\n      \"numero\": \"001-001-000000120\",\r\n      \"fechaEmision\": \"09/05/2026\",\r\n      \"claveAutorizacion\":\"0905202601079184443300110010010000001209822411719\"\r\n    },\r\n    \"total\": 115.00\r\n  },\r\n  \"detalles\": [\r\n    {\r\n      \"codigoPrincipal\": \"P-001\",\r\n      \"descripcion\": \"Producto A\",\r\n      \"cantidad\": 2,\r\n      \"precioUnitario\": 50.00,\r\n      \"descuento\": 0,\r\n      \"precioTotalSinImpuesto\": 100.00,\r\n      \"detallesAdicionales\": [\r\n        { \"nombre\": \"Marca\", \"valor\": \"Chevrolet\" },\r\n        { \"nombre\": \"Modelo\", \"valor\": \"2012\" },\r\n        { \"nombre\": \"Chasis\", \"valor\": \"8LDETA03V20003289\" }\r\n       ],\r\n      \"impuestos\": [\r\n        { \r\n          \"codigo\": \"2\", \r\n          \"codigoPorcentaje\": \"4\", \r\n          \"tarifa\": 15, \r\n          \"baseImponible\": 100.00, \r\n          \"valor\": 15.00 \r\n        }\r\n      ]\r\n    }\r\n  ],\r\n  \"notificaciones\": {\r\n    \"email\": \"andres96jimenez@gmail.com\",\r\n    \"webhook_url\": \"https://miapp.com/webhooks/credit-notes\"\r\n  }\r\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{URL_FACTUS}}/document/register",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "register"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Store Document Retention",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "pm.environment.set('idempotency_key', pm.variables.replaceIn('{{$guid}}'));"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"ruc\": \"0791844433001\",\r\n  \"tipo\": \"07\",\r\n  \"id_externo\": \"RT-18\",\r\n  \"retencion\": {\r\n    \"fecha\": \"07/05/2026\",\r\n    \"establecimiento\": \"001\",\r\n    \"puntoEmision\": \"001\",\r\n    \"secuencial\": \"000000030\",\r\n    \"periodoFiscal\": \"05/2026\",\r\n    \"sujetoRetenido\": {\r\n      \"tipoIdentificacion\": \"04\",\r\n      \"documento\": \"1791234567001\",\r\n      \"nombre\": \"PROVEEDOR DE SERVICIOS S.A.\"\r\n    },\r\n    \"total\": 30.00\r\n  },\r\n  \"detalles\": [\r\n    {\r\n      \"codigo\": 2,\r\n      \"codigoRetencion\": 1,\r\n      \"baseImponible\": 100.00,\r\n      \"porcentajeRetener\": 30.0,\r\n      \"valorRetenido\": 30.00,\r\n      \"codDocSustento\": \"01\",\r\n      \"numDocSustento\": \"001-001-000000113\",\r\n      \"fechaEmisionSustento\": \"01/01/2026\"\r\n    }\r\n  ],\r\n  \"notificaciones\": {\r\n    \"email\": \"andres96jimenez@gmail.com\",\r\n    \"webhook_url\": \"https://miapp.com/webhooks/sri\"\r\n  }\r\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{URL_FACTUS}}/document/register",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "register"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get Status Document",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{URL_FACTUS}}/document/status?ruc=0791844433001",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "status"
              ],
              "query": [
                {
                  "key": "ruc",
                  "value": "0791844433001"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Download Ride",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "url": {
              "raw": "{{URL_FACTUS}}/document/1803202601079184443300110010010000123394396778714/ride?ruc=0791844433001",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "1803202601079184443300110010010000123394396778714",
                "ride"
              ],
              "query": [
                {
                  "key": "ruc",
                  "value": "0791844433001"
                }
              ]
            }
          },
          "response": []
        },
        {
          "name": "Store Invoice Lote",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "pm.environment.set('idempotency_key', pm.variables.replaceIn('{{$guid}}'));"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"ruc\": \"0791844433001\",\r\n  \"tipo\": \"01\",\r\n  \"documentos\": [\r\n    {\r\n      \"id_externo\": \"BATCH-FAC-005\",\r\n      \"factura\": {\r\n        \"fecha\": \"08/05/2026\",\r\n        \"establecimiento\": \"001\",\r\n        \"puntoEmision\": \"001\",\r\n        \"secuencial\": \"000000140\",\r\n        \"descuento\": 0,\r\n        \"propina\": 0,\r\n        \"total\": 115.00,\r\n        \"cliente\": {\r\n          \"nombre\": \"Cliente Demo 1\",\r\n          \"tipoIdentificacion\": \"05\",\r\n          \"documento\": \"0912345678\",\r\n          \"correo\": \"cliente1@demo.com\",\r\n          \"direccion\": \"Av. Demo 123\"\r\n        }\r\n      },\r\n      \"detalles\": [\r\n        {\r\n          \"codigoPrincipal\": \"P001\",\r\n          \"codigoAuxiliar\": \"A001\",\r\n          \"descripcion\": \"Servicio demo\",\r\n          \"cantidad\": 1,\r\n          \"precioUnitario\": 100,\r\n          \"descuento\": 0,\r\n          \"precioTotalSinImpuesto\": 100,\r\n          \"impuestos\": [\r\n            {\r\n              \"codigo\": \"2\",\r\n              \"codigoPorcentaje\": \"4\",\r\n              \"tarifa\": 15,\r\n              \"baseImponible\": 100,\r\n              \"valor\": 15\r\n            }\r\n          ]\r\n        }\r\n      ],\r\n      \"pagos\": [\r\n        {\r\n          \"formaPago\": \"01\",\r\n          \"total\": 115,\r\n          \"plazo\": 0,\r\n          \"unidadTiempo\": \"dias\"\r\n        }\r\n      ],\r\n      \"notificaciones\": {\r\n        \"email\": \"andres96jimenez@gmail.com\",\r\n        \"webhook_url\": \"https://webhook.site/tu-endpoint\"\r\n      }\r\n    },\r\n    {\r\n      \"id_externo\": \"BATCH-FAC-016\",\r\n      \"factura\": {\r\n        \"fecha\": \"08/05/2026\",\r\n        \"establecimiento\": \"001\",\r\n        \"puntoEmision\": \"001\",\r\n        \"secuencial\": \"000000141\",\r\n        \"descuento\": 0,\r\n        \"propina\": 0,\r\n        \"total\": 57.50,\r\n        \"cliente\": {\r\n          \"nombre\": \"Cliente Demo 2\",\r\n          \"tipoIdentificacion\": \"05\",\r\n          \"documento\": \"0912345679\",\r\n          \"correo\": \"cliente2@demo.com\",\r\n          \"direccion\": \"Av. Demo 456\"\r\n        }\r\n      },\r\n      \"detalles\": [\r\n        {\r\n          \"codigoPrincipal\": \"P002\",\r\n          \"codigoAuxiliar\": \"A002\",\r\n          \"descripcion\": \"Producto demo\",\r\n          \"cantidad\": 1,\r\n          \"precioUnitario\": 50,\r\n          \"descuento\": 0,\r\n          \"precioTotalSinImpuesto\": 50,\r\n          \"impuestos\": [\r\n            {\r\n              \"codigo\": \"2\",\r\n              \"codigoPorcentaje\": \"4\",\r\n              \"tarifa\": 15,\r\n              \"baseImponible\": 50,\r\n              \"valor\": 7.5\r\n            }\r\n          ]\r\n        }\r\n      ],\r\n      \"pagos\": [\r\n        {\r\n          \"formaPago\": \"19\",\r\n          \"total\": 57.5,\r\n          \"plazo\": 0,\r\n          \"unidadTiempo\": \"dias\"\r\n        }\r\n      ],\r\n      \"notificaciones\": {\r\n        \"email\": \"andres96jimenez@gmail.com\",\r\n        \"webhook_url\": \"https://webhook.site/tu-endpoint\"\r\n      }\r\n    }\r\n  ]\r\n}"
            },
            "url": {
              "raw": "{{URL_FACTUS}}/document/batch/register",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "batch",
                "register"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Store Note Credit Lote",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "pm.environment.set('idempotency_key', pm.variables.replaceIn('{{$guid}}'));"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"ruc\": \"0791844433001\",\r\n  \"tipo\": \"04\",\r\n  \"documentos\": [\r\n    {\r\n      \"id_externo\": \"BATCH-NC-014\",\r\n      \"nota\": {\r\n        \"fecha\": \"08/05/2026\",\r\n        \"establecimiento\": \"001\",\r\n        \"puntoEmision\": \"001\",\r\n        \"secuencial\": \"000000207\",\r\n        \"tipo\": \"DEVOLUCION\",\r\n        \"motivo\": \"Descuento comercial aplicado\",\r\n        \"total\": 23,\r\n        \"cliente\": {\r\n          \"tipoIdentificacion\": \"05\",\r\n          \"documento\": \"0912345678\",\r\n          \"nombre\": \"Cliente Demo 1\"\r\n        },\r\n        \"docModificado\": {\r\n          \"tipo\": \"01\",\r\n          \"numero\": \"001-001-000000123\",\r\n          \"fechaEmision\": \"07/05/2026\",\r\n          \"claveAutorizacion\": \"0705202601079184443300110010010000001238657830613\"\r\n        }\r\n      },\r\n      \"detalles\": [\r\n        {\r\n          \"codigoPrincipal\": \"P001\",\r\n          \"codigoAuxiliar\": \"A001\",\r\n          \"descripcion\": \"Ajuste por descuento\",\r\n          \"cantidad\": 1,\r\n          \"precioUnitario\": 20,\r\n          \"descuento\": 0,\r\n          \"precioTotalSinImpuesto\": 20,\r\n          \"impuestos\": [\r\n            {\r\n              \"codigo\": \"2\",\r\n              \"codigoPorcentaje\": \"4\",\r\n              \"tarifa\": 15,\r\n              \"baseImponible\": 20,\r\n              \"valor\": 3\r\n            }\r\n          ]\r\n        }\r\n      ],\r\n      \"notificaciones\": {\r\n        \"email\": \"andres96jimenez@gmail.com\",\r\n        \"webhook_url\": \"https://webhook.site/tu-endpoint\"\r\n      }\r\n    },\r\n    {\r\n      \"id_externo\": \"BATCH-NC-015\",\r\n      \"nota\": {\r\n        \"fecha\": \"08/05/2026\",\r\n        \"establecimiento\": \"001\",\r\n        \"puntoEmision\": \"001\",\r\n        \"secuencial\": \"000000208\",\r\n        \"tipo\": \"ANULACION_PARCIAL\",\r\n        \"motivo\": \"Correccion de valor\",\r\n        \"total\": 11.5,\r\n        \"cliente\": {\r\n          \"tipoIdentificacion\": \"05\",\r\n          \"documento\": \"0912345679\",\r\n          \"nombre\": \"Cliente Demo 2\"\r\n        },\r\n        \"docModificado\": {\r\n          \"tipo\": \"01\",\r\n          \"numero\": \"001-001-000000124\",\r\n          \"fechaEmision\": \"07/05/2026\",\r\n          \"claveAutorizacion\": \"0705202601079184443300110010010000001249390608217\"\r\n        }\r\n      },\r\n      \"detalles\": [\r\n        {\r\n          \"codigoPrincipal\": \"P002\",\r\n          \"descripcion\": \"Correccion de precio\",\r\n          \"cantidad\": 1,\r\n          \"precioUnitario\": 10,\r\n          \"descuento\": 0,\r\n          \"precioTotalSinImpuesto\": 10,\r\n          \"impuestos\": [\r\n            {\r\n              \"codigo\": \"2\",\r\n              \"codigoPorcentaje\": \"4\",\r\n              \"tarifa\": 15,\r\n              \"baseImponible\": 10,\r\n              \"valor\": 1.5\r\n            }\r\n          ]\r\n        }\r\n      ],\r\n      \"notificaciones\": {\r\n        \"email\": \"andres96jimenez@gmail.com\",\r\n        \"webhook_url\": \"https://webhook.site/tu-endpoint\"\r\n      }\r\n    }\r\n  ]\r\n}"
            },
            "url": {
              "raw": "{{URL_FACTUS}}/document/batch/register",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "batch",
                "register"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Store Retention Lote",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "pm.environment.set('idempotency_key', pm.variables.replaceIn('{{$guid}}'));"
                ],
                "type": "text/javascript",
                "packages": {},
                "requests": {}
              }
            }
          ],
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n  \"ruc\": \"0791844433001\",\r\n  \"tipo\": \"07\",\r\n  \"documentos\": [\r\n    {\r\n      \"id_externo\": \"BATCH-RET-015\",\r\n      \"retencion\": {\r\n        \"fecha\": \"08/05/2026\",\r\n        \"establecimiento\": \"001\",\r\n        \"puntoEmision\": \"001\",\r\n        \"secuencial\": \"000000312\",\r\n        \"periodoFiscal\": \"05/2026\",\r\n        \"sujetoRetenido\": {\r\n          \"tipoIdentificacion\": \"04\",\r\n          \"documento\": \"0791844433001\",\r\n          \"nombre\": \"Proveedor Demo 1\"\r\n        },\r\n        \"total\": 30\r\n      },\r\n      \"detalles\": [\r\n        {\r\n          \"codigo\": 2,\r\n          \"codigoRetencion\": 1,\r\n          \"baseImponible\": 100,\r\n          \"porcentajeRetener\": 30,\r\n          \"valorRetenido\": 30,\r\n          \"codDocSustento\": \"01\",\r\n          \"numDocSustento\": \"001001000000123\",\r\n          \"fechaEmisionSustento\": \"07/05/2026\"\r\n        }\r\n      ],\r\n      \"notificaciones\": {\r\n        \"email\": \"andres96jimenez@gmail.com\",\r\n        \"webhook_url\": \"https://webhook.site/tu-endpoint\"\r\n      }\r\n    },\r\n    {\r\n      \"id_externo\": \"BATCH-RET-016\",\r\n      \"retencion\": {\r\n        \"fecha\": \"08/05/2026\",\r\n        \"establecimiento\": \"001\",\r\n        \"puntoEmision\": \"001\",\r\n        \"secuencial\": \"000000313\",\r\n        \"periodoFiscal\": \"05/2026\",\r\n        \"sujetoRetenido\": {\r\n          \"tipoIdentificacion\": \"04\",\r\n          \"documento\": \"0791844433001\",\r\n          \"nombre\": \"Proveedor Demo 2\"\r\n        },\r\n        \"total\": 140\r\n      },\r\n      \"detalles\": [\r\n        {\r\n          \"codigo\": 2,\r\n          \"codigoRetencion\": 2,\r\n          \"baseImponible\": 200,\r\n          \"porcentajeRetener\": 70,\r\n          \"valorRetenido\": 140,\r\n          \"codDocSustento\": \"01\",\r\n          \"numDocSustento\": \"001001000000124\",\r\n          \"fechaEmisionSustento\": \"07/05/2026\"\r\n        }\r\n      ],\r\n      \"notificaciones\": {\r\n        \"email\": \"andres96jimenez@gmail.com\",\r\n        \"webhook_url\": \"https://webhook.site/tu-endpoint\"\r\n      }\r\n    }\r\n  ]\r\n}"
            },
            "url": {
              "raw": "{{URL_FACTUS}}/document/batch/register",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "batch",
                "register"
              ]
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Annulment",
      "item": [
        {
          "name": "Store Request",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json",
                "type": "text"
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\r\n    \"reason\": \"OTHERS\",\r\n   \"justification\": \"Documento emitido con error\"\r\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{URL_FACTUS}}/document/1704202601079184443300110010010000001057143534211/annulment",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "1704202601079184443300110010010000001057143534211",
                "annulment"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get Status Annulment",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{URL_FACTUS}}/document/1704202601079184443300110010010000001057143534211/annulment",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "1704202601079184443300110010010000001057143534211",
                "annulment"
              ]
            }
          },
          "response": []
        },
        {
          "name": "Get the list the annulment",
          "request": {
            "auth": {
              "type": "bearer",
              "bearer": [
                {
                  "key": "token",
                  "value": "{{TOKEN_LOGIN_FACTUS}}",
                  "type": "string"
                }
              ]
            },
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{URL_FACTUS}}/document/1304202601079184443300110010010000001006432007811/annulment/list",
              "host": [
                "{{URL_FACTUS}}"
              ],
              "path": [
                "document",
                "1304202601079184443300110010010000001006432007811",
                "annulment",
                "list"
              ]
            }
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "token",
      "value": "",
      "type": "default"
    },
    {
      "key": "TOKEN_LOGIN_FACTUS",
      "value": "",
      "type": "default"
    }
  ]
}