{
    "openapi": "3.1.2",
    "info": {
        "title": "Bridge Fiscal - API (Espa\u00f1ol)",
        "version": "1.0.0",
        "description": "<!-- Hash: 6486f78bf8412240c6e10e7c4027919d: 8e171bda1389bf6a88fbb32757b77fff | e3fe6d057f44794ab6098de4ada86d80: 4f6a086bc020299bc1605cd6b8ac1cde -->\n\nAPI REST de **Bridge Fiscal** para la emisi\u00f3n de NFC-e (modelo 65) y NF-e (modelo 55).\n\n## Autenticaci\u00f3n\nTodas las rutas requieren un token en el encabezado `Authorization: Bearer <token>`.\nEl token lo proporciona el soporte de Bridge Fiscal y pertenece a su sistema (sistema de origen).\nGu\u00e1rdelo en su **servidor**; nunca lo coloque en aplicaciones instaladas en dispositivos.\nPruebe el token con `GET \/v1\/me`.\n\n## Formato de las respuestas\nToda respuesta tiene el mismo sobre:\n\n```json\n{\n  \"data\": {},\n  \"amount\": 1,\n  \"error\": null,\n  \"message\": \"Emitente encontrado.\",\n  \"now\": \"2026-11-10T14:30:00-03:00\"\n}\n```\n\n- `error` es `null` en caso de \u00e9xito. En caso de error, es un c\u00f3digo fijo para tratar en su sistema (tabla abajo).\n- `message` es un texto para mostrar al usuario, en el idioma solicitado (vea **Idioma de las respuestas**).\n- Las listas est\u00e1n paginadas (`?page=2&per_page=50`, m\u00e1ximo 100) y traen tambi\u00e9n `links` y `meta`.\n\n## C\u00f3digos HTTP y errores\n| HTTP | `error` | Cu\u00e1ndo |\n|---|---|---|\n| 200 | `null` | Consulta, modificaci\u00f3n o eliminaci\u00f3n realizada |\n| 201 | `null` | Registro creado |\n| 401 | `unauthenticated` | Token ausente, no v\u00e1lido o revocado |\n| 403 | `forbidden` | Sistema desactivado o sin acceso |\n| 404 | `not_found` | Registro o direcci\u00f3n no encontrado |\n| 409 | `conflict` | Registro duplicado |\n| 422 | `wrong_data` | Campo no v\u00e1lido (vea `errors` con todos los campos) |\n| 422 | `business_rule` | Regla de negocio no cumplida |\n| 422 | `invalid_reference` | Registro relacionado inexistente |\n| 429 | `too_many_requests` | L\u00edmite de solicitudes por minuto excedido |\n| 500 | `internal_server_error` \/ `database_error` | Error inesperado |\n| 503 | `service_unavailable` | Mantenimiento o indisponibilidad temporal |\n\nTodo error devuelve `reference`: informe ese c\u00f3digo al soporte para localizar lo ocurrido.\n\n## Idioma de las respuestas\nLos mensajes (`message`, `errors` y reglas de negocio) siguen el encabezado est\u00e1ndar **`Accept-Language`**: `pt-BR` (predeterminado), `en` o `es`.\nSin el encabezado, o con un idioma no soportado, la respuesta viene en portugu\u00e9s. El idioma usado vuelve en el encabezado `Content-Language`.\nNo cambian con el idioma: el c\u00f3digo `error`, las claves del JSON y los datos registrados (ej.: `displayname` de las tablas de apoyo).\nEn ingl\u00e9s y espa\u00f1ol, los campos con error se identifican por su clave JSON (ej.: `legalname`, `items.0.ncm`).\n\n```http\nAccept-Language: es\n```\n\n## Fechas\nUse **ISO 8601 con zona horaria**, ej.: `2026-11-10T14:30:00-03:00`. Las fechas sin zona horaria se leen en el horario de Brasilia.\nLas respuestas siempre traen la zona horaria (`-03:00`).\n\n## Emisi\u00f3n\n1. Registre el emisor (`POST \/issuers`) y la configuraci\u00f3n de emisi\u00f3n (`POST \/issuerconfigs`).\n2. Env\u00ede el documento (`POST \/fiscaldocuments`) con una `empotencykey` \u00fanica por venta.\n3. La emisi\u00f3n es as\u00edncrona: consulte `GET \/fiscaldocuments\/{id}` hasta el estado final (Autorizada, Rechazada...).\n4. Reenviar la misma `empotencykey` no duplica la nota: la API devuelve el documento ya recibido.\n5. Con la nota autorizada y `clientemail` completado, el consumidor recibe el DANFE (NF-e) o el DANFE NFC-e (NFC-e), en PDF, y el XML por correo electr\u00f3nico.\n6. El destinatario en la NFC-e es opcional. Con **CPF** basta `clientdocument` (y `clientname`, si lo desea). Con **CNPJ** la direcci\u00f3n es obligatoria (`clientstreet`, `clientneighborhood`, `clientmunicipalitycode`, `clientmunicipality`, `clientstate`): sin ella la SEFAZ rechaza la nota con el mensaje enga\u00f1oso \"CNPJ del destinatario no registrado en la Receita Federal\", y la API rechaza el env\u00edo antes de reservar el n\u00famero. El CNPJ del destinatario tambi\u00e9n debe existir en la base de la Receita Federal y ser distinto del emisor. Con CPF la direcci\u00f3n solo va en la nota cuando est\u00e1 completa; una direcci\u00f3n parcial se ignora. La direcci\u00f3n se verifica en la entrada: `clientstate` es una UF v\u00e1lida (may\u00fascula), `clientpostalcode` tiene 8 d\u00edgitos, `clientphone` de 6 a 14 d\u00edgitos, y calle, barrio y municipio tienen al menos 2 caracteres.\n\n## Documento rechazado\nEl rechazo (estado `REJECTED`) es **final** para ese documento: la SEFAZ rechaz\u00f3 los datos y el Bridge Fiscal no lo intenta de nuevo. El webhook `REJECTED` (o `GET \/fiscaldocuments\/{id}`) trae `errorcode`, `errormessage` (el mensaje de la SEFAZ) y `errorhint`, la orientaci\u00f3n del Bridge Fiscal sobre qu\u00e9 corregir.\n1. Corrija la causa (datos del documento, registro del emisor, certificado, CSC...).\n2. Reenv\u00ede el documento (`POST \/fiscaldocuments`) con una `empotencykey` **nueva** y `reissueof` = el `id` del documento rechazado (el v\u00ednculo aparece como `reissuedfromid`): reenviar la misma clave solo devuelve el documento rechazado. Cada documento rechazado solo puede reemitirse una vez.\n3. No reenv\u00ede en bucle sin corregir: cada rechazo consume un n\u00famero de la serie. El Bridge Fiscal inutiliza solo el n\u00famero de los documentos rechazados (no llame a `\/fiscalinvalidations` para ellos).\n4. `ERROR` no es un rechazo: el Bridge Fiscal sigue intentando solo, solo espere. Excepciones, que necesitan a una persona y generan una alerta al comerciante (`errorcode`): `CERTIFICATE` (el certificado del emisor est\u00e1 vencido o es inv\u00e1lido: al enviar un certificado v\u00e1lido la nota se reprocesa sola), `STALLED` (la SEFAZ no dio una respuesta concluyente hasta el fin del plazo de transmisi\u00f3n: verificar la clave en el portal de la SEFAZ) y `SCHEMA` o `BUILD` (datos de la nota rechazados antes del env\u00edo: corr\u00edjalos y reemita).\nLa venta ya fue pagada: no bloquee el POS por la emisi\u00f3n. Reemita autom\u00e1ticamente ante errores de datos y avise al comerciante cuando la causa sea registro, certificado o CSC.\n\n## Contingencia offline (NFC-e)\nCuando la SEFAZ no responde, el Bridge Fiscal emite la NFC-e en contingencia offline (`emissiontype` 9) por s\u00ed solo, sin nada que hacer de su lado (Configuraciones: contingencia autom\u00e1tica activada por defecto).\n- Entra en contingencia la NFC-e que llega con la SEFAZ del estado ca\u00edda o que sigue sin respuesta algunos minutos despu\u00e9s de recibida (5 por defecto). La fecha de emisi\u00f3n (`dhEmi`) es la hora en que la venta lleg\u00f3 al Bridge Fiscal.\n- La nota queda `CONTINGENCY` (webhook `CONTINGENCY`), ya con `accesskey` y `qrcode` v\u00e1lidos, y se transmite sola cuando la SEFAZ vuelve (plazo legal de 24 h). Luego sigue el flujo normal: `AUTHORIZED` (webhook y correo al consumidor) o `REJECTED`.\n- Si el intento normal lleg\u00f3 a enviarse sin respuesta, la venta recibe un n\u00famero nuevo en contingencia y el intento antiguo pasa a ser un registro aparte con `replacedbyid` = `id` de su nota. No se cobra ni genera webhook: si la SEFAZ lo autoriz\u00f3, el Bridge Fiscal lo cancela por sustituci\u00f3n; si no, el n\u00famero se inutiliza. Esos registros no aparecen en el listado (`GET \/fiscaldocuments`), solo en la consulta por `id`; use siempre el documento del `id` que recibi\u00f3.\n- Si la SEFAZ rechaza una nota ya emitida en contingencia, queda `ERROR` con `errorcode` `CONTINGENCY_<c\u00f3digo>` (con alerta al comerciante): el consumidor ya tiene el DANFE NFC-e, por eso el n\u00famero no se inutiliza ni la nota puede reemitirse con otro n\u00famero. Corrija el dato y retransmita con `POST \/fiscaldocuments\/{id}\/retransmit` (campos `client...` del destinatario y\/o `items` con `sequence` y `ncm`): la nota mantiene n\u00famero, serie y clave.\n## NF-e (modelo 55)\nUse una configuraci\u00f3n de modelo 55. Adem\u00e1s de las reglas de la NFC-e:\n- **Destinatario obligatorio**: `clientdocument`, `clientname`, `clientieindicator` (1 contribuyente, con `clientstateregistration`; 2 exento; 9 no contribuyente) y la direcci\u00f3n completa (`clientstreet`, `clientneighborhood`, `clientmunicipalitycode`, `clientmunicipality`, `clientstate`).\n- **Destino**: `destinationindicator` 1 cuando el destinatario es del mismo estado que el emisor, 2 cuando es de otro. El CFOP de todos los \u00edtems sigue al destino y a la direcci\u00f3n: salida 5xxx\/6xxx, entrada 1xxx\/2xxx.\n- **Finalidades aceptadas**: 1 (normal) y 4 (devoluci\u00f3n). La devoluci\u00f3n trae la clave de acceso de la nota devuelta en `references` y un \u00fanico pago `paymenttype` 90 con `paid` 0.\n- **Valores**: el total es la suma de los subtotales de los \u00edtems + otros gastos + flete + seguro + IPI + ICMS ST + FCP ST + IPI devuelto; `otherexpensestotal`, `freighttotal`, `insurancetotal`, `ipitotal`, `icmssttotal`, `fcpsttotal` e `ipireturntotal` son la suma de los campos de los \u00edtems. Transporte opcional: transportista, veh\u00edculo y vol\u00famenes.\n- **Tributos opcionales por \u00edtem** (complete solo lo que exige la operaci\u00f3n; el Bridge Fiscal no calcula tributos, solo los verifica y los env\u00eda): ICMS ST (`icmsstbasemode`, `icmsstmva`, `icmsstreduction`, `icmsstbase`, `icmsstrate`, `icmsstvalue`) y FCP ST (`fcpst*`) para CST 10, 30, 70 y CSOSN 201, 202, 203; ICMS retenido anteriormente (`icmsstret*`, `fcpstret*`) para CST 60 y CSOSN 500; cr\u00e9dito del Simples Nacional (`sncreditrate`, `sncreditvalue`) para CSOSN 101 y 201; desoneraci\u00f3n (`icmsdesonvalue` e `icmsdesonreason`); IPI devuelto (`ipireturnrate`, `ipireturnvalue`); y el **DIFAL** (`difalbase`, `difalrate`, `difalinterrate` 4, 7 o 12, `difalvalue`...), obligatorio en la venta interestatal a consumidor final no contribuyente.\n- **ICMS aceptado**: CSOSN 101, 102, 103, 201, 202, 203, 300, 400, 500, 900 (Simples Nacional) o CST 00, 10, 20, 30, 40, 41, 50, 60, 70, 90 (r\u00e9gimen normal).\n- **A\u00fan no aceptados**: exportaci\u00f3n, venta a plazo (duplicatas), finalidades complementaria y ajuste.\n\n## IBS\/CBS (reforma tributaria)\nEl grupo de IBS\/CBS de la nota es opcional y **desactivado por defecto**: la configuraci\u00f3n de emisi\u00f3n (`POST\/PATCH \/issuerconfigs`) tiene `ibscbsmode` 0 (no lo env\u00eda; la API rechaza los datos de IBS\/CBS para no descartarlos en silencio), 1 (lo env\u00eda cuando el \u00edtem lo informa) o 2 (obligatorio en todos los \u00edtems). Active primero en homologaci\u00f3n y confirme con su contador qui\u00e9n est\u00e1 obligado en cada fase (el Simples Nacional y el MEI est\u00e1n exentos en 2026).\n- Por \u00edtem: `ibscbscst` (000 gravado, 200 al\u00edcuota reducida, 410 exento\/inmune\/no gravado), `ibscbsclass` (6 d\u00edgitos, comenzando por el CST), `ibscbsbase`, y por esfera la al\u00edcuota y el valor: `ibsstaterate`\/`ibsstatevalue`, `ibsmunicipalrate`\/`ibsmunicipalvalue`, `cbsrate`\/`cbsvalue`. En el CST 200 env\u00ede tambi\u00e9n la reducci\u00f3n y la al\u00edcuota efectiva (`ibsstatereduction`, `ibsstateeffectiverate`, `ibsmunicipalreduction`, `ibsmunicipaleffectiverate`, `cbsreduction`, `cbseffectiverate`). El CST 410 no lleva valores.\n- El Bridge Fiscal no calcula IBS\/CBS: verifica que valor = base \u00d7 al\u00edcuota (1 centavo de tolerancia) y lo env\u00eda. En 2026 el IBS\/CBS no entra en el total de la nota. En las notas autorizadas en producci\u00f3n (SP, abril\/2026, r\u00e9gimen normal) la base fue el valor del \u00edtem tras el descuento menos PIS, COFINS e ICMS, con IBS estatal 0,1% y CBS 0,9% en 2026; confirme la regla vigente con su contador.\n- Otros CST (diferimiento, monof\u00e1sico, cr\u00e9dito presumido, Impuesto Selectivo) todav\u00eda no se aceptan.\n\n## Cancelaci\u00f3n y carta de correcci\u00f3n\nLas solicitudes (`POST \/fiscaldocuments\/{id}\/cancel` y `\/correction`) son as\u00edncronas: el evento nace Pendiente y se transmite a la SEFAZ enseguida. S\u00edgalo con `GET \/fiscaldocuments\/{id}\/events` (estado Registrado, Rechazado o Error, con el protocolo y el motivo). Con la cancelaci\u00f3n registrada el documento pasa a Cancelado, el DANFE (NF-e) o DANFE NFC-e (NFC-e) se genera de nuevo con la marca de cancelada y se env\u00eda el webhook `CANCELLED`. La carta de correcci\u00f3n (solo NF-e, hasta 20 por documento) no cambia el estado del documento: se env\u00eda el webhook `CORRECTED` y el destinatario recibe por correo electr\u00f3nico el PDF de la carta (DAEVENTO) y el XML del evento. Una cancelaci\u00f3n o carta rechazada (por ejemplo, fuera del plazo de la SEFAZ) env\u00eda los webhooks `CANCEL_REJECTED` y `CORRECTION_REJECTED`, y la cancelaci\u00f3n puede solicitarse de nuevo.\n\n## Webhooks\nEn lugar de consultar el estado, registre un webhook en el panel (Integra\u00e7\u00f5es): para el sistema, un cliente o una tienda. Vale el m\u00e1s espec\u00edfico (tienda, luego cliente, luego sistema), y solo se env\u00edan los eventos elegidos (`AUTHORIZED`, `REJECTED`, `DENIED`, `CANCELLED`, `CONTINGENCY`, `ERROR` y los resultados de cancelaci\u00f3n y carta de correcci\u00f3n: `CANCEL_REJECTED`, `CORRECTION_REJECTED` y `CORRECTED`).\n- La URL debe ser HTTPS y apuntar a una direcci\u00f3n p\u00fablica de internet (se rechazan las direcciones internas o de red local), y no se siguen redirecciones. El webhook es opcional: sin \u00e9l, consulte `GET \/fiscaldocuments\/{id}`.\n- `POST` a su URL HTTPS con el JSON `{\"event\", \"delivery\", \"sent_at\", \"document\"}`. `document` tiene el mismo formato que `GET \/fiscaldocuments\/{id}` y `delivery` identifica la entrega. En los eventos de cancelaci\u00f3n y carta de correcci\u00f3n (`CANCELLED`, `CANCEL_REJECTED`, `CORRECTED`, `CORRECTION_REJECTED`) el JSON trae tambi\u00e9n `fiscalevent`, con el formato de `GET \/fiscaldocuments\/{id}\/events`; trate las entregas repetidas por `document.id`, `event` y `fiscalevent.id`.\n- Encabezados: `X-BridgeFiscal-Event`, `X-BridgeFiscal-Timestamp` (Unix) y `X-BridgeFiscal-Signature: sha256=<hex>`, el HMAC-SHA256 de `<timestamp>.<cuerpo>` con el secreto mostrado en el registro. Verifique la firma y rechace timestamps de m\u00e1s de 5 minutos.\n- Responda con HTTP 2xx en hasta 10 segundos. Sin 2xx, se reintenta tras 1, 5, 15 y 60 minutos. Trate las entregas repetidas por `document.id` y `event`.\n\n<!-- Hash: a1acd94f9aa84f55e775a45efebc9cc2: 6db3a0d37641ce96c2ccd86fd5c24af0 | bac953e88f6d79514b0b6fc42eb6f3b7: 43a6da8ce435f585b4e067c2b153bc99 -->\n"
    },
    "servers": [
        {
            "url": "https:\/\/api.bridgefiscal.com.br\/v1"
        }
    ],
    "security": [
        {
            "http": []
        }
    ],
    "paths": {
        "\/me": {
            "get": {
                "operationId": "me",
                "description": "Devuelve el sistema de origen due\u00f1o del token. \u00daselo para probar la integraci\u00f3n.",
                "summary": "Sistema de origen autenticado",
                "tags": [
                    "Autenticaci\u00f3n"
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/plans": {
            "get": {
                "operationId": "plans.index",
                "description": "Versiones de plan con mensualidad, franquicia de notas y valor por nota excedente. Por defecto, solo las versiones contratables hoy (current=1); current=0 lista todas las versiones. Son los precios que paga su sistema: no los muestre a sus clientes. Requiere un token con el permiso billing:read.",
                "summary": "Listar planes",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "storesizeid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "environment",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "current",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/plans\/{id}": {
            "get": {
                "operationId": "plans.show",
                "description": "Requiere un token con el permiso billing:read.",
                "summary": "Consultar un plan",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/subscriptions": {
            "get": {
                "operationId": "subscriptions.index",
                "description": "Suscripciones de los emisores pagadas por su sistema. running=1 mantiene solo las vigentes hoy o programadas. Requiere un token con el permiso billing:read.",
                "summary": "Listar suscripciones",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "issuerid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "document",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 14
                        }
                    },
                    {
                        "name": "running",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "environment",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "subscriptions.store",
                "description": "Comienza hoy (hora local del emisor) o en una fecha de inicio futura. El ciclo es mensual desde la fecha de inicio y prepago: la primera mensualidad va de inmediato a una factura de su cuenta de cobro. El precio, la franquicia y el valor por nota excedente quedan fijados durante la vida de la suscripci\u00f3n. Requiere un token con el permiso billing:write.",
                "summary": "Suscribir un emisor a un plan",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/FiscalSubscriptionRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "409": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "array",
                                    "items": {}
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/subscriptions\/{id}": {
            "get": {
                "operationId": "subscriptions.show",
                "description": "Requiere un token con el permiso billing:read.",
                "summary": "Consultar una suscripci\u00f3n",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/subscriptions\/{id}\/usage": {
            "get": {
                "operationId": "subscriptions.usage",
                "description": "Per\u00edodo actual por defecto (o periodid): notas de la franquicia, cobrables y excedentes, proyecci\u00f3n hasta el fin del per\u00edodo, notas no cobradas por estado (solo informe), inutilizaciones, eventos y, cuando otro plan costar\u00eda menos para el volumen proyectado, el plan sugerido. \u00daselo para decidir mejoras con sus clientes. Requiere un token con el permiso billing:read.",
                "summary": "Consumo de una suscripci\u00f3n",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "periodid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "subscriptionid": {
                                                    "type": "integer"
                                                },
                                                "issuerid": {
                                                    "type": "integer"
                                                },
                                                "document": {
                                                    "type": "string"
                                                },
                                                "branchid": {
                                                    "type": "integer"
                                                },
                                                "fiscalplanid": {
                                                    "type": "integer"
                                                },
                                                "plan": {
                                                    "type": "string"
                                                },
                                                "period": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "id": {
                                                            "type": "string"
                                                        },
                                                        "periodstart": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "periodend": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "closed": {
                                                            "type": "boolean"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "periodstart",
                                                        "periodend",
                                                        "closed"
                                                    ]
                                                },
                                                "monthlyfee": {
                                                    "type": "number"
                                                },
                                                "overagefee": {
                                                    "type": "number"
                                                },
                                                "includeddocuments": {
                                                    "type": "integer"
                                                },
                                                "billabledocuments": {
                                                    "type": "integer"
                                                },
                                                "overagedocuments": {
                                                    "type": "integer"
                                                },
                                                "remainingdocuments": {},
                                                "usedpercent": {
                                                    "type": "number"
                                                },
                                                "overageamount": {
                                                    "type": "number"
                                                },
                                                "projecteddocuments": {
                                                    "type": "integer"
                                                },
                                                "projectedoverage": {},
                                                "notbilled": {
                                                    "type": "string"
                                                },
                                                "invalidations": {
                                                    "type": "integer"
                                                },
                                                "events": {
                                                    "type": "integer"
                                                },
                                                "suggestedplan": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "fiscalplanid": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "displayname": {
                                                            "type": "string"
                                                        },
                                                        "monthlyfee": {
                                                            "type": "number"
                                                        },
                                                        "includeddocuments": {
                                                            "type": "string"
                                                        },
                                                        "overagefee": {
                                                            "type": "number"
                                                        },
                                                        "estimatedcost": {
                                                            "type": [
                                                                "number",
                                                                "string"
                                                            ]
                                                        },
                                                        "currentcost": {
                                                            "type": [
                                                                "number",
                                                                "string"
                                                            ]
                                                        },
                                                        "saving": {
                                                            "type": [
                                                                "number",
                                                                "string"
                                                            ]
                                                        }
                                                    },
                                                    "required": [
                                                        "fiscalplanid",
                                                        "name",
                                                        "displayname",
                                                        "monthlyfee",
                                                        "includeddocuments",
                                                        "overagefee",
                                                        "estimatedcost",
                                                        "currentcost",
                                                        "saving"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "subscriptionid",
                                                "issuerid",
                                                "document",
                                                "branchid",
                                                "fiscalplanid",
                                                "plan",
                                                "period",
                                                "monthlyfee",
                                                "overagefee",
                                                "includeddocuments",
                                                "billabledocuments",
                                                "overagedocuments",
                                                "remainingdocuments",
                                                "usedpercent",
                                                "overageamount",
                                                "projecteddocuments",
                                                "projectedoverage",
                                                "notbilled",
                                                "invalidations",
                                                "events",
                                                "suggestedplan"
                                            ]
                                        },
                                        "amount": {
                                            "type": "integer",
                                            "enum": [
                                                0,
                                                1
                                            ]
                                        },
                                        "error": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Consumo encontrado."
                                        },
                                        "now": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "amount",
                                        "error",
                                        "message",
                                        "now"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/usage": {
            "get": {
                "operationId": "usage.index",
                "description": "Consumo actual de cada suscripci\u00f3n vigente del CNPJ (una por tienda\/sucursal del CNPJ). Requiere un token con el permiso billing:read.",
                "summary": "Consumo por CNPJ",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "document",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "maxLength": 14
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "string"
                                            }
                                        },
                                        "amount": {
                                            "type": "integer"
                                        },
                                        "error": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Consumo encontrado."
                                        },
                                        "now": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "amount",
                                        "error",
                                        "message",
                                        "now"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/invoices": {
            "get": {
                "operationId": "invoices.index",
                "description": "Facturas de su cuenta de cobro. status: OPEN, OVERDUE, PAID o CANCELLED. duedatefrom\/duedateto filtran la fecha de vencimiento. Requiere un token con el permiso billing:read.",
                "summary": "Listar facturas",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "OPEN",
                                "OVERDUE",
                                "PAID",
                                "CANCELLED"
                            ]
                        }
                    },
                    {
                        "name": "duedatefrom",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "duedateto",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "environment",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/invoices\/{id}": {
            "get": {
                "operationId": "invoices.show",
                "description": "Con sus \u00edtems: CNPJ, motivo (PLAN_FEE, OVERAGE, PRORATA, ADJUSTMENT, DISCOUNT), per\u00edodo, cantidad e importes. Requiere un token con el permiso billing:read.",
                "summary": "Consultar una factura",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/subscriptions\/{id}\/changeplan": {
            "post": {
                "operationId": "subscriptions.changeplan",
                "description": "Cambio a un plan de mensualidad mayor: vale desde ma\u00f1ana; la diferencia proporcional de los d\u00edas restantes del ciclo entra en la pr\u00f3xima factura (\u00edtem PRORATA). Cambio a un plan menor: vale desde el pr\u00f3ximo ciclo, sin cr\u00e9dito. Se crea una nueva suscripci\u00f3n con el mismo d\u00eda de cobro; la actual recibe la fecha de t\u00e9rmino. Requiere un token con el permiso billing:write.",
                "summary": "Cambiar el plan",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/ChangePlanRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "subscription": {
                                                    "type": "array",
                                                    "items": {}
                                                },
                                                "effectivedate": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "prorata": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "days": {
                                                            "type": "integer"
                                                        },
                                                        "cycledays": {
                                                            "type": "integer"
                                                        },
                                                        "dailyamount": {
                                                            "type": "number"
                                                        },
                                                        "amount": {
                                                            "type": "number"
                                                        },
                                                        "duedate": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "days",
                                                        "cycledays",
                                                        "dailyamount",
                                                        "amount",
                                                        "duedate"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "subscription",
                                                "effectivedate",
                                                "prorata"
                                            ]
                                        },
                                        "amount": {
                                            "type": "integer",
                                            "enum": [
                                                0,
                                                1
                                            ]
                                        },
                                        "error": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "enum": [
                                                "Plano alterado a partir de amanh\u00e3. A diferen\u00e7a proporcional vai na pr\u00f3xima fatura.",
                                                "Troca de plano agendada para o pr\u00f3ximo ciclo."
                                            ]
                                        },
                                        "now": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "amount",
                                        "error",
                                        "message",
                                        "now"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/subscriptions\/{id}\/cancel": {
            "post": {
                "operationId": "subscriptions.cancel",
                "description": "La suscripci\u00f3n termina el \u00faltimo d\u00eda del ciclo actual, ya pagado (sin reembolso). En una suscripci\u00f3n programada (cambio a un plan menor que a\u00fan no comenz\u00f3), deshace el cambio: la suscripci\u00f3n actual contin\u00faa. Requiere un token con el permiso billing:write.",
                "summary": "Cancelar una suscripci\u00f3n",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/subscriptions\/{id}\/resume": {
            "post": {
                "operationId": "subscriptions.resume",
                "description": "Deshace la cancelaci\u00f3n mientras el ciclo pagado no termin\u00f3: la suscripci\u00f3n contin\u00faa con el mismo plan, precio y d\u00eda de cobro. \u00daselo cuando su cliente contrate el servicio de nuevo antes del fin del ciclo. Requiere un token con el permiso billing:write.",
                "summary": "Reanudar una suscripci\u00f3n cancelada",
                "tags": [
                    "Facturaci\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/issuerconfigs": {
            "get": {
                "operationId": "issuerconfigs.index",
                "description": "Cada configuraci\u00f3n es un PDV: CNPJ x modelo x serie x ambiente, con numeraci\u00f3n propia.",
                "summary": "Listar configuraciones de emisi\u00f3n",
                "tags": [
                    "Configuraciones de emisi\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "issuerid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "machineid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "model",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "55",
                                "65"
                            ]
                        }
                    },
                    {
                        "name": "environment",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "issuerconfigs.store",
                "description": "model, series, environment y sequence (pr\u00f3ximo n\u00famero, 1 por defecto) no pueden cambiarse despu\u00e9s.\nPara continuar la numeraci\u00f3n de otro emisor, env\u00ede en sequence el pr\u00f3ximo n\u00famero a usar.\nEl emisor debe tener un certificado digital v\u00e1lido (enviado en issuers\/{id}\/certificate) antes de este paso.\nEl CSC pertenece al CNPJ y al ambiente: una configuraci\u00f3n NFC-e (65) nueva hereda el CSC ya registrado en otra configuraci\u00f3n del mismo CNPJ, ambiente y sistema de origen (solo en la creaci\u00f3n: un CSC eliminado despu\u00e9s sigue eliminado). Para cambiarlo, use issuerconfigs\/{id}\/csc.",
                "summary": "Registrar una configuraci\u00f3n de emisi\u00f3n",
                "tags": [
                    "Configuraciones de emisi\u00f3n"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/IssuerConfigRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/issuerconfigs\/{id}": {
            "get": {
                "operationId": "issuerconfigs.show",
                "summary": "Consultar una configuraci\u00f3n de emisi\u00f3n",
                "tags": [
                    "Configuraciones de emisi\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "issuerconfigs.update",
                "description": "Modificaci\u00f3n parcial. Cambiar el issuerid solo se acepta para un emisor con el mismo CNPJ (ej.: cambio del terminal POS).",
                "summary": "Modificar una configuraci\u00f3n de emisi\u00f3n",
                "tags": [
                    "Configuraciones de emisi\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/IssuerConfigRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "issuerconfigs.destroy",
                "description": "Eliminaci\u00f3n l\u00f3gica (active = false). La numeraci\u00f3n se conserva y no puede reutilizarse.",
                "summary": "Eliminar una configuraci\u00f3n de emisi\u00f3n",
                "tags": [
                    "Configuraciones de emisi\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/issuerconfigs\/{id}\/csc": {
            "post": {
                "operationId": "issuerconfigs.csc.store",
                "description": "Registra el CSC (identificador y token) de una configuraci\u00f3n de NFC-e (modelo 65). El token nunca se devuelve: la configuraci\u00f3n muestra solo cscconfigured = true.\nEn configuraciones de homologaci\u00f3n, use el CSC de homologaci\u00f3n.",
                "summary": "Registrar el CSC",
                "tags": [
                    "Configuraciones de emisi\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/IssuerConfigCscRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "issuerconfigs.csc.destroy",
                "description": "Elimina el CSC de la configuraci\u00f3n. La emisi\u00f3n de NFC-e queda suspendida hasta que se registre un nuevo CSC.",
                "summary": "Eliminar el CSC",
                "tags": [
                    "Configuraciones de emisi\u00f3n"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/fiscalerrorlogs": {
            "post": {
                "operationId": "fiscalerrorlogs.store",
                "description": "Permite a la aplicaci\u00f3n cliente registrar un error ocurrido en el dispositivo (origen \"app\").\nDevuelve el c\u00f3digo de referencia para informar al soporte. Funciona incluso con la API en mantenimiento.",
                "summary": "Registrar un error de la aplicaci\u00f3n",
                "tags": [
                    "Registro de errores"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/FiscalErrorLogRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "reference": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "reference"
                                            ]
                                        },
                                        "amount": {
                                            "type": "integer",
                                            "enum": [
                                                0,
                                                1
                                            ]
                                        },
                                        "error": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Erro registrado."
                                        },
                                        "now": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "amount",
                                        "error",
                                        "message",
                                        "now"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/fiscaldocuments": {
            "get": {
                "operationId": "fiscaldocuments.index",
                "description": "Lista paginada (los m\u00e1s recientes primero). Filtre fechas en ISO 8601, ej.: 2026-11-10T00:00:00-03:00.",
                "summary": "Listar documentos fiscales",
                "tags": [
                    "Documentos fiscales"
                ],
                "parameters": [
                    {
                        "name": "issuerid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "issuerconfigid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "fiscalstatusid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "cartid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "empotencykey",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "accesskey",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "minLength": 44,
                            "maxLength": 44
                        }
                    },
                    {
                        "name": "documentnumber",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "format": "date-time"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "fiscaldocuments.store",
                "description": "Recibe el documento completo (encabezado, art\u00edculos, pagos y referencias) y lo pone en la cola de emisi\u00f3n con estado Pendiente. La emisi\u00f3n es as\u00edncrona: consulte el documento para seguir el estado.\nIdempotencia: reenviar la misma empotencykey devuelve el documento ya recibido (200), nunca un duplicado.",
                "summary": "Enviar un documento fiscal para emisi\u00f3n",
                "tags": [
                    "Documentos fiscales"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/FiscalDocumentRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/fiscaldocuments\/{id}": {
            "get": {
                "operationId": "fiscaldocuments.show",
                "description": "Devuelve el documento con estado, art\u00edculos, pagos, documentos referenciados y eventos.",
                "summary": "Consultar un documento fiscal",
                "tags": [
                    "Documentos fiscales"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/fiscaldocuments\/{id}\/retransmit": {
            "post": {
                "operationId": "fiscaldocuments.retransmit",
                "description": "Solo NFC-e emitida en contingencia offline y rechazada por la SEFAZ (estado ERROR, errorcode CONTINGENCY_<c\u00f3digo>). El consumidor ya tiene el DANFE NFC-e, por eso la nota mantiene n\u00famero, serie y clave. Env\u00ede los campos del destinatario (client...) y\/o items con sequence y ncm a corregir; la nota se rehace y se transmite de nuevo.",
                "summary": "Corregir y retransmitir una NFC-e emitida en contingencia",
                "tags": [
                    "Documentos fiscales"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/RetransmitRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/fiscaldocuments\/{id}\/events": {
            "get": {
                "operationId": "fiscalevents.index",
                "summary": "Listar los eventos de un documento",
                "tags": [
                    "Eventos fiscales"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/fiscaldocuments\/{id}\/cancel": {
            "post": {
                "operationId": "fiscalevents.cancel",
                "description": "Solo documentos autorizados, dentro del plazo de cancelaci\u00f3n contado desde la autorizaci\u00f3n (por defecto 30 minutos para NFC-e y 24 horas para NF-e). Env\u00ede substituteaccesskey (otra NFC-e del mismo emisor) para la cancelaci\u00f3n por sustituci\u00f3n (solo NFC-e).",
                "summary": "Cancelar un documento fiscal",
                "tags": [
                    "Eventos fiscales"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/CancelRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/fiscaldocuments\/{id}\/correction": {
            "post": {
                "operationId": "fiscalevents.correction",
                "description": "Solo NF-e (modelo 55) autorizada. Hasta 20 correcciones por documento; la \u00faltima sustituye a las anteriores.",
                "summary": "Enviar una carta de correcci\u00f3n (CC-e)",
                "tags": [
                    "Eventos fiscales"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/CorrectionLetterRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/issuerconfigs\/{id}\/invalidations": {
            "get": {
                "operationId": "invalidations.index",
                "summary": "Listar las inutilizaciones de una configuraci\u00f3n de emisi\u00f3n",
                "tags": [
                    "Inutilizaciones"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "invalidations.store",
                "description": "Inutiliza un rango de n\u00fameros que no se usar\u00e1 (ej.: rechazados u omitidos). La transmisi\u00f3n a la SEFAZ es as\u00edncrona.",
                "summary": "Solicitar la inutilizaci\u00f3n de un rango de n\u00fameros",
                "tags": [
                    "Inutilizaciones"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/FiscalInvalidationRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/invalidations\/{id}": {
            "get": {
                "operationId": "invalidations.show",
                "summary": "Consultar una inutilizaci\u00f3n",
                "tags": [
                    "Inutilizaciones"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/issuers": {
            "get": {
                "operationId": "issuers.index",
                "description": "Lista paginada de los emisores del sistema de origen autenticado. Filtros: document, branchid, branchnickname (contiene), branchnumber, active.",
                "summary": "Listar emisores",
                "tags": [
                    "Emisores"
                ],
                "parameters": [
                    {
                        "name": "document",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 14
                        }
                    },
                    {
                        "name": "branchid",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "branchnickname",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 60
                        }
                    },
                    {
                        "name": "branchnumber",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "active",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "issuers.store",
                "description": "El CNPJ (document) no puede cambiarse despu\u00e9s. El certificado digital se env\u00eda por un endpoint propio. Opcionalmente, env\u00ede branchnickname (apodo de la tienda, p. ej. el nombre del condominio) y\/o branchnumber (n\u00famero secuencial de la tienda): ambos aparecen y se pueden buscar en el panel.",
                "summary": "Registrar un emisor",
                "tags": [
                    "Emisores"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/IssuerRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        },
        "\/issuers\/{id}": {
            "get": {
                "operationId": "issuers.show",
                "summary": "Consultar un emisor",
                "tags": [
                    "Emisores"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "issuers.update",
                "description": "Modificaci\u00f3n parcial: env\u00ede solo los campos modificados.",
                "summary": "Modificar un emisor",
                "tags": [
                    "Emisores"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/IssuerRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "issuers.destroy",
                "description": "Eliminaci\u00f3n l\u00f3gica (active = false). El historial fiscal se conserva.",
                "summary": "Eliminar un emisor",
                "tags": [
                    "Emisores"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/issuers\/{id}\/certificate": {
            "get": {
                "operationId": "issuers.certificate.show",
                "description": "Datos p\u00fablicos del certificado A1 en uso (titular, CNPJ, validez). El archivo y la contrase\u00f1a nunca se devuelven.",
                "summary": "Consultar el certificado del emisor",
                "tags": [
                    "Emisores"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "companyname": {
                                                    "type": "string"
                                                },
                                                "document": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "validfrom": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "validuntil": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "expired": {
                                                    "type": "boolean"
                                                },
                                                "daysleft": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "companyname",
                                                "document",
                                                "validfrom",
                                                "validuntil",
                                                "expired",
                                                "daysleft"
                                            ]
                                        },
                                        "amount": {
                                            "type": "integer",
                                            "enum": [
                                                0,
                                                1
                                            ]
                                        },
                                        "error": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Certificado encontrado."
                                        },
                                        "now": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "amount",
                                        "error",
                                        "message",
                                        "now"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "issuers.certificate.store",
                "description": "Env\u00ede el certificado A1 (.pfx o .p12) y la contrase\u00f1a como multipart\/form-data. Sustituye el certificado actual.\nEl certificado debe ser un e-CNPJ de la misma empresa (misma ra\u00edz de CNPJ) y no puede estar vencido.",
                "summary": "Enviar el certificado del emisor",
                "tags": [
                    "Emisores"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart\/form-data": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/IssuerCertificateRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "companyname": {
                                                    "type": "string"
                                                },
                                                "document": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "validfrom": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "validuntil": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "expired": {
                                                    "type": "boolean"
                                                },
                                                "daysleft": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "companyname",
                                                "document",
                                                "validfrom",
                                                "validuntil",
                                                "expired",
                                                "daysleft"
                                            ]
                                        },
                                        "amount": {
                                            "type": "integer",
                                            "enum": [
                                                0,
                                                1
                                            ]
                                        },
                                        "error": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Certificado cadastrado."
                                        },
                                        "now": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "amount",
                                        "error",
                                        "message",
                                        "now"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            },
            "delete": {
                "operationId": "issuers.certificate.destroy",
                "description": "Elimina el certificado y la contrase\u00f1a. El emisor no emite m\u00e1s documentos hasta que se env\u00ede un nuevo certificado.",
                "summary": "Eliminar el certificado del emisor",
                "tags": [
                    "Emisores"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "null"
                                        },
                                        "amount": {
                                            "type": "integer",
                                            "enum": [
                                                0,
                                                1
                                            ]
                                        },
                                        "error": {
                                            "type": "null"
                                        },
                                        "message": {
                                            "type": "string",
                                            "const": "Certificado exclu\u00eddo."
                                        },
                                        "now": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "amount",
                                        "error",
                                        "message",
                                        "now"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/fiscalstatuses": {
            "get": {
                "operationId": "fiscalstatuses.index",
                "description": "Devuelve los registros activos. 'name' es el c\u00f3digo fijo para usar en la integraci\u00f3n; 'displayname' es el texto para mostrar al usuario (en portugu\u00e9s).",
                "summary": "Listar estados fiscales",
                "tags": [
                    "Tablas de apoyo"
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/fiscalstatuses\/{id}": {
            "get": {
                "operationId": "fiscalstatuses.show",
                "summary": "Consultar un estado fiscal",
                "tags": [
                    "Tablas de apoyo"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/sefazpaymenttypes": {
            "get": {
                "operationId": "sefazpaymenttypes.index",
                "description": "Tabla oficial de medios de pago de la SEFAZ (tPag). Env\u00ede 'code' en payments[].paymenttype. Los c\u00f3digos con acceptedbyapi = false quedan en la tabla solo para consulta, pero la API los rechaza: todo documento recibido corresponde a una venta pagada.",
                "summary": "Listar las formas de pago de la SEFAZ",
                "tags": [
                    "Tablas de apoyo"
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/sefazpaymenttypes\/{id}": {
            "get": {
                "operationId": "sefazpaymenttypes.show",
                "summary": "Consultar una forma de pago de la SEFAZ",
                "tags": [
                    "Tablas de apoyo"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/eventtypes": {
            "get": {
                "operationId": "eventtypes.index",
                "description": "Devuelve los registros activos. 'name' es el c\u00f3digo fijo para usar en la integraci\u00f3n; 'displayname' es el texto para mostrar al usuario (en portugu\u00e9s).",
                "summary": "Listar tipos de evento",
                "tags": [
                    "Tablas de apoyo"
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/eventtypes\/{id}": {
            "get": {
                "operationId": "eventtypes.show",
                "summary": "Consultar un tipo de evento",
                "tags": [
                    "Tablas de apoyo"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/eventstatuses": {
            "get": {
                "operationId": "eventstatuses.index",
                "description": "Devuelve los registros activos. 'name' es el c\u00f3digo fijo para usar en la integraci\u00f3n; 'displayname' es el texto para mostrar al usuario (en portugu\u00e9s).",
                "summary": "Listar estados de evento",
                "tags": [
                    "Tablas de apoyo"
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/eventstatuses\/{id}": {
            "get": {
                "operationId": "eventstatuses.show",
                "summary": "Consultar un estado de evento",
                "tags": [
                    "Tablas de apoyo"
                ],
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/storesizes": {
            "get": {
                "operationId": "storesizes.index",
                "description": "Clases de tama\u00f1o de tienda usadas por los planes: MINIMARKET, NEIGHBORHOOD, SUPERMARKET y WAREHOUSE. Requiere solo un token v\u00e1lido.",
                "summary": "Listar tama\u00f1os de tienda",
                "tags": [
                    "Tablas de apoyo"
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/users": {
            "get": {
                "operationId": "users.index",
                "description": "Lista paginada de los usuarios del panel sincronizados por el sistema autenticado, con los perfiles vigentes. Requiere un token con el permiso users:sync.",
                "summary": "Listar usuarios",
                "tags": [
                    "Usuarios del panel"
                ],
                "parameters": [
                    {
                        "name": "externalid",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 100
                        }
                    },
                    {
                        "name": "email",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "maxLength": 190
                        }
                    },
                    {
                        "name": "activated",
                        "in": "query",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            }
        },
        "\/users\/{externalid}": {
            "get": {
                "operationId": "users.show",
                "description": "B\u00fasqueda por el identificador del usuario en el sistema de origen (externalid). Requiere un token con el permiso users:sync.",
                "summary": "Consultar un usuario",
                "tags": [
                    "Usuarios del panel"
                ],
                "parameters": [
                    {
                        "name": "externalid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "`JsonResource`",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#\/components\/schemas\/JsonResource"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    }
                }
            },
            "put": {
                "operationId": "users.upsert",
                "description": "Registra o actualiza el usuario por su identificador en el sistema de origen (externalid). Nombre, acceso y contrase\u00f1a siguen mantenidos por su sistema y no pueden cambiarse en el panel. Requiere un token con el permiso users:sync.\n\n- `password`: SHA-512 (hexadecimal) de la contrase\u00f1a, nunca la contrase\u00f1a en s\u00ed. Om\u00edtalo para mantener la actual.\n- `activated: false` desactiva el usuario y revoca todos sus perfiles. Al reactivarlo, vuelve solo con el acceso: los perfiles deben enviarse de nuevo.\n- `roles`: cuando se env\u00eda (aunque est\u00e9 vac\u00edo), sustituye todos los perfiles del usuario. Cada perfil tiene un alcance: `SYSTEM_ADMIN` sin alcance (todo el sistema); `ADMIN`, `OPERATOR` o `VIEWER` con un cliente (`usersid`, todas sus tiendas) o una tienda (`issuerid`, un emisor de este sistema).\n- El acceso (correo o nombre de usuario) es \u00fanico entre los usuarios activos de todo Bridge Fiscal.",
                "summary": "Registrar o actualizar un usuario",
                "tags": [
                    "Usuarios del panel"
                ],
                "parameters": [
                    {
                        "name": "externalid",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application\/json": {
                            "schema": {
                                "$ref": "#\/components\/schemas\/UserSyncRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application\/json": {
                                "schema": {
                                    "type": "string"
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#\/components\/responses\/AuthenticationException"
                    },
                    "422": {
                        "$ref": "#\/components\/responses\/ValidationException"
                    }
                }
            }
        }
    },
    "components": {
        "securitySchemes": {
            "http": {
                "type": "http",
                "description": "Env\u00ede su token en el encabezado `Authorization` en todas las solicitudes a las rutas protegidas: `Authorization: Bearer <token>`. El token lo proporciona el soporte de Bridge Fiscal.",
                "scheme": "bearer"
            }
        },
        "schemas": {
            "CancelRequest": {
                "type": "object",
                "properties": {
                    "justification": {
                        "type": "string",
                        "minLength": 15,
                        "maxLength": 255
                    },
                    "substituteaccesskey": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[0-9]{44}$"
                    }
                },
                "required": [
                    "justification"
                ],
                "title": "CancelRequest"
            },
            "ChangePlanRequest": {
                "type": "object",
                "properties": {
                    "fiscalplanid": {
                        "type": "integer",
                        "minimum": 1
                    }
                },
                "required": [
                    "fiscalplanid"
                ],
                "title": "ChangePlanRequest"
            },
            "CorrectionLetterRequest": {
                "type": "object",
                "properties": {
                    "correction": {
                        "type": "string",
                        "minLength": 15,
                        "maxLength": 1000
                    }
                },
                "required": [
                    "correction"
                ],
                "title": "CorrectionLetterRequest"
            },
            "FiscalDocumentRequest": {
                "type": "object",
                "properties": {
                    "issuerconfigid": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "empotencykey": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "reissueof": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1
                    },
                    "usersid": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1
                    },
                    "cartid": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1
                    },
                    "nature": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "purpose": {
                        "type": "integer",
                        "enum": [
                            "1",
                            "2",
                            "3",
                            "4"
                        ]
                    },
                    "finalconsumer": {
                        "type": "boolean"
                    },
                    "presenceindicator": {
                        "type": "integer",
                        "enum": [
                            "0",
                            "1",
                            "2",
                            "3",
                            "4",
                            "5",
                            "9"
                        ]
                    },
                    "destinationindicator": {
                        "type": "integer",
                        "enum": [
                            "1",
                            "2",
                            "3"
                        ]
                    },
                    "intermediaryindicator": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "enum": [
                            "0",
                            "1",
                            null
                        ]
                    },
                    "intermediarydocument": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Z0-9]{12}[0-9]{2}$"
                    },
                    "intermediaryid": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "additionalinfo": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 5000
                    },
                    "clientidentified": {
                        "type": "boolean"
                    },
                    "clientdocument": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^([0-9]{11}|[A-Z0-9]{12}[0-9]{2})$"
                    },
                    "clientname": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "clientstateregistration": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 30
                    },
                    "clientieindicator": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "enum": [
                            "1",
                            "2",
                            "9",
                            null
                        ]
                    },
                    "clientemail": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "maxLength": 255
                    },
                    "clientphone": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^\\D*(\\d\\D*){6,14}$",
                        "maxLength": 14
                    },
                    "clientpostalcode": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^\\D*(\\d\\D*){8}$"
                    },
                    "clientstreet": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 2,
                        "maxLength": 60
                    },
                    "clientnumber": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "clientcomplement": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "clientneighborhood": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 2,
                        "maxLength": 60
                    },
                    "clientmunicipalitycode": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "clientmunicipality": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 2,
                        "maxLength": 60
                    },
                    "clientstate": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "AC",
                            "AL",
                            "AP",
                            "AM",
                            "BA",
                            "CE",
                            "DF",
                            "ES",
                            "GO",
                            "MA",
                            "MT",
                            "MS",
                            "MG",
                            "PA",
                            "PB",
                            "PR",
                            "PE",
                            "PI",
                            "RJ",
                            "RN",
                            "RS",
                            "RO",
                            "RR",
                            "SC",
                            "SP",
                            "SE",
                            "TO",
                            null
                        ]
                    },
                    "freightmode": {
                        "type": "integer",
                        "enum": [
                            "0",
                            "1",
                            "2",
                            "3",
                            "4",
                            "9"
                        ]
                    },
                    "carrierdocument": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^([0-9]{11}|[A-Z0-9]{12}[0-9]{2})$"
                    },
                    "carriername": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "carrierstateregistration": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 30
                    },
                    "carrieraddress": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "carriermunicipality": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "carrierstate": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 2,
                        "maxLength": 2
                    },
                    "vehicleplate": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 7
                    },
                    "vehiclestate": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 2,
                        "maxLength": 2
                    },
                    "volumequantity": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 0
                    },
                    "volumespecies": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "netweight": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "grossweight": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "productstotal": {
                        "type": "number"
                    },
                    "discounttotal": {
                        "type": "number"
                    },
                    "otherexpensestotal": {
                        "type": "number"
                    },
                    "freighttotal": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "insurancetotal": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "icmssttotal": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "ipitotal": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "fcpsttotal": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "ipireturntotal": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "total": {
                        "type": "number"
                    },
                    "changeamount": {
                        "type": "number"
                    },
                    "items": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "sequence": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 990
                                },
                                "branchproductid": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 1
                                },
                                "productid": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 1
                                },
                                "measureunitid": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 1
                                },
                                "internalcode": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 60
                                },
                                "ean": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 14
                                },
                                "description": {
                                    "type": "string",
                                    "maxLength": 120
                                },
                                "ncm": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 10
                                },
                                "origin": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 0,
                                    "maximum": 8
                                },
                                "cest": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "cfop": {
                                    "type": "string"
                                },
                                "taxbenefitcode": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 10
                                },
                                "unit": {
                                    "type": "string",
                                    "maxLength": 6
                                },
                                "quantity": {
                                    "type": "number"
                                },
                                "price": {
                                    "type": "number"
                                },
                                "finalprice": {
                                    "type": "number"
                                },
                                "discount": {
                                    "type": "number"
                                },
                                "subtotal": {
                                    "type": "number"
                                },
                                "freight": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "insurance": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "taxean": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 14
                                },
                                "taxunit": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 6
                                },
                                "taxquantity": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "taxprice": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "icmscst": {
                                    "type": "string",
                                    "minLength": 2,
                                    "maxLength": 3
                                },
                                "icmsbasemode": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 0,
                                    "maximum": 3
                                },
                                "piscst": {
                                    "type": "string",
                                    "minLength": 2,
                                    "maxLength": 2
                                },
                                "cofinscst": {
                                    "type": "string",
                                    "minLength": 2,
                                    "maxLength": 2
                                },
                                "ipicst": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "minLength": 2,
                                    "maxLength": 2
                                },
                                "ipiframework": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "minLength": 3,
                                    "maxLength": 3
                                },
                                "ipibase": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "ipirate": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "ipivalue": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "ibscbscst": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "minLength": 3,
                                    "maxLength": 3
                                },
                                "ibscbsclass": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "minLength": 6,
                                    "maxLength": 6
                                },
                                "icmsstbasemode": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 0,
                                    "maximum": 5
                                },
                                "icmsdesonreason": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "enum": [
                                        "1",
                                        "3",
                                        "4",
                                        "5",
                                        "6",
                                        "7",
                                        "8",
                                        "9",
                                        "10",
                                        "11",
                                        "12",
                                        "16",
                                        "90",
                                        "99",
                                        null
                                    ]
                                },
                                "ipireturnrate": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "ipireturnvalue": {
                                    "type": [
                                        "number",
                                        "null"
                                    ]
                                },
                                "otherexpenses": {
                                    "type": "number"
                                },
                                "icmsbase": {
                                    "type": "number"
                                },
                                "icmsvalue": {
                                    "type": "number"
                                },
                                "fcpvalue": {
                                    "type": "number"
                                },
                                "icmsstbase": {
                                    "type": "number"
                                },
                                "icmsstvalue": {
                                    "type": "number"
                                },
                                "icmsstretbase": {
                                    "type": "number"
                                },
                                "icmssubstitutevalue": {
                                    "type": "number"
                                },
                                "icmsstretvalue": {
                                    "type": "number"
                                },
                                "pisbase": {
                                    "type": "number"
                                },
                                "pisvalue": {
                                    "type": "number"
                                },
                                "cofinsbase": {
                                    "type": "number"
                                },
                                "cofinsvalue": {
                                    "type": "number"
                                },
                                "ibscbsbase": {
                                    "type": "number"
                                },
                                "ibsstatevalue": {
                                    "type": "number"
                                },
                                "ibsmunicipalvalue": {
                                    "type": "number"
                                },
                                "cbsvalue": {
                                    "type": "number"
                                },
                                "approximatetax": {
                                    "type": "number"
                                },
                                "fcpstbase": {
                                    "type": "number"
                                },
                                "fcpstvalue": {
                                    "type": "number"
                                },
                                "icmsdesonvalue": {
                                    "type": "number"
                                },
                                "fcpstretbase": {
                                    "type": "number"
                                },
                                "fcpstretvalue": {
                                    "type": "number"
                                },
                                "sncreditvalue": {
                                    "type": "number"
                                },
                                "difalbase": {
                                    "type": "number"
                                },
                                "difalfcpbase": {
                                    "type": "number"
                                },
                                "difalfcpvalue": {
                                    "type": "number"
                                },
                                "difalvalue": {
                                    "type": "number"
                                },
                                "icmsreduction": {
                                    "type": "number"
                                },
                                "icmsrate": {
                                    "type": "number"
                                },
                                "fcprate": {
                                    "type": "number"
                                },
                                "icmsstmva": {
                                    "type": "number"
                                },
                                "icmsstrate": {
                                    "type": "number"
                                },
                                "icmsstretrate": {
                                    "type": "number"
                                },
                                "pisrate": {
                                    "type": "number"
                                },
                                "cofinsrate": {
                                    "type": "number"
                                },
                                "ibsstaterate": {
                                    "type": "number"
                                },
                                "ibsmunicipalrate": {
                                    "type": "number"
                                },
                                "cbsrate": {
                                    "type": "number"
                                },
                                "ibsstatereduction": {
                                    "type": "number"
                                },
                                "ibsstateeffectiverate": {
                                    "type": "number"
                                },
                                "ibsmunicipalreduction": {
                                    "type": "number"
                                },
                                "ibsmunicipaleffectiverate": {
                                    "type": "number"
                                },
                                "cbsreduction": {
                                    "type": "number"
                                },
                                "cbseffectiverate": {
                                    "type": "number"
                                },
                                "icmsstreduction": {
                                    "type": "number"
                                },
                                "fcpstrate": {
                                    "type": "number"
                                },
                                "fcpstretrate": {
                                    "type": "number"
                                },
                                "sncreditrate": {
                                    "type": "number"
                                },
                                "difalfcprate": {
                                    "type": "number"
                                },
                                "difalrate": {
                                    "type": "number"
                                },
                                "difalinterrate": {
                                    "type": "number"
                                },
                                "difalpartition": {
                                    "type": "number"
                                }
                            },
                            "required": [
                                "sequence",
                                "description",
                                "cfop",
                                "unit",
                                "quantity",
                                "price",
                                "finalprice",
                                "subtotal",
                                "icmscst",
                                "piscst",
                                "cofinscst"
                            ]
                        },
                        "minItems": 1,
                        "maxItems": 990,
                        "uniqueItems": true
                    },
                    "payments": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "paymentid": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 1
                                },
                                "paymentcartid": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 1
                                },
                                "paymenttype": {
                                    "type": "string"
                                },
                                "paymentmethod": {
                                    "type": "string",
                                    "maxLength": 100
                                },
                                "description": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 60
                                },
                                "paid": {
                                    "type": "number"
                                },
                                "integrationtype": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "enum": [
                                        "1",
                                        "2",
                                        null
                                    ]
                                },
                                "acquirerdocument": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "pattern": "^[A-Z0-9]{12}[0-9]{2}$"
                                },
                                "transactiondata": {
                                    "type": [
                                        "array",
                                        "null"
                                    ],
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "transactioncode": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 255
                                },
                                "transactionid": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 50
                                },
                                "cardlastdigits": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "brand": {
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "maxLength": 50
                                },
                                "brandcode": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "paymenttype",
                                "paymentmethod",
                                "paid"
                            ]
                        },
                        "minItems": 1,
                        "maxItems": 100
                    },
                    "references": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string",
                            "pattern": "^[0-9]{44}$"
                        },
                        "maxItems": 500,
                        "uniqueItems": true
                    }
                },
                "required": [
                    "issuerconfigid",
                    "empotencykey",
                    "productstotal",
                    "total",
                    "items",
                    "payments"
                ],
                "title": "FiscalDocumentRequest"
            },
            "FiscalErrorLogRequest": {
                "type": "object",
                "properties": {
                    "level": {
                        "type": "string",
                        "enum": [
                            "warning",
                            "error",
                            "critical"
                        ]
                    },
                    "machineid": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1
                    },
                    "appname": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "appversion": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "errortype": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "errorcode": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 50
                    },
                    "message": {
                        "type": "string",
                        "maxLength": 60000
                    },
                    "usermessage": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 500
                    },
                    "trace": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60000
                    },
                    "context": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "items": {
                            "type": "string"
                        }
                    },
                    "occurred_at": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date-time"
                    }
                },
                "required": [
                    "message"
                ],
                "title": "FiscalErrorLogRequest"
            },
            "FiscalInvalidationRequest": {
                "type": "object",
                "properties": {
                    "startnumber": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 999999999
                    },
                    "endnumber": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 999999999
                    },
                    "justification": {
                        "type": "string",
                        "minLength": 15,
                        "maxLength": 255
                    }
                },
                "required": [
                    "startnumber",
                    "endnumber",
                    "justification"
                ],
                "title": "FiscalInvalidationRequest"
            },
            "FiscalSubscriptionRequest": {
                "type": "object",
                "properties": {
                    "issuerid": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "fiscalplanid": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "startdate": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "date"
                    }
                },
                "required": [
                    "issuerid",
                    "fiscalplanid"
                ],
                "title": "FiscalSubscriptionRequest"
            },
            "IssuerCertificateRequest": {
                "type": "object",
                "properties": {
                    "certificate": {
                        "type": "string",
                        "format": "binary",
                        "contentMediaType": "application\/octet-stream",
                        "description": "A1 certificate file (.pfx or .p12), up to 64 KB."
                    },
                    "password": {
                        "type": "string",
                        "description": "Certificate password.",
                        "maxLength": 255
                    }
                },
                "required": [
                    "certificate",
                    "password"
                ],
                "title": "IssuerCertificateRequest"
            },
            "IssuerConfigCscRequest": {
                "type": "object",
                "properties": {
                    "csccode": {
                        "type": "string",
                        "description": "CSC identifier (idToken) given by the SEFAZ portal, e.g. 1 or 000001.",
                        "pattern": "^[0-9]{1,6}$"
                    },
                    "csctoken": {
                        "type": "string",
                        "description": "CSC token (C\u00f3digo de Seguran\u00e7a do Contribuinte), 16 to 36 letters, digits and hyphens (some SEFAZ issue it as a hyphenated GUID, e.g. SP).",
                        "pattern": "^[A-Za-z0-9-]{16,36}$"
                    }
                },
                "required": [
                    "csccode",
                    "csctoken"
                ],
                "title": "IssuerConfigCscRequest"
            },
            "IssuerConfigRequest": {
                "type": "object",
                "properties": {
                    "issuerid": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "machineid": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1
                    },
                    "model": {
                        "type": "string",
                        "enum": [
                            "55",
                            "65"
                        ]
                    },
                    "series": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 999
                    },
                    "nature": {
                        "type": "string",
                        "maxLength": 100
                    },
                    "ibscbsmode": {
                        "type": "integer",
                        "description": "Tax reform IBS\/CBS group: 0 off, 1 sent when the items inform it, 2 required in every item.",
                        "enum": [
                            "0",
                            "1",
                            "2"
                        ]
                    },
                    "sequence": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 999999999
                    },
                    "environment": {
                        "type": "boolean"
                    },
                    "active": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "issuerid",
                    "model",
                    "series",
                    "nature",
                    "environment"
                ],
                "title": "IssuerConfigRequest"
            },
            "IssuerRequest": {
                "type": "object",
                "properties": {
                    "usersid": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1
                    },
                    "branchid": {
                        "type": "integer",
                        "minimum": 1
                    },
                    "branchnickname": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Optional quick identification of the store: a nickname (e.g. condominium) and\/or a sequential number.",
                        "maxLength": 60
                    },
                    "branchnumber": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1,
                        "maximum": 999999
                    },
                    "addressid": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1
                    },
                    "postalcodeid": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "minimum": 1
                    },
                    "document": {
                        "type": "string",
                        "pattern": "^[A-Z0-9]{12}[0-9]{2}$"
                    },
                    "legalname": {
                        "type": "string",
                        "maxLength": 200
                    },
                    "tradename": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 200
                    },
                    "stateregistration": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 30
                    },
                    "municipalregistration": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 30
                    },
                    "taxregime": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "enum": [
                            "1",
                            "2",
                            "3",
                            "4",
                            null
                        ]
                    },
                    "postalcode": {
                        "type": "string",
                        "maxLength": 50
                    },
                    "country": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "state": {
                        "type": "string",
                        "enum": [
                            "AC",
                            "AL",
                            "AP",
                            "AM",
                            "BA",
                            "CE",
                            "DF",
                            "ES",
                            "GO",
                            "MA",
                            "MT",
                            "MS",
                            "MG",
                            "PA",
                            "PB",
                            "PR",
                            "PE",
                            "PI",
                            "RJ",
                            "RN",
                            "RS",
                            "RO",
                            "RR",
                            "SC",
                            "SP",
                            "SE",
                            "TO"
                        ],
                        "minLength": 2,
                        "maxLength": 2
                    },
                    "timezone": {
                        "type": "string"
                    },
                    "municipality": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "municipalitycode": {
                        "type": "string"
                    },
                    "district": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 255
                    },
                    "neighborhood": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "street": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "number": {
                        "type": "string",
                        "maxLength": 50
                    },
                    "complement": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "phone1": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "phone2": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 100
                    },
                    "latitude": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "minimum": -90,
                        "maximum": 90
                    },
                    "longitude": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "minimum": -180,
                        "maximum": 180
                    },
                    "active": {
                        "type": "boolean"
                    }
                },
                "required": [
                    "branchid",
                    "document",
                    "legalname",
                    "postalcode",
                    "country",
                    "state",
                    "municipality",
                    "municipalitycode",
                    "neighborhood",
                    "street",
                    "number"
                ],
                "title": "IssuerRequest"
            },
            "JsonResource": {
                "type": "string",
                "title": "JsonResource"
            },
            "RetransmitRequest": {
                "type": "object",
                "properties": {
                    "clientdocument": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^([0-9]{11}|[A-Z0-9]{12}[0-9]{2})$"
                    },
                    "clientname": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "clientieindicator": {
                        "type": [
                            "integer",
                            "null"
                        ],
                        "enum": [
                            "1",
                            "2",
                            "9",
                            null
                        ]
                    },
                    "clientstateregistration": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 30
                    },
                    "clientpostalcode": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^\\D*(\\d\\D*){8}$"
                    },
                    "clientstreet": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 2,
                        "maxLength": 60
                    },
                    "clientnumber": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "clientcomplement": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "maxLength": 60
                    },
                    "clientneighborhood": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 2,
                        "maxLength": 60
                    },
                    "clientmunicipalitycode": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "clientmunicipality": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "minLength": 2,
                        "maxLength": 60
                    },
                    "clientstate": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "AC",
                            "AL",
                            "AP",
                            "AM",
                            "BA",
                            "CE",
                            "DF",
                            "ES",
                            "GO",
                            "MA",
                            "MT",
                            "MS",
                            "MG",
                            "PA",
                            "PB",
                            "PR",
                            "PE",
                            "PI",
                            "RJ",
                            "RN",
                            "RS",
                            "RO",
                            "RR",
                            "SC",
                            "SP",
                            "SE",
                            "TO",
                            null
                        ]
                    },
                    "items": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "NCM correction per item.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "sequence": {
                                    "type": "integer",
                                    "minimum": 1,
                                    "maximum": 990
                                },
                                "ncm": {
                                    "type": "string",
                                    "pattern": "^[0-9]{8}$"
                                }
                            },
                            "required": [
                                "sequence",
                                "ncm"
                            ]
                        },
                        "maxItems": 990,
                        "uniqueItems": true
                    }
                },
                "title": "RetransmitRequest"
            },
            "UserSyncRequest": {
                "type": "object",
                "description": "PUT \/users\/{externalid}: full upsert of a synchronized panel user (the same body creates or updates).\n- password: SHA-512 hex of the password (as the Poupa Pre\u00e7o apps send it), never the plain password. Omit it to keep\n  the current one.\n- roles: when sent (even empty), replaces every role of the user; when omitted, the roles are kept.\nScope ownership (issuers of the token's source system) is checked in UserController.",
                "properties": {
                    "name": {
                        "type": "string",
                        "maxLength": 150
                    },
                    "email": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "format": "email",
                        "maxLength": 190
                    },
                    "username": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Za-z0-9._@-]+$",
                        "maxLength": 100
                    },
                    "password": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^[A-Fa-f0-9]{128}$"
                    },
                    "activated": {
                        "type": "boolean"
                    },
                    "language": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Language of the panel and of the e-mails of the user: pt_BR (default), en or es.",
                        "enum": [
                            "pt_BR",
                            "en",
                            "es",
                            null
                        ]
                    },
                    "roles": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "role": {
                                    "type": "string",
                                    "enum": [
                                        "SYSTEM_ADMIN",
                                        "ADMIN",
                                        "OPERATOR",
                                        "VIEWER"
                                    ]
                                },
                                "usersid": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 1
                                },
                                "issuerid": {
                                    "type": [
                                        "integer",
                                        "null"
                                    ],
                                    "minimum": 1
                                }
                            },
                            "required": [
                                "role"
                            ]
                        },
                        "maxItems": 500
                    }
                },
                "required": [
                    "name"
                ],
                "title": "UserSyncRequest"
            }
        },
        "responses": {
            "AuthenticationException": {
                "description": "Unauthenticated",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application\/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            }
        }
    }
}