{
    "openapi": "3.1.2",
    "info": {
        "title": "Bridge Fiscal - API",
        "version": "1.0.0",
        "description": "<!-- Hash: 6486f78bf8412240c6e10e7c4027919d: 8e171bda1389bf6a88fbb32757b77fff | e3fe6d057f44794ab6098de4ada86d80: 4f6a086bc020299bc1605cd6b8ac1cde -->\n\nAPI REST do **Bridge Fiscal** para emiss\u00e3o de NFC-e (modelo 65) e NF-e (modelo 55).\n\n## Autentica\u00e7\u00e3o\nTodas as rotas exigem um token no cabe\u00e7alho `Authorization: Bearer <token>`.\nO token \u00e9 fornecido pelo suporte do Bridge Fiscal e pertence ao seu sistema (sistema de origem).\nGuarde-o no seu **servidor**; nunca o coloque em aplicativos instalados em dispositivos.\nTeste o token com `GET \/v1\/me`.\n\n## Formato das respostas\nToda resposta tem o mesmo envelope:\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` \u00e9 `null` no sucesso. No erro, \u00e9 um c\u00f3digo fixo para tratar no seu sistema (tabela abaixo).\n- `message` \u00e9 um texto para exibir ao usu\u00e1rio, no idioma pedido (veja **Idioma das respostas**).\n- Listas s\u00e3o paginadas (`?page=2&per_page=50`, m\u00e1ximo 100) e trazem tamb\u00e9m `links` e `meta`.\n\n## C\u00f3digos HTTP e erros\n| HTTP | `error` | Quando |\n|---|---|---|\n| 200 | `null` | Consulta, altera\u00e7\u00e3o ou exclus\u00e3o realizada |\n| 201 | `null` | Registro criado |\n| 401 | `unauthenticated` | Token ausente, inv\u00e1lido ou revogado |\n| 403 | `forbidden` | Sistema desativado ou sem acesso |\n| 404 | `not_found` | Registro ou endere\u00e7o n\u00e3o encontrado |\n| 409 | `conflict` | Registro duplicado |\n| 422 | `wrong_data` | Campo inv\u00e1lido (veja `errors` com todos os campos) |\n| 422 | `business_rule` | Regra de neg\u00f3cio n\u00e3o atendida |\n| 422 | `invalid_reference` | Registro relacionado inexistente |\n| 429 | `too_many_requests` | Limite de requisi\u00e7\u00f5es por minuto excedido |\n| 500 | `internal_server_error` \/ `database_error` | Erro inesperado |\n| 503 | `service_unavailable` | Manuten\u00e7\u00e3o ou indisponibilidade tempor\u00e1ria |\n\nTodo erro retorna `reference`: informe esse c\u00f3digo ao suporte para localizar o ocorrido.\n\n## Idioma das respostas\nAs mensagens (`message`, `errors` e regras de neg\u00f3cio) seguem o cabe\u00e7alho padr\u00e3o **`Accept-Language`**: `pt-BR` (padr\u00e3o), `en` ou `es`.\nSem o cabe\u00e7alho, ou com um idioma n\u00e3o suportado, a resposta vem em portugu\u00eas. O idioma usado volta no cabe\u00e7alho `Content-Language`.\nN\u00e3o mudam com o idioma: o c\u00f3digo `error`, as chaves do JSON e os dados cadastrados (ex.: `displayname` das tabelas de apoio).\nEm ingl\u00eas e espanhol, os campos com erro s\u00e3o identificados pela chave JSON (ex.: `legalname`, `items.0.ncm`).\n\n```http\nAccept-Language: es\n```\n\n## Datas\nUse **ISO 8601 com fuso**, ex.: `2026-11-10T14:30:00-03:00`. Datas sem fuso s\u00e3o lidas no hor\u00e1rio de Bras\u00edlia.\nAs respostas sempre trazem o fuso (`-03:00`).\n\n## Emiss\u00e3o\n1. Cadastre o emitente (`POST \/issuers`) e a configura\u00e7\u00e3o de emiss\u00e3o (`POST \/issuerconfigs`).\n2. Envie o documento (`POST \/fiscaldocuments`) com uma `empotencykey` \u00fanica por venda.\n3. A emiss\u00e3o \u00e9 ass\u00edncrona: consulte `GET \/fiscaldocuments\/{id}` at\u00e9 o status final (Autorizada, Rejeitada...).\n4. Reenviar a mesma `empotencykey` n\u00e3o duplica a nota: a API devolve o documento j\u00e1 recebido.\n5. Com a nota autorizada e `clientemail` preenchido, o destinat\u00e1rio recebe o DANFE (NF-e) ou o DANFE NFC-e (NFC-e), em PDF, e o XML por e-mail.\n6. Destinat\u00e1rio na NFC-e \u00e9 opcional. Por **CPF** basta `clientdocument` (e `clientname`, se quiser). Por **CNPJ** o endere\u00e7o \u00e9 obrigat\u00f3rio (`clientstreet`, `clientneighborhood`, `clientmunicipalitycode`, `clientmunicipality`, `clientstate`): sem ele a SEFAZ rejeita a nota com a mensagem enganosa \"CNPJ do destinat\u00e1rio n\u00e3o cadastrado na Receita Federal\", e a API recusa o envio antes de reservar o n\u00famero. O CNPJ do destinat\u00e1rio tamb\u00e9m precisa existir na base da Receita e ser diferente do emitente. Para CPF o endere\u00e7o s\u00f3 vai na nota quando est\u00e1 completo; um endere\u00e7o parcial \u00e9 ignorado. O endere\u00e7o \u00e9 conferido na entrada: `clientstate` \u00e9 uma UF v\u00e1lida (mai\u00fascula), `clientpostalcode` tem 8 d\u00edgitos, `clientphone` de 6 a 14 d\u00edgitos e logradouro, bairro e munic\u00edpio t\u00eam ao menos 2 caracteres.\n\n## Nota rejeitada\nA rejei\u00e7\u00e3o (status `REJECTED`) \u00e9 **final** para aquele documento: a SEFAZ recusou os dados e o Bridge Fiscal n\u00e3o tenta de novo. O webhook `REJECTED` (ou `GET \/fiscaldocuments\/{id}`) traz `errorcode`, `errormessage` (a mensagem da SEFAZ) e `errorhint`, a orienta\u00e7\u00e3o do Bridge Fiscal sobre o que corrigir.\n1. Corrija a causa (dados da nota, cadastro do emitente, certificado, CSC...).\n2. Reenvie o documento corrigido (`POST \/fiscaldocuments`) com uma **nova** `empotencykey` e `reissueof` = `id` do documento rejeitado (o v\u00ednculo aparece como `reissuedfromid`): reenviar a mesma chave s\u00f3 devolve o documento rejeitado. Cada rejeitado s\u00f3 pode ser reemitido uma vez.\n3. N\u00e3o reenvie em la\u00e7o sem corrigir: cada rejei\u00e7\u00e3o consome um n\u00famero da s\u00e9rie. O Bridge Fiscal inutiliza sozinho o n\u00famero das notas rejeitadas (n\u00e3o chame `\/fiscalinvalidations` para elas).\n4. `ERROR` n\u00e3o \u00e9 rejei\u00e7\u00e3o: o Bridge Fiscal continua tentando sozinho, apenas aguarde. Exce\u00e7\u00f5es, que precisam de uma pessoa e disparam alerta ao lojista (`errorcode`): `CERTIFICATE` (certificado do emitente vencido ou inv\u00e1lido: ao enviar um certificado v\u00e1lido a nota \u00e9 reprocessada sozinha), `STALLED` (a SEFAZ n\u00e3o respondeu de forma conclusiva at\u00e9 o fim do prazo de transmiss\u00e3o: conferir a chave no portal da SEFAZ) e `SCHEMA` ou `BUILD` (dados da nota recusados antes do envio: corrija e reemita).\nA venda j\u00e1 foi paga: n\u00e3o bloqueie o PDV por causa da emiss\u00e3o. Reemita automaticamente em erro de dados e avise o lojista quando a causa for cadastro, certificado ou CSC.\n\n## Conting\u00eancia offline (NFC-e)\nQuando a SEFAZ n\u00e3o responde, o Bridge Fiscal emite a NFC-e em conting\u00eancia offline (`emissiontype` 9) sozinho, sem nada a fazer do seu lado (Configura\u00e7\u00f5es: conting\u00eancia autom\u00e1tica ligada por padr\u00e3o).\n- Entra em conting\u00eancia a NFC-e que chega com a SEFAZ da UF fora do ar ou que segue sem resposta alguns minutos depois de recebida (padr\u00e3o 5). A data de emiss\u00e3o (`dhEmi`) \u00e9 a hora em que a venda chegou ao Bridge Fiscal.\n- A nota fica `CONTINGENCY` (webhook `CONTINGENCY`), j\u00e1 com `accesskey` e `qrcode` v\u00e1lidos, e \u00e9 transmitida sozinha quando a SEFAZ volta (prazo legal de 24 h). Depois disso segue o fluxo normal: `AUTHORIZED` (webhook e e-mail ao consumidor) ou `REJECTED`.\n- Se a tentativa normal chegou a ser enviada sem resposta, a venda recebe um n\u00famero novo na conting\u00eancia e a tentativa antiga vira um registro separado com `replacedbyid` = `id` da sua nota. Ele n\u00e3o \u00e9 cobrado nem gera webhook: se a SEFAZ o tiver autorizado, o Bridge Fiscal o cancela por substitui\u00e7\u00e3o; se n\u00e3o, o n\u00famero \u00e9 inutilizado. Esses registros n\u00e3o aparecem na listagem (`GET \/fiscaldocuments`), s\u00f3 na consulta pelo `id`; use sempre o documento do `id` que voc\u00ea recebeu.\n- Se a SEFAZ rejeitar uma nota j\u00e1 emitida em conting\u00eancia, ela fica `ERROR` com `errorcode` `CONTINGENCY_<c\u00f3digo>` (com alerta ao lojista): o consumidor j\u00e1 tem o DANFE NFC-e, ent\u00e3o o n\u00famero n\u00e3o \u00e9 inutilizado nem a nota pode ser reemitida com outro n\u00famero. Corrija o dado e retransmita com `POST \/fiscaldocuments\/{id}\/retransmit` (campos `client...` do destinat\u00e1rio e\/ou `items` com `sequence` e `ncm`): a nota mant\u00e9m n\u00famero, s\u00e9rie e chave.\n## NF-e (modelo 55)\nUse uma configura\u00e7\u00e3o de modelo 55. Al\u00e9m das regras da NFC-e:\n- **Destinat\u00e1rio obrigat\u00f3rio**: `clientdocument`, `clientname`, `clientieindicator` (1 contribuinte, com `clientstateregistration`; 2 isento; 9 n\u00e3o contribuinte) e o endere\u00e7o completo (`clientstreet`, `clientneighborhood`, `clientmunicipalitycode`, `clientmunicipality`, `clientstate`).\n- **Destino**: `destinationindicator` 1 quando o destinat\u00e1rio \u00e9 do mesmo estado do emitente, 2 quando \u00e9 de outro. O CFOP de todos os itens segue o destino e a dire\u00e7\u00e3o: sa\u00edda 5xxx\/6xxx, entrada 1xxx\/2xxx.\n- **Finalidades aceitas**: 1 (normal) e 4 (devolu\u00e7\u00e3o). A devolu\u00e7\u00e3o traz a chave da nota devolvida em `references` e um \u00fanico pagamento `paymenttype` 90 com `paid` 0.\n- **Valores**: o total \u00e9 a soma dos subtotais dos itens + outras despesas + frete + seguro + IPI + ICMS ST + FCP ST + IPI devolvido; `otherexpensestotal`, `freighttotal`, `insurancetotal`, `ipitotal`, `icmssttotal`, `fcpsttotal` e `ipireturntotal` s\u00e3o a soma dos campos dos itens. Transporte opcional: transportadora, ve\u00edculo e volumes.\n- **Tributos opcionais por item** (preencha s\u00f3 o que a opera\u00e7\u00e3o exige; o Bridge Fiscal n\u00e3o calcula tributos, s\u00f3 confere e envia): ICMS ST (`icmsstbasemode`, `icmsstmva`, `icmsstreduction`, `icmsstbase`, `icmsstrate`, `icmsstvalue`) e FCP ST (`fcpst*`) para CST 10, 30, 70 e CSOSN 201, 202, 203; ICMS retido anteriormente (`icmsstret*`, `fcpstret*`) para CST 60 e CSOSN 500; cr\u00e9dito do Simples (`sncreditrate`, `sncreditvalue`) para CSOSN 101 e 201; desonera\u00e7\u00e3o (`icmsdesonvalue` e `icmsdesonreason`); IPI devolvido (`ipireturnrate`, `ipireturnvalue`); e o **DIFAL** (`difalbase`, `difalrate`, `difalinterrate` 4, 7 ou 12, `difalvalue`...), obrigat\u00f3rio na venda interestadual a consumidor final n\u00e3o contribuinte.\n- **ICMS aceito**: CSOSN 101, 102, 103, 201, 202, 203, 300, 400, 500, 900 (Simples Nacional) ou CST 00, 10, 20, 30, 40, 41, 50, 60, 70, 90 (regime normal).\n- **Ainda n\u00e3o aceitos**: exporta\u00e7\u00e3o, venda a prazo (duplicatas), finalidades complementar e ajuste.\n\n## IBS\/CBS (reforma tribut\u00e1ria)\nO grupo de IBS\/CBS da nota \u00e9 opcional e **desligado por padr\u00e3o**: a configura\u00e7\u00e3o de emiss\u00e3o (`POST\/PATCH \/issuerconfigs`) tem `ibscbsmode` 0 (n\u00e3o envia; a API recusa dados de IBS\/CBS para n\u00e3o descart\u00e1-los em sil\u00eancio), 1 (envia quando o item informa) ou 2 (obrigat\u00f3rio em todos os itens). Ligue primeiro em homologa\u00e7\u00e3o e confirme com o contador quem \u00e9 obrigado em cada fase (o Simples Nacional e o MEI est\u00e3o dispensados em 2026).\n- Por item: `ibscbscst` (000 tributado, 200 al\u00edquota reduzida, 410 isento\/imune\/n\u00e3o tributado), `ibscbsclass` (6 d\u00edgitos, come\u00e7ando pelo CST), `ibscbsbase`, e por esfera a al\u00edquota e o valor: `ibsstaterate`\/`ibsstatevalue`, `ibsmunicipalrate`\/`ibsmunicipalvalue`, `cbsrate`\/`cbsvalue`. No CST 200 envie tamb\u00e9m a redu\u00e7\u00e3o e a al\u00edquota efetiva (`ibsstatereduction`, `ibsstateeffectiverate`, `ibsmunicipalreduction`, `ibsmunicipaleffectiverate`, `cbsreduction`, `cbseffectiverate`). O CST 410 n\u00e3o leva valores.\n- O Bridge Fiscal n\u00e3o calcula IBS\/CBS: confere se valor = base \u00d7 al\u00edquota (1 centavo de toler\u00e2ncia) e envia. Em 2026 o IBS\/CBS n\u00e3o entra no total da nota. Nas notas autorizadas em produ\u00e7\u00e3o (SP, abril\/2026, regime normal) a base foi o valor do item ap\u00f3s o desconto menos PIS, COFINS e ICMS, com IBS estadual 0,1% e CBS 0,9% em 2026; confirme a regra vigente com o contador.\n- Outros CSTs (diferimento, monof\u00e1sico, cr\u00e9dito presumido, Imposto Seletivo) ainda n\u00e3o s\u00e3o aceitos.\n\n## Cancelamento e carta de corre\u00e7\u00e3o\nOs pedidos (`POST \/fiscaldocuments\/{id}\/cancel` e `\/correction`) s\u00e3o ass\u00edncronos: o evento nasce Pendente e \u00e9 transmitido \u00e0 SEFAZ em seguida. Acompanhe por `GET \/fiscaldocuments\/{id}\/events` (status Registrado, Rejeitado ou Erro, com o protocolo e o motivo). Com o cancelamento registrado o documento passa a Cancelado, o DANFE (NF-e) ou DANFE NFC-e (NFC-e) \u00e9 gerado de novo com a marca de cancelada e o webhook `CANCELLED` \u00e9 enviado. A carta de corre\u00e7\u00e3o (somente NF-e, at\u00e9 20 por documento) n\u00e3o muda o status do documento: o webhook `CORRECTED` \u00e9 enviado e o destinat\u00e1rio recebe por e-mail o PDF da carta (DAEVENTO) e o XML do evento. Um cancelamento ou carta rejeitados (por exemplo, fora do prazo da SEFAZ) geram os webhooks `CANCEL_REJECTED` e `CORRECTION_REJECTED`, e o cancelamento pode ser solicitado de novo.\n\n## Webhooks\nEm vez de consultar o status, cadastre um webhook no painel (Integra\u00e7\u00f5es): para o sistema, para um cliente ou para uma loja. Vale o mais espec\u00edfico (loja, depois cliente, depois sistema), e s\u00f3 os eventos escolhidos s\u00e3o enviados (`AUTHORIZED`, `REJECTED`, `DENIED`, `CANCELLED`, `CONTINGENCY`, `ERROR` e os resultados de cancelamento e carta de corre\u00e7\u00e3o: `CANCEL_REJECTED`, `CORRECTION_REJECTED` e `CORRECTED`).\n- A URL precisa ser HTTPS e apontar para um endere\u00e7o p\u00fablico da internet (endere\u00e7os internos ou de rede local s\u00e3o recusados), e redirecionamentos n\u00e3o s\u00e3o seguidos. O webhook \u00e9 opcional: sem ele, consulte `GET \/fiscaldocuments\/{id}`.\n- `POST` na sua URL HTTPS com o JSON `{\"event\", \"delivery\", \"sent_at\", \"document\"}`. `document` tem o mesmo formato de `GET \/fiscaldocuments\/{id}` e `delivery` identifica a entrega. Nos eventos de cancelamento e carta de corre\u00e7\u00e3o (`CANCELLED`, `CANCEL_REJECTED`, `CORRECTED`, `CORRECTION_REJECTED`) o JSON traz tamb\u00e9m `fiscalevent`, no formato de `GET \/fiscaldocuments\/{id}\/events`; trate entregas repetidas por `document.id`, `event` e `fiscalevent.id`.\n- Cabe\u00e7alhos: `X-BridgeFiscal-Event`, `X-BridgeFiscal-Timestamp` (Unix) e `X-BridgeFiscal-Signature: sha256=<hex>`, o HMAC-SHA256 de `<timestamp>.<corpo>` com o segredo mostrado no cadastro. Confira a assinatura e recuse timestamps com mais de 5 minutos.\n- Responda com HTTP 2xx em at\u00e9 10 segundos. Sem 2xx, h\u00e1 novas tentativas ap\u00f3s 1, 5, 15 e 60 minutos. Trate entregas repetidas pelo `document.id` e `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": "Retorna o sistema de origem dono do token. Use para testar a integra\u00e7\u00e3o.",
                "summary": "Sistema de origem autenticado",
                "tags": [
                    "Autentica\u00e7\u00e3o"
                ],
                "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": "Vers\u00f5es de plano com mensalidade, franquia de notas e valor por nota excedente. Por padr\u00e3o, s\u00f3 as vers\u00f5es contrat\u00e1veis hoje (current=1); current=0 lista todas as vers\u00f5es. S\u00e3o os pre\u00e7os pagos pelo seu sistema: n\u00e3o os mostre aos seus clientes. Exige um token com a permiss\u00e3o billing:read.",
                "summary": "Listar planos",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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": "Exige um token com a permiss\u00e3o billing:read.",
                "summary": "Consultar um plano",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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": "Assinaturas dos emitentes pagas pelo seu sistema. running=1 mant\u00e9m apenas as vigentes hoje ou agendadas. Exige um token com a permiss\u00e3o billing:read.",
                "summary": "Listar assinaturas",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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": "Come\u00e7a hoje (hor\u00e1rio local do emitente) ou em uma data de in\u00edcio futura. O ciclo \u00e9 mensal a partir da data de in\u00edcio e pr\u00e9-pago: a primeira mensalidade vai imediatamente para uma fatura da sua conta de cobran\u00e7a. Pre\u00e7o, franquia e valor por nota excedente ficam travados enquanto a assinatura durar. Exige um token com a permiss\u00e3o billing:write.",
                "summary": "Assinar um emitente a um plano",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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": "Exige um token com a permiss\u00e3o billing:read.",
                "summary": "Consultar uma assinatura",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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 atual por padr\u00e3o (ou periodid): notas da franquia, cobr\u00e1veis e excedentes, proje\u00e7\u00e3o at\u00e9 o fim do per\u00edodo, notas n\u00e3o cobradas por status (apenas relat\u00f3rio), inutiliza\u00e7\u00f5es, eventos e, quando outro plano custaria menos para o volume projetado, o plano sugerido. Use para decidir upgrades com seus clientes. Exige um token com a permiss\u00e3o billing:read.",
                "summary": "Consumo de uma assinatura",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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 atual de cada assinatura vigente do CNPJ (uma por loja\/filial do CNPJ). Exige um token com a permiss\u00e3o billing:read.",
                "summary": "Consumo por CNPJ",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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": "Faturas da sua conta de cobran\u00e7a. status: OPEN, OVERDUE, PAID ou CANCELLED. duedatefrom\/duedateto filtram a data de vencimento. Exige um token com a permiss\u00e3o billing:read.",
                "summary": "Listar faturas",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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": "Com seus itens: CNPJ, motivo (PLAN_FEE, OVERAGE, PRORATA, ADJUSTMENT, DISCOUNT), per\u00edodo, quantidade e valores. Exige um token com a permiss\u00e3o billing:read.",
                "summary": "Consultar uma fatura",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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": "Mudan\u00e7a para um plano de mensalidade maior: vale a partir de amanh\u00e3; a diferen\u00e7a proporcional dos dias restantes do ciclo entra na pr\u00f3xima fatura (item PRORATA). Mudan\u00e7a para um plano menor: vale a partir do pr\u00f3ximo ciclo, sem cr\u00e9dito. Uma nova assinatura \u00e9 criada com o mesmo dia de cobran\u00e7a; a atual recebe a data de t\u00e9rmino. Exige um token com a permiss\u00e3o billing:write.",
                "summary": "Trocar o plano",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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": "A assinatura termina no \u00faltimo dia do ciclo atual, j\u00e1 pago (sem reembolso). Numa assinatura agendada (troca para plano menor que ainda n\u00e3o come\u00e7ou), desfaz a troca: a assinatura atual continua. Exige um token com a permiss\u00e3o billing:write.",
                "summary": "Cancelar uma assinatura",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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": "Desfaz o cancelamento enquanto o ciclo pago n\u00e3o terminou: a assinatura continua com o mesmo plano, pre\u00e7o e dia de cobran\u00e7a. Use quando o seu cliente contratar o servi\u00e7o de novo antes do fim do ciclo. Exige um token com a permiss\u00e3o billing:write.",
                "summary": "Retomar uma assinatura cancelada",
                "tags": [
                    "Cobran\u00e7a"
                ],
                "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 configura\u00e7\u00e3o \u00e9 um PDV: CNPJ x modelo x s\u00e9rie x ambiente, com numera\u00e7\u00e3o pr\u00f3pria.",
                "summary": "Listar configura\u00e7\u00f5es de emiss\u00e3o",
                "tags": [
                    "Configura\u00e7\u00f5es de emiss\u00e3o"
                ],
                "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 e sequence (pr\u00f3ximo n\u00famero, padr\u00e3o 1) n\u00e3o podem ser alterados depois.\nPara continuar a numera\u00e7\u00e3o de outro emissor, envie em sequence o pr\u00f3ximo n\u00famero a ser usado.\nO emitente precisa ter um certificado digital v\u00e1lido (enviado em issuers\/{id}\/certificate) antes desta etapa.\nO CSC pertence ao CNPJ e ao ambiente: uma configura\u00e7\u00e3o NFC-e (65) nova herda o CSC j\u00e1 cadastrado em outra configura\u00e7\u00e3o do mesmo CNPJ, ambiente e sistema de origem (somente na cria\u00e7\u00e3o: um CSC removido depois continua removido). Para troc\u00e1-lo, use issuerconfigs\/{id}\/csc.",
                "summary": "Cadastrar uma configura\u00e7\u00e3o de emiss\u00e3o",
                "tags": [
                    "Configura\u00e7\u00f5es de emiss\u00e3o"
                ],
                "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 uma configura\u00e7\u00e3o de emiss\u00e3o",
                "tags": [
                    "Configura\u00e7\u00f5es de emiss\u00e3o"
                ],
                "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": "Altera\u00e7\u00e3o parcial. Trocar o issuerid s\u00f3 \u00e9 aceito para um emitente com o mesmo CNPJ (ex.: troca do terminal POS).",
                "summary": "Alterar uma configura\u00e7\u00e3o de emiss\u00e3o",
                "tags": [
                    "Configura\u00e7\u00f5es de emiss\u00e3o"
                ],
                "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": "Exclus\u00e3o l\u00f3gica (active = false). A numera\u00e7\u00e3o \u00e9 mantida e n\u00e3o pode ser reutilizada.",
                "summary": "Excluir uma configura\u00e7\u00e3o de emiss\u00e3o",
                "tags": [
                    "Configura\u00e7\u00f5es de emiss\u00e3o"
                ],
                "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": "Cadastra o CSC (identificador e token) de uma configura\u00e7\u00e3o de NFC-e (modelo 65). O token nunca \u00e9 retornado: a configura\u00e7\u00e3o mostra apenas cscconfigured = true.\nEm configura\u00e7\u00f5es de homologa\u00e7\u00e3o, use o CSC de homologa\u00e7\u00e3o.",
                "summary": "Cadastrar o CSC",
                "tags": [
                    "Configura\u00e7\u00f5es de emiss\u00e3o"
                ],
                "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": "Remove o CSC da configura\u00e7\u00e3o. A emiss\u00e3o de NFC-e fica suspensa at\u00e9 que um novo CSC seja cadastrado.",
                "summary": "Excluir o CSC",
                "tags": [
                    "Configura\u00e7\u00f5es de emiss\u00e3o"
                ],
                "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 ao aplicativo cliente registrar um erro ocorrido no dispositivo (origem \"app\").\nRetorna o c\u00f3digo de refer\u00eancia para informar ao suporte. Funciona mesmo com a API em manuten\u00e7\u00e3o.",
                "summary": "Registrar um erro do aplicativo",
                "tags": [
                    "Log de erros"
                ],
                "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 (mais recentes primeiro). Filtre datas em ISO 8601, ex.: 2026-11-10T00:00:00-03:00.",
                "summary": "Listar documentos fiscais",
                "tags": [
                    "Documentos fiscais"
                ],
                "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": "Recebe o documento completo (cabe\u00e7alho, itens, pagamentos e refer\u00eancias) e o coloca na fila de emiss\u00e3o com status Pendente. A emiss\u00e3o \u00e9 ass\u00edncrona: consulte o documento para acompanhar o status.\nIdempot\u00eancia: reenviar a mesma empotencykey devolve o documento j\u00e1 recebido (200), nunca uma duplicata.",
                "summary": "Enviar um documento fiscal para emiss\u00e3o",
                "tags": [
                    "Documentos fiscais"
                ],
                "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": "Retorna o documento com status, itens, pagamentos, documentos referenciados e eventos.",
                "summary": "Consultar um documento fiscal",
                "tags": [
                    "Documentos fiscais"
                ],
                "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": "Somente NFC-e emitida em conting\u00eancia offline e rejeitada pela SEFAZ (status ERROR, errorcode CONTINGENCY_<c\u00f3digo>). O consumidor j\u00e1 tem o DANFE NFC-e, ent\u00e3o a nota mant\u00e9m n\u00famero, s\u00e9rie e chave. Envie os campos do destinat\u00e1rio (client...) e\/ou items com sequence e ncm a corrigir; a nota \u00e9 refeita e transmitida de novo.",
                "summary": "Corrigir e retransmitir uma NFC-e emitida em conting\u00eancia",
                "tags": [
                    "Documentos fiscais"
                ],
                "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 os eventos de um documento",
                "tags": [
                    "Eventos fiscais"
                ],
                "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": "Somente documentos autorizados, dentro do prazo de cancelamento contado da autoriza\u00e7\u00e3o (por padr\u00e3o 30 minutos para NFC-e e 24 horas para NF-e). Envie substituteaccesskey (outra NFC-e do mesmo emitente) para cancelamento por substitui\u00e7\u00e3o (somente NFC-e).",
                "summary": "Cancelar um documento fiscal",
                "tags": [
                    "Eventos fiscais"
                ],
                "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": "Somente NF-e (modelo 55) autorizada. At\u00e9 20 corre\u00e7\u00f5es por documento; a \u00faltima substitui as anteriores.",
                "summary": "Enviar uma carta de corre\u00e7\u00e3o (CC-e)",
                "tags": [
                    "Eventos fiscais"
                ],
                "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 as inutiliza\u00e7\u00f5es de uma configura\u00e7\u00e3o de emiss\u00e3o",
                "tags": [
                    "Inutiliza\u00e7\u00f5es"
                ],
                "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 uma faixa de n\u00fameros que n\u00e3o ser\u00e1 usada (ex.: rejeitados ou pulados). A transmiss\u00e3o \u00e0 SEFAZ \u00e9 ass\u00edncrona.",
                "summary": "Solicitar a inutiliza\u00e7\u00e3o de uma faixa de n\u00fameros",
                "tags": [
                    "Inutiliza\u00e7\u00f5es"
                ],
                "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 uma inutiliza\u00e7\u00e3o",
                "tags": [
                    "Inutiliza\u00e7\u00f5es"
                ],
                "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 dos emitentes do sistema de origem autenticado. Filtros: document, branchid, branchnickname (cont\u00e9m), branchnumber, active.",
                "summary": "Listar emitentes",
                "tags": [
                    "Emitentes"
                ],
                "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": "O CNPJ (document) n\u00e3o pode ser alterado depois. O certificado digital \u00e9 enviado por um endpoint pr\u00f3prio. Opcionalmente, informe branchnickname (apelido da loja, ex.: nome do condom\u00ednio) e\/ou branchnumber (n\u00famero sequencial da loja): ambos aparecem e s\u00e3o pesquis\u00e1veis no painel.",
                "summary": "Cadastrar um emitente",
                "tags": [
                    "Emitentes"
                ],
                "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 um emitente",
                "tags": [
                    "Emitentes"
                ],
                "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": "Altera\u00e7\u00e3o parcial: envie somente os campos alterados.",
                "summary": "Alterar um emitente",
                "tags": [
                    "Emitentes"
                ],
                "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": "Exclus\u00e3o l\u00f3gica (active = false). O hist\u00f3rico fiscal \u00e9 mantido.",
                "summary": "Excluir um emitente",
                "tags": [
                    "Emitentes"
                ],
                "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": "Dados p\u00fablicos do certificado A1 em uso (titular, CNPJ, validade). O arquivo e a senha nunca s\u00e3o retornados.",
                "summary": "Consultar o certificado do emitente",
                "tags": [
                    "Emitentes"
                ],
                "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": "Envie o certificado A1 (.pfx ou .p12) e a senha como multipart\/form-data. Substitui o certificado atual.\nO certificado deve ser um e-CNPJ da mesma empresa (mesma raiz de CNPJ) e n\u00e3o pode estar vencido.",
                "summary": "Enviar o certificado do emitente",
                "tags": [
                    "Emitentes"
                ],
                "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": "Remove o certificado e a senha. O emitente n\u00e3o emite mais documentos at\u00e9 que um novo certificado seja enviado.",
                "summary": "Excluir o certificado do emitente",
                "tags": [
                    "Emitentes"
                ],
                "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": "Retorna os registros ativos. 'name' \u00e9 o c\u00f3digo fixo para usar na integra\u00e7\u00e3o; 'displayname' \u00e9 o texto para exibir ao usu\u00e1rio.",
                "summary": "Listar status fiscais",
                "tags": [
                    "Tabelas de apoio"
                ],
                "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 um status fiscal",
                "tags": [
                    "Tabelas de apoio"
                ],
                "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": "Tabela oficial de meios de pagamento da SEFAZ (tPag). Envie 'code' em payments[].paymenttype. Os c\u00f3digos com acceptedbyapi = false ficam na tabela s\u00f3 para consulta, mas a API os recusa: todo documento recebido \u00e9 de uma venda paga.",
                "summary": "Listar as formas de pagamento da SEFAZ",
                "tags": [
                    "Tabelas de apoio"
                ],
                "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 uma forma de pagamento da SEFAZ",
                "tags": [
                    "Tabelas de apoio"
                ],
                "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": "Retorna os registros ativos. 'name' \u00e9 o c\u00f3digo fixo para usar na integra\u00e7\u00e3o; 'displayname' \u00e9 o texto para exibir ao usu\u00e1rio.",
                "summary": "Listar tipos de evento",
                "tags": [
                    "Tabelas de apoio"
                ],
                "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 um tipo de evento",
                "tags": [
                    "Tabelas de apoio"
                ],
                "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": "Retorna os registros ativos. 'name' \u00e9 o c\u00f3digo fixo para usar na integra\u00e7\u00e3o; 'displayname' \u00e9 o texto para exibir ao usu\u00e1rio.",
                "summary": "Listar status de evento",
                "tags": [
                    "Tabelas de apoio"
                ],
                "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 um status de evento",
                "tags": [
                    "Tabelas de apoio"
                ],
                "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": "Classes de porte de loja usadas pelos planos: MINIMARKET, NEIGHBORHOOD, SUPERMARKET e WAREHOUSE. Exige apenas um token v\u00e1lido.",
                "summary": "Listar portes de loja",
                "tags": [
                    "Tabelas de apoio"
                ],
                "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 dos usu\u00e1rios do painel sincronizados pelo sistema autenticado, com os perfis em vigor. Exige um token com a permiss\u00e3o users:sync.",
                "summary": "Listar usu\u00e1rios",
                "tags": [
                    "Usu\u00e1rios do painel"
                ],
                "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": "Busca pelo identificador do usu\u00e1rio no sistema de origem (externalid). Exige um token com a permiss\u00e3o users:sync.",
                "summary": "Consultar um usu\u00e1rio",
                "tags": [
                    "Usu\u00e1rios do painel"
                ],
                "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": "Cadastra ou atualiza o usu\u00e1rio pelo identificador dele no sistema de origem (externalid). Nome, login e senha continuam mantidos pelo seu sistema e n\u00e3o podem ser alterados no painel. Exige um token com a permiss\u00e3o users:sync.\n\n- `password`: SHA-512 (hexadecimal) da senha, nunca a senha em si. Omita para manter a atual.\n- `activated: false` desabilita o usu\u00e1rio e revoga todos os perfis dele. Ao habilitar de novo, ele volta s\u00f3 com o login: os perfis precisam ser enviados outra vez.\n- `roles`: quando enviado (mesmo vazio), substitui todos os perfis do usu\u00e1rio. Cada perfil tem um escopo: `SYSTEM_ADMIN` sem escopo (todo o sistema); `ADMIN`, `OPERATOR` ou `VIEWER` com um cliente (`usersid`, todas as lojas dele) ou uma loja (`issuerid`, um emitente deste sistema).\n- O login (e-mail ou nome de usu\u00e1rio) \u00e9 \u00fanico entre os usu\u00e1rios ativos de todo o Bridge Fiscal.",
                "summary": "Cadastrar ou atualizar um usu\u00e1rio",
                "tags": [
                    "Usu\u00e1rios do painel"
                ],
                "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": "Envie o seu token no cabe\u00e7alho `Authorization` em todas as requisi\u00e7\u00f5es \u00e0s rotas protegidas: `Authorization: Bearer <token>`. O token \u00e9 fornecido pelo suporte do 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"
                            ]
                        }
                    }
                }
            }
        }
    }
}