{
  "openapi": "3.1.0",
  "info": {
    "title": "Onzepay API",
    "version": "1.0.0",
    "summary": "Pix para empresas: cobranças, saques, devoluções, MED e webhooks.",
    "description": "Valores em centavos (inteiros). Datas em ISO 8601 UTC. Campos em camelCase. Ids públicos com prefixo (`chg_`, `pxo_`, …). Rotas que movem dinheiro ou criam recursos exigem `Idempotency-Key`.",
    "contact": {
      "name": "Onzepay",
      "url": "https://docs.onzepay.com"
    },
    "license": {
      "name": "Proprietária",
      "url": "https://docs.onzepay.com"
    }
  },
  "externalDocs": {
    "description": "Documentação",
    "url": "https://docs.onzepay.com"
  },
  "servers": [
    {
      "url": "https://api.onzepay.com/v1",
      "description": "Produção e sandbox (o ambiente vem da chave: sk_live_ ou sk_test_)"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Conta e saldo",
      "description": "Dados da empresa, limites, tarifas, permissões de saque, chaves Pix e saldo."
    },
    {
      "name": "Cobranças Pix",
      "description": "QR Code dinâmico imediato ou com vencimento."
    },
    {
      "name": "Pix recebidos",
      "description": "Pagamentos que entraram na conta."
    },
    {
      "name": "Extrato e transações",
      "description": "Lançamentos liquidados e consulta de status por id ou externalId."
    },
    {
      "name": "Saques e pagamentos",
      "description": "Pix por chave, com consulta ao DICT e checagem de titularidade."
    },
    {
      "name": "Devoluções",
      "description": "Devolução espontânea de um Pix recebido."
    },
    {
      "name": "MED",
      "description": "Casos do Mecanismo Especial de Devolução: consultar, contestar ou devolver."
    },
    {
      "name": "Endpoints de webhook",
      "description": "Cadastro, teste e reenvio dos seus endpoints."
    }
  ],
  "paths": {
    "/account": {
      "get": {
        "operationId": "getAccount",
        "summary": "Consultar a conta",
        "description": "Devolve os dados da empresa, os limites de envio, as tarifas do plano, as permissões de saque e as chaves Pix ativas.\n\nEscopo: `account.read`.",
        "tags": [
          "Conta e saldo"
        ],
        "security": [
          {
            "bearerAuth": [
              "account.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/conta#get-account"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                },
                "example": {
                  "id": "acc_034yDKrKOayMcSPkoaNXB9",
                  "cnpj": "12345678000190",
                  "legalName": "Exemplo Comércio Ltda",
                  "tradeName": "Exemplo",
                  "status": "active",
                  "environment": "live",
                  "limits": {
                    "daySendLimit": 10000000,
                    "nightSendLimit": 500000,
                    "nightWindowStart": "22:00",
                    "nightWindowEnd": "06:00",
                    "timezone": "America/Sao_Paulo"
                  },
                  "fees": {
                    "pixInFeeFixed": 0,
                    "pixInFeePercent": 1,
                    "pixOutFeeFixed": 100,
                    "pixOutFeePercent": 0,
                    "pixOutMaxChunkAmount": 1500000
                  },
                  "payout": {
                    "apiEnabled": false,
                    "otherHoldersEnabled": false,
                    "panelSameHolder": true
                  },
                  "pixKeys": [
                    {
                      "id": "pxk_034yDKpX9cV1bN3mQ5wE7r",
                      "type": "cnpj",
                      "value": "12345678000190",
                      "status": "active"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/balance": {
      "get": {
        "operationId": "getBalance",
        "summary": "Consultar o saldo",
        "description": "`available` é o que pode ser sacado agora. `blocked` é o valor retido por MED.\n\nEscopo: `account.read`.",
        "tags": [
          "Conta e saldo"
        ],
        "security": [
          {
            "bearerAuth": [
              "account.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/conta#get-balance"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Balance"
                },
                "example": {
                  "available": 150000,
                  "blocked": 3000,
                  "currency": "BRL"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/charges": {
      "post": {
        "operationId": "createCharge",
        "summary": "Criar uma cobrança",
        "description": "Cria a cobrança e devolve o QR Code. Informe `expiresIn` **ou** `dueAt`, nunca os dois.\n\nEscopo: `charges.write`.",
        "tags": [
          "Cobranças Pix"
        ],
        "security": [
          {
            "bearerAuth": [
              "charges.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/cobrancas#create-charge"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Charge"
                },
                "example": {
                  "id": "chg_034yDKstyRbto2AiOEPZJP",
                  "externalId": "order-4821",
                  "txid": "0f6a1c2e9b7d4e3fa1b2c3d4e5f60718",
                  "status": "active",
                  "amount": 3000,
                  "feeAmount": 30,
                  "netAmount": 2970,
                  "currency": "BRL",
                  "description": "Pedido 4821",
                  "copyPaste": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "qrCode": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "expiresAt": "2026-11-15T22:00:00.000Z",
                  "dueAt": null,
                  "endToEndId": null,
                  "pixInId": null,
                  "paidAt": null,
                  "createdAt": "2026-11-15T21:00:00.000Z",
                  "updatedAt": "2026-11-15T21:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR: Valor inválido, ou `expiresIn` e `dueAt` juntos.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "EXTERNAL_ID_CONFLICT: Já existe cobrança com este `externalId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargeCreate"
              },
              "example": {
                "amount": 3000,
                "description": "Pedido 4821",
                "externalId": "order-4821",
                "expiresIn": 3600
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listCharges",
        "summary": "Listar cobranças",
        "description": "Lista da mais nova para a mais antiga. Com só `externalId` na query, devolve a cobrança direto (sem lista).\n\nEscopo: `charges.read`.",
        "tags": [
          "Cobranças Pix"
        ],
        "security": [
          {
            "bearerAuth": [
              "charges.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/cobrancas#list-charges"
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filtra pelo estado.",
            "schema": {
              "type": "string",
              "enum": [
                "active",
                "waiting",
                "paid",
                "expired",
                "canceled"
              ],
              "description": "Filtra pelo estado."
            }
          },
          {
            "name": "externalId",
            "in": "query",
            "required": false,
            "description": "Seu identificador.",
            "schema": {
              "type": "string",
              "description": "Seu identificador."
            }
          },
          {
            "name": "createdAfter",
            "in": "query",
            "required": false,
            "description": "Criadas a partir de (ISO 8601 UTC).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Criadas a partir de (ISO 8601 UTC)."
            }
          },
          {
            "name": "createdBefore",
            "in": "query",
            "required": false,
            "description": "Criadas até (ISO 8601 UTC).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Criadas até (ISO 8601 UTC)."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Itens por página. Padrão 25, máximo 100.",
            "schema": {
              "type": "integer",
              "description": "Itens por página. Padrão 25, máximo 100."
            }
          },
          {
            "name": "startingAfter",
            "in": "query",
            "required": false,
            "description": "Cursor: o `id` (`chg_…`) do último item da página anterior.",
            "schema": {
              "type": "string",
              "description": "Cursor: o id (chg_…) do último item da página anterior."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChargeList"
                },
                "example": {
                  "data": [
                    {
                      "id": "chg_034yDKstyRbto2AiOEPZJP",
                      "externalId": "order-4821",
                      "txid": "0f6a1c2e9b7d4e3fa1b2c3d4e5f60718",
                      "status": "active",
                      "amount": 3000,
                      "feeAmount": 30,
                      "netAmount": 2970,
                      "currency": "BRL",
                      "description": "Pedido 4821",
                      "copyPaste": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                      "qrCode": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                      "expiresAt": "2026-11-15T22:00:00.000Z",
                      "dueAt": null,
                      "endToEndId": null,
                      "pixInId": null,
                      "paidAt": null,
                      "createdAt": "2026-11-15T21:00:00.000Z",
                      "updatedAt": "2026-11-15T21:00:00.000Z"
                    }
                  ],
                  "hasMore": true,
                  "nextCursor": "chg_034yDKstyRbto2AiOEPZJP"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/charges/{id}": {
      "get": {
        "operationId": "getCharge",
        "summary": "Consultar uma cobrança",
        "description": "Escopo: `charges.read`.",
        "tags": [
          "Cobranças Pix"
        ],
        "security": [
          {
            "bearerAuth": [
              "charges.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/cobrancas#get-charge"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id da cobrança (`chg_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Charge"
                },
                "example": {
                  "id": "chg_034yDKstyRbto2AiOEPZJP",
                  "externalId": "order-4821",
                  "txid": "0f6a1c2e9b7d4e3fa1b2c3d4e5f60718",
                  "status": "paid",
                  "amount": 3000,
                  "feeAmount": 30,
                  "netAmount": 2970,
                  "currency": "BRL",
                  "description": "Pedido 4821",
                  "copyPaste": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "qrCode": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "expiresAt": "2026-11-15T22:00:00.000Z",
                  "dueAt": null,
                  "endToEndId": "E18236120202611152100abcdef123456",
                  "pixInId": "pxi_034yDKu1QwzR8mJb3XyTnE",
                  "paidAt": "2026-11-15T21:05:00.000Z",
                  "createdAt": "2026-11-15T21:00:00.000Z",
                  "updatedAt": "2026-11-15T21:05:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "NOT_FOUND: Cobrança não encontrada nesta conta.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateCharge",
        "summary": "Alterar uma cobrança",
        "description": "Só cobranças `active` ou `waiting`. Mudar valor, `expiresIn` ou `dueAt` gera um novo QR Code (o anterior deixa de valer).\n\nEscopo: `charges.write`.",
        "tags": [
          "Cobranças Pix"
        ],
        "security": [
          {
            "bearerAuth": [
              "charges.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/cobrancas#update-charge"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id da cobrança (`chg_…`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Charge"
                },
                "example": {
                  "id": "chg_034yDKstyRbto2AiOEPZJP",
                  "externalId": "order-4821",
                  "txid": "0f6a1c2e9b7d4e3fa1b2c3d4e5f60718",
                  "status": "active",
                  "amount": 3500,
                  "feeAmount": 35,
                  "netAmount": 3465,
                  "currency": "BRL",
                  "description": "Pedido 4821",
                  "copyPaste": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "qrCode": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "expiresAt": "2026-11-15T23:10:00.000Z",
                  "dueAt": null,
                  "endToEndId": null,
                  "pixInId": null,
                  "paidAt": null,
                  "createdAt": "2026-11-15T21:00:00.000Z",
                  "updatedAt": "2026-11-15T21:10:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "CHARGE_NOT_EDITABLE: A cobrança já foi paga, expirou ou foi cancelada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChargeUpdate"
              },
              "example": {
                "amount": 3500,
                "expiresIn": 7200
              }
            }
          }
        }
      }
    },
    "/charges/{id}/cancel": {
      "post": {
        "operationId": "cancelCharge",
        "summary": "Cancelar uma cobrança",
        "description": "O QR Code deixa de aceitar pagamento. Dispara `charge.canceled`. Cancelar de novo devolve a mesma cobrança.\n\nEscopo: `charges.write`.",
        "tags": [
          "Cobranças Pix"
        ],
        "security": [
          {
            "bearerAuth": [
              "charges.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/cobrancas#cancel-charge"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id da cobrança (`chg_…`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Charge"
                },
                "example": {
                  "id": "chg_034yDKstyRbto2AiOEPZJP",
                  "externalId": "order-4821",
                  "txid": "0f6a1c2e9b7d4e3fa1b2c3d4e5f60718",
                  "status": "canceled",
                  "amount": 3000,
                  "feeAmount": 30,
                  "netAmount": 2970,
                  "currency": "BRL",
                  "description": "Pedido 4821",
                  "copyPaste": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "qrCode": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "expiresAt": "2026-11-15T22:00:00.000Z",
                  "dueAt": null,
                  "endToEndId": null,
                  "pixInId": null,
                  "paidAt": null,
                  "createdAt": "2026-11-15T21:00:00.000Z",
                  "updatedAt": "2026-11-15T21:20:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "CHARGE_ALREADY_PAID: Cobrança paga não pode ser cancelada. Use uma devolução.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/pix-in": {
      "get": {
        "operationId": "listPixIn",
        "summary": "Listar Pix recebidos",
        "description": "Escopo: `charges.read`.",
        "tags": [
          "Pix recebidos"
        ],
        "security": [
          {
            "bearerAuth": [
              "charges.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/pix-recebidos#list-pix-in"
        },
        "parameters": [
          {
            "name": "endToEndId",
            "in": "query",
            "required": false,
            "description": "E2E do Pix.",
            "schema": {
              "type": "string",
              "description": "E2E do Pix."
            }
          },
          {
            "name": "externalId",
            "in": "query",
            "required": false,
            "description": "O `externalId` da cobrança.",
            "schema": {
              "type": "string",
              "description": "O externalId da cobrança."
            }
          },
          {
            "name": "chargeId",
            "in": "query",
            "required": false,
            "description": "Id da cobrança (`chg_…`).",
            "schema": {
              "type": "string",
              "description": "Id da cobrança (chg_…)."
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "Pagos a partir de (ISO 8601 UTC).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Pagos a partir de (ISO 8601 UTC)."
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Pagos até (ISO 8601 UTC).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Pagos até (ISO 8601 UTC)."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Itens por página. Padrão 25, máximo 100.",
            "schema": {
              "type": "integer",
              "description": "Itens por página. Padrão 25, máximo 100."
            }
          },
          {
            "name": "startingAfter",
            "in": "query",
            "required": false,
            "description": "Cursor: o `id` (`pxi_…`) do último item da página anterior.",
            "schema": {
              "type": "string",
              "description": "Cursor: o id (pxi_…) do último item da página anterior."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PixInList"
                },
                "example": {
                  "data": [
                    {
                      "id": "pxi_034yDKu1QwzR8mJb3XyTnE",
                      "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                      "externalId": "order-4821",
                      "endToEndId": "E18236120202611152100abcdef123456",
                      "amount": 3000,
                      "feeAmount": 30,
                      "netAmount": 2970,
                      "status": "paid",
                      "paidAt": "2026-11-15T21:05:00.000Z"
                    }
                  ],
                  "hasMore": true,
                  "nextCursor": "pxi_034yDKu1QwzR8mJb3XyTnE"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/statement": {
      "get": {
        "operationId": "getStatement",
        "summary": "Extrato",
        "description": "Escopo: `statement.read`.",
        "tags": [
          "Extrato e transações"
        ],
        "security": [
          {
            "bearerAuth": [
              "statement.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/extrato#get-statement"
        },
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "A partir de (ISO 8601 UTC).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "A partir de (ISO 8601 UTC)."
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Até (ISO 8601 UTC).",
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Até (ISO 8601 UTC)."
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "Entradas ou saídas.",
            "schema": {
              "type": "string",
              "enum": [
                "credit",
                "debit"
              ],
              "description": "Entradas ou saídas."
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Tipo do lançamento.",
            "schema": {
              "type": "string",
              "enum": [
                "pix.in",
                "pix.out",
                "pix.refund",
                "fee",
                "med.block",
                "med.release"
              ],
              "description": "Tipo do lançamento."
            }
          },
          {
            "name": "endToEndId",
            "in": "query",
            "required": false,
            "description": "E2E exato.",
            "schema": {
              "type": "string",
              "description": "E2E exato."
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Busca em descrição, contraparte e E2E.",
            "schema": {
              "type": "string",
              "description": "Busca em descrição, contraparte e E2E."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Itens por página. Padrão 25, máximo 100.",
            "schema": {
              "type": "integer",
              "description": "Itens por página. Padrão 25, máximo 100."
            }
          },
          {
            "name": "startingAfter",
            "in": "query",
            "required": false,
            "description": "Cursor: o `id` (`led_…`) do último item da página anterior.",
            "schema": {
              "type": "string",
              "description": "Cursor: o id (led_…) do último item da página anterior."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Statement"
                },
                "example": {
                  "balance": {
                    "available": 150000,
                    "blocked": 3000,
                    "currency": "BRL"
                  },
                  "data": [
                    {
                      "id": "led_034yDL2LR7ApHJz6N8dar3",
                      "direction": "credit",
                      "type": "pix.in",
                      "amount": 3000,
                      "feeAmount": 30,
                      "netAmount": 2970,
                      "totalAmount": null,
                      "balanceAfter": 150000,
                      "description": "Pix recebido",
                      "endToEndId": "E18236120202611152100abcdef123456",
                      "referenceId": "chg_034yDKstyRbto2AiOEPZJP",
                      "referenceType": "pixCharge",
                      "createdAt": "2026-11-15T21:05:00.000Z"
                    }
                  ],
                  "hasMore": false,
                  "nextCursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/transactions/{id}": {
      "get": {
        "operationId": "getTransaction",
        "summary": "Status de uma transação",
        "description": "Aceita `chg_…`, `pxo_…` (saque ou parcela) e `rfd_…`. O `type` da resposta diz qual recurso é.\n\nEscopo: `statement.read`.",
        "tags": [
          "Extrato e transações"
        ],
        "security": [
          {
            "bearerAuth": [
              "statement.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/extrato#get-transaction"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id público da cobrança, saque ou devolução.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transaction"
                },
                "example": {
                  "id": "chg_034yDKstyRbto2AiOEPZJP",
                  "type": "charge",
                  "externalId": "order-4821",
                  "status": "paid",
                  "amount": 3000,
                  "endToEndId": "E18236120202611152100abcdef123456",
                  "createdAt": "2026-11-15T21:00:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "ID_PREFIX_MISMATCH: O prefixo não é de cobrança, saque ou devolução.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/transactions": {
      "get": {
        "operationId": "findTransactions",
        "summary": "Buscar por externalId",
        "description": "Procura o `externalId` em cobranças, saques e devoluções.\n\nEscopo: `statement.read`.",
        "tags": [
          "Extrato e transações"
        ],
        "security": [
          {
            "bearerAuth": [
              "statement.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/extrato#find-transactions"
        },
        "parameters": [
          {
            "name": "externalId",
            "in": "query",
            "required": true,
            "description": "Seu identificador.",
            "schema": {
              "type": "string",
              "description": "Seu identificador."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionList"
                },
                "example": {
                  "data": [
                    {
                      "id": "chg_034yDKstyRbto2AiOEPZJP",
                      "type": "charge",
                      "externalId": "order-4821",
                      "status": "paid",
                      "amount": 3000,
                      "endToEndId": "E18236120202611152100abcdef123456",
                      "createdAt": "2026-11-15T21:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/payments/preview": {
      "post": {
        "operationId": "previewPayment",
        "summary": "Validar chave e calcular tarifas",
        "description": "Consulta a chave no DICT e devolve o titular (documento mascarado), a instituição, se o titular é o próprio CNPJ, a tarifa, o total debitado e se o envio cabe nos limites. Não move saldo nem reserva valor.\n\nEscopo: `payments.read`.",
        "tags": [
          "Saques e pagamentos"
        ],
        "security": [
          {
            "bearerAuth": [
              "payments.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/saques#preview-payment"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentPreview"
                },
                "example": {
                  "recipient": {
                    "name": "Exemplo Comércio Ltda",
                    "taxIdMasked": "**.***.***/****-90",
                    "taxIdMatchesAccount": true,
                    "institution": "Nubank",
                    "pixKey": "12345678000190",
                    "pixKeyType": "cnpj"
                  },
                  "amount": 3000,
                  "feeAmount": 100,
                  "totalDebitAmount": 3100,
                  "currency": "BRL",
                  "chunkCount": 1,
                  "requiresChunkAcceptance": false,
                  "withinLimits": true
                }
              }
            }
          },
          "400": {
            "description": "INVALID_PIX_KEY: Chave inválida ou inexistente no DICT.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "PAYOUT_API_DISABLED: Saque por API não liberado na conta. · PAYOUT_OTHER_HOLDER_NOT_ALLOWED: A chave é de outro titular e a conta não tem essa liberação.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "502": {
            "description": "DICT_UNAVAILABLE: Consulta ao DICT indisponível. Tente de novo.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentPreviewRequest"
              },
              "example": {
                "amount": 3000,
                "pixKey": "12345678000190",
                "pixKeyType": "cnpj"
              }
            }
          }
        }
      }
    },
    "/payments": {
      "post": {
        "operationId": "createPayment",
        "summary": "Enviar um Pix (saque)",
        "description": "Refaz a consulta da chave e as checagens de permissão, limite e saldo no momento do envio. Valores acima do teto por transação (`fees.pixOutMaxChunkAmount`) são divididos em parcelas e exigem `acceptedChunking: true`. Webhooks: `pix.out.queued`, depois `pix.out.settled` ou `pix.out.failed` por parcela.\n\nEscopo: `payments.write`.",
        "tags": [
          "Saques e pagamentos"
        ],
        "security": [
          {
            "bearerAuth": [
              "payments.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/saques#create-payment"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentBatch"
                },
                "example": {
                  "id": "pxo_034yDKxchvscPntZMUrVfI",
                  "externalId": "payout-4821",
                  "status": "completed",
                  "pixKey": "12345678000190",
                  "amount": 3000,
                  "feeAmount": 100,
                  "totalDebitAmount": 3100,
                  "chunkCount": 1,
                  "payments": [
                    {
                      "id": "pxo_034yDKzCHd3nFfQ6o64Mun",
                      "amount": 3000,
                      "feeAmount": 100,
                      "totalAmount": 3100,
                      "status": "settled",
                      "endToEndId": "E12345678202611152110abcdef654321",
                      "failureReason": null
                    }
                  ],
                  "createdAt": "2026-11-15T21:10:00.000Z",
                  "updatedAt": "2026-11-15T21:10:02.000Z"
                }
              }
            }
          },
          "400": {
            "description": "INSUFFICIENT_BALANCE: Saldo insuficiente para valor + tarifas. · CHUNKING_ACCEPTANCE_REQUIRED: Valor acima do teto sem `acceptedChunking: true`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "PAYOUT_API_DISABLED: Saque por API não liberado na conta. · PAYOUT_OTHER_HOLDER_NOT_ALLOWED: A chave é de outro titular e a conta não tem essa liberação. · LIMIT_EXCEEDED: Passa do limite da janela atual (diurna ou noturna).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "EXTERNAL_ID_CONFLICT: Já existe saque com este `externalId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentCreate"
              },
              "example": {
                "amount": 3000,
                "pixKey": "12345678000190",
                "pixKeyType": "cnpj",
                "description": "Repasse pedido 4821",
                "externalId": "payout-4821"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "findPayment",
        "summary": "Buscar saque por externalId",
        "description": "Escopo: `payments.read`.",
        "tags": [
          "Saques e pagamentos"
        ],
        "security": [
          {
            "bearerAuth": [
              "payments.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/saques#find-payment"
        },
        "parameters": [
          {
            "name": "externalId",
            "in": "query",
            "required": true,
            "description": "Seu identificador.",
            "schema": {
              "type": "string",
              "description": "Seu identificador."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentBatch"
                },
                "example": {
                  "id": "pxo_034yDKxchvscPntZMUrVfI",
                  "externalId": "payout-4821",
                  "status": "completed",
                  "pixKey": "12345678000190",
                  "amount": 3000,
                  "feeAmount": 100,
                  "totalDebitAmount": 3100,
                  "chunkCount": 1,
                  "payments": [
                    {
                      "id": "pxo_034yDKzCHd3nFfQ6o64Mun",
                      "amount": 3000,
                      "feeAmount": 100,
                      "totalAmount": 3100,
                      "status": "settled",
                      "endToEndId": "E12345678202611152110abcdef654321",
                      "failureReason": null
                    }
                  ],
                  "createdAt": "2026-11-15T21:10:00.000Z",
                  "updatedAt": "2026-11-15T21:10:02.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/payments/{id}": {
      "get": {
        "operationId": "getPayment",
        "summary": "Consultar um saque",
        "description": "Aceita o id do saque ou de uma parcela (ambos `pxo_…`).\n\nEscopo: `payments.read`.",
        "tags": [
          "Saques e pagamentos"
        ],
        "security": [
          {
            "bearerAuth": [
              "payments.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/saques#get-payment"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id do saque (`pxo_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentBatch"
                },
                "example": {
                  "id": "pxo_034yDKxchvscPntZMUrVfI",
                  "externalId": "payout-4821",
                  "status": "completed",
                  "pixKey": "12345678000190",
                  "amount": 3000,
                  "feeAmount": 100,
                  "totalDebitAmount": 3100,
                  "chunkCount": 1,
                  "payments": [
                    {
                      "id": "pxo_034yDKzCHd3nFfQ6o64Mun",
                      "amount": 3000,
                      "feeAmount": 100,
                      "totalAmount": 3100,
                      "status": "settled",
                      "endToEndId": "E12345678202611152110abcdef654321",
                      "failureReason": null
                    }
                  ],
                  "createdAt": "2026-11-15T21:10:00.000Z",
                  "updatedAt": "2026-11-15T21:10:02.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "NOT_FOUND: Saque não encontrado nesta conta.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/refunds": {
      "post": {
        "operationId": "createRefund",
        "summary": "Solicitar uma devolução",
        "description": "Informe a cobrança por `chargeId` ou pelo `endToEndId` do Pix recebido.\n\nEscopo: `refunds.write`.",
        "tags": [
          "Devoluções"
        ],
        "security": [
          {
            "bearerAuth": [
              "refunds.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/devolucoes#create-refund"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refund"
                },
                "example": {
                  "id": "rfd_034yDL0aB7cD9eF1gH2iJ3",
                  "externalId": "refund-4821",
                  "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                  "endToEndId": "D12345678202611161230abcdef987654",
                  "amount": 3000,
                  "feeAmount": 0,
                  "status": "completed",
                  "origin": "spontaneous",
                  "reason": "Cliente desistiu da compra",
                  "failureReason": null,
                  "createdAt": "2026-11-16T12:30:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "REFUND_TOO_HIGH: Passa do líquido creditado. · INVALID_CHARGE: Cobrança não paga ou não encontrada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "EXTERNAL_ID_CONFLICT: Já existe devolução com este `externalId`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundCreate"
              },
              "example": {
                "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                "amount": 3000,
                "externalId": "refund-4821",
                "reason": "Cliente desistiu da compra"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listRefunds",
        "summary": "Buscar devoluções",
        "description": "Com `chargeId`, lista as devoluções da cobrança. Com só `externalId`, devolve a devolução direto.\n\nEscopo: `refunds.read`.",
        "tags": [
          "Devoluções"
        ],
        "security": [
          {
            "bearerAuth": [
              "refunds.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/devolucoes#list-refunds"
        },
        "parameters": [
          {
            "name": "chargeId",
            "in": "query",
            "required": false,
            "description": "Id da cobrança (`chg_…`).",
            "schema": {
              "type": "string",
              "description": "Id da cobrança (chg_…)."
            }
          },
          {
            "name": "externalId",
            "in": "query",
            "required": false,
            "description": "Seu identificador.",
            "schema": {
              "type": "string",
              "description": "Seu identificador."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundList"
                },
                "example": {
                  "data": [
                    {
                      "id": "rfd_034yDL0aB7cD9eF1gH2iJ3",
                      "externalId": "refund-4821",
                      "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                      "endToEndId": "D12345678202611161230abcdef987654",
                      "amount": 3000,
                      "feeAmount": 0,
                      "status": "completed",
                      "origin": "spontaneous",
                      "reason": "Cliente desistiu da compra",
                      "failureReason": null,
                      "createdAt": "2026-11-16T12:30:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/refunds/{id}": {
      "get": {
        "operationId": "getRefund",
        "summary": "Consultar uma devolução",
        "description": "Escopo: `refunds.read`.",
        "tags": [
          "Devoluções"
        ],
        "security": [
          {
            "bearerAuth": [
              "refunds.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/devolucoes#get-refund"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id da devolução (`rfd_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Refund"
                },
                "example": {
                  "id": "rfd_034yDL0aB7cD9eF1gH2iJ3",
                  "externalId": "refund-4821",
                  "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                  "endToEndId": "D12345678202611161230abcdef987654",
                  "amount": 3000,
                  "feeAmount": 0,
                  "status": "completed",
                  "origin": "spontaneous",
                  "reason": "Cliente desistiu da compra",
                  "failureReason": null,
                  "createdAt": "2026-11-16T12:30:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/meds": {
      "get": {
        "operationId": "listMeds",
        "summary": "Listar MEDs",
        "description": "Escopo: `meds.read`.",
        "tags": [
          "MED"
        ],
        "security": [
          {
            "bearerAuth": [
              "meds.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/meds#list-meds"
        },
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filtra pelo estado.",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "contested",
                "refundPending",
                "review",
                "expired",
                "resolvedSpontaneous",
                "closedFavor",
                "closedUnfavor"
              ],
              "description": "Filtra pelo estado."
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Itens por página. Padrão 25, máximo 100.",
            "schema": {
              "type": "integer",
              "description": "Itens por página. Padrão 25, máximo 100."
            }
          },
          {
            "name": "startingAfter",
            "in": "query",
            "required": false,
            "description": "Cursor: o `id` (`med_…`) do último item da página anterior.",
            "schema": {
              "type": "string",
              "description": "Cursor: o id (med_…) do último item da página anterior."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedList"
                },
                "example": {
                  "data": [
                    {
                      "id": "med_034yDL4kQ2wE5rT7yU9iO1",
                      "endToEndId": "E18236120202611152100abcdef123456",
                      "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                      "status": "open",
                      "amount": 3000,
                      "blockedAmount": 3000,
                      "reason": "Pagador relata golpe",
                      "openedAt": "2026-11-16T10:00:00.000Z",
                      "deadlineAt": "2026-11-23T10:00:00.000Z",
                      "updatedAt": "2026-11-16T10:00:00.000Z",
                      "infractionOutcome": null,
                      "reviewRequired": false,
                      "reviewReason": null,
                      "defense": null,
                      "refund": null
                    }
                  ],
                  "hasMore": true,
                  "nextCursor": "med_034yDL4kQ2wE5rT7yU9iO1"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/meds/{id}": {
      "get": {
        "operationId": "getMed",
        "summary": "Consultar um MED",
        "description": "Escopo: `meds.read`.",
        "tags": [
          "MED"
        ],
        "security": [
          {
            "bearerAuth": [
              "meds.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/meds#get-med"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id do MED (`med_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Med"
                },
                "example": {
                  "id": "med_034yDL4kQ2wE5rT7yU9iO1",
                  "endToEndId": "E18236120202611152100abcdef123456",
                  "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                  "status": "open",
                  "amount": 3000,
                  "blockedAmount": 3000,
                  "reason": "Pagador relata golpe",
                  "openedAt": "2026-11-16T10:00:00.000Z",
                  "deadlineAt": "2026-11-23T10:00:00.000Z",
                  "updatedAt": "2026-11-16T10:00:00.000Z",
                  "infractionOutcome": null,
                  "reviewRequired": false,
                  "reviewReason": null,
                  "defense": null,
                  "refund": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/meds/{id}/contest": {
      "post": {
        "operationId": "contestMed",
        "summary": "Contestar um MED",
        "description": "Envie a defesa em `multipart/form-data`: o campo `statement` (texto, mínimo 8 caracteres) e até 5 arquivos em `files` (PDF, JPG ou PNG, até 10 MB cada). Sem anexos, também aceita JSON `{ \"statement\": \"…\" }`. Só MEDs `open`.\n\nEscopo: `meds.write`.",
        "tags": [
          "MED"
        ],
        "security": [
          {
            "bearerAuth": [
              "meds.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/meds#contest-med"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id do MED (`med_…`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Med"
                },
                "example": {
                  "id": "med_034yDL4kQ2wE5rT7yU9iO1",
                  "endToEndId": "E18236120202611152100abcdef123456",
                  "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                  "status": "contested",
                  "amount": 3000,
                  "blockedAmount": 3000,
                  "reason": "Pagador relata golpe",
                  "openedAt": "2026-11-16T10:00:00.000Z",
                  "deadlineAt": "2026-11-23T10:00:00.000Z",
                  "updatedAt": "2026-11-16T11:00:00.000Z",
                  "infractionOutcome": null,
                  "reviewRequired": false,
                  "reviewReason": null,
                  "defense": {
                    "statement": "Entrega confirmada em 15/11; segue nota fiscal e comprovante de entrega.",
                    "fileCount": 2,
                    "submittedAt": "2026-11-16T11:00:00.000Z"
                  },
                  "refund": null
                }
              }
            }
          },
          "400": {
            "description": "VALIDATION_ERROR: Defesa curta, mais de 5 anexos ou arquivo inválido.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "MED_NOT_CONTESTABLE: O MED não está mais aberto.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MedContest"
              },
              "example": {
                "statement": "Entrega confirmada em 15/11; segue nota fiscal e comprovante de entrega."
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "statement"
                ],
                "properties": {
                  "statement": {
                    "type": "string"
                  },
                  "files": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "type": "string",
                      "format": "binary"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/meds/{id}/spontaneous-refund": {
      "post": {
        "operationId": "refundMed",
        "summary": "Devolver (recusar o MED e devolver o Pix)",
        "description": "Recusa a infração e faz uma devolução espontânea comum do valor (ou de parte dele). Não é aceite do MED. Vale para MEDs `open`, `contested` ou `review` com `reviewReason: refundFailed` (nova tentativa). O MED só vira `resolvedSpontaneous`, e o bloqueio só é baixado, quando a devolução conclui. Enquanto ela estiver `pending`, o MED fica em `refundPending` com o valor bloqueado e o encerramento chega por `med.updated`. Se a devolução falhar (`pix.refund.failed`), o MED vai para `review` com `reviewReason: refundFailed` e o valor segue bloqueado.\n\nEscopo: `meds.write`.",
        "tags": [
          "MED"
        ],
        "security": [
          {
            "bearerAuth": [
              "meds.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/meds#refund-med"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id do MED (`med_…`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MedWithRefund"
                },
                "example": {
                  "id": "med_034yDL4kQ2wE5rT7yU9iO1",
                  "endToEndId": "E18236120202611152100abcdef123456",
                  "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                  "status": "resolvedSpontaneous",
                  "amount": 3000,
                  "blockedAmount": 0,
                  "reason": "Pagador relata golpe",
                  "openedAt": "2026-11-16T10:00:00.000Z",
                  "deadlineAt": "2026-11-23T10:00:00.000Z",
                  "updatedAt": "2026-11-16T10:00:00.000Z",
                  "infractionOutcome": "rejected",
                  "reviewRequired": false,
                  "reviewReason": null,
                  "defense": null,
                  "refund": {
                    "id": "rfd_034yDL0aB7cD9eF1gH2iJ3",
                    "externalId": "med-refund-4821",
                    "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                    "endToEndId": "D12345678202611161230abcdef987654",
                    "amount": 3000,
                    "feeAmount": 0,
                    "status": "completed",
                    "origin": "spontaneous",
                    "reason": "Devolução ao pagador",
                    "failureReason": null,
                    "createdAt": "2026-11-16T12:30:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "INSUFFICIENT_BALANCE: O bloqueio do MED mais o disponível não cobrem o valor.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "MED_NOT_RESOLVABLE: O MED não está aberto, contestado ou em revisão por devolução falha (ou já há uma devolução em andamento).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MedRefund"
              },
              "example": {
                "externalId": "med-refund-4821",
                "reason": "Devolução ao pagador"
              }
            }
          }
        }
      }
    },
    "/webhooks/endpoints": {
      "post": {
        "operationId": "createWebhook",
        "summary": "Cadastrar um endpoint",
        "description": "Escopo: `webhooks.write`.",
        "tags": [
          "Endpoints de webhook"
        ],
        "security": [
          {
            "bearerAuth": [
              "webhooks.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/webhooks#create-webhook"
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "201": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                },
                "example": {
                  "id": "whk_034yDL6mN8bV0cX2zL4kJ6",
                  "url": "https://seu-sistema.com.br/webhooks/onzepay",
                  "events": [
                    "charge.paid",
                    "charge.expired",
                    "pix.refund.failed",
                    "med.opened",
                    "med.updated"
                  ],
                  "errorNotificationEmail": "dev@seu-sistema.com.br",
                  "autoPauseOnFailure": true,
                  "isPaused": false,
                  "status": "active",
                  "createdAt": "2026-11-15T20:00:00.000Z",
                  "updatedAt": "2026-11-15T20:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "EVENTS_REQUIRED: Nenhum evento informado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointCreate"
              },
              "example": {
                "url": "https://seu-sistema.com.br/webhooks/onzepay",
                "events": [
                  "charge.paid",
                  "charge.expired",
                  "pix.refund.failed",
                  "med.opened",
                  "med.updated"
                ],
                "errorNotificationEmail": "dev@seu-sistema.com.br"
              }
            }
          }
        }
      },
      "get": {
        "operationId": "listWebhooks",
        "summary": "Listar endpoints",
        "description": "Escopo: `webhooks.read`.",
        "tags": [
          "Endpoints de webhook"
        ],
        "security": [
          {
            "bearerAuth": [
              "webhooks.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/webhooks#list-webhooks"
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                },
                "example": {
                  "data": [
                    {
                      "id": "whk_034yDL6mN8bV0cX2zL4kJ6",
                      "url": "https://seu-sistema.com.br/webhooks/onzepay",
                      "events": [
                        "charge.paid",
                        "charge.expired",
                        "pix.refund.failed",
                        "med.opened",
                        "med.updated"
                      ],
                      "errorNotificationEmail": "dev@seu-sistema.com.br",
                      "autoPauseOnFailure": true,
                      "isPaused": false,
                      "status": "active",
                      "createdAt": "2026-11-15T20:00:00.000Z",
                      "updatedAt": "2026-11-15T20:00:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks/endpoints/{id}": {
      "get": {
        "operationId": "getWebhook",
        "summary": "Consultar um endpoint",
        "description": "Escopo: `webhooks.read`.",
        "tags": [
          "Endpoints de webhook"
        ],
        "security": [
          {
            "bearerAuth": [
              "webhooks.read"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/webhooks#get-webhook"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id do endpoint (`whk_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                },
                "example": {
                  "id": "whk_034yDL6mN8bV0cX2zL4kJ6",
                  "url": "https://seu-sistema.com.br/webhooks/onzepay",
                  "events": [
                    "charge.paid",
                    "charge.expired",
                    "pix.refund.failed",
                    "med.opened",
                    "med.updated"
                  ],
                  "errorNotificationEmail": "dev@seu-sistema.com.br",
                  "autoPauseOnFailure": true,
                  "isPaused": false,
                  "status": "active",
                  "createdAt": "2026-11-15T20:00:00.000Z",
                  "updatedAt": "2026-11-15T20:00:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "operationId": "updateWebhook",
        "summary": "Alterar um endpoint",
        "description": "Envie só os campos que mudam. `isPaused: false` reativa um endpoint pausado.\n\nEscopo: `webhooks.write`.",
        "tags": [
          "Endpoints de webhook"
        ],
        "security": [
          {
            "bearerAuth": [
              "webhooks.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/webhooks#update-webhook"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id do endpoint (`whk_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                },
                "example": {
                  "id": "whk_034yDL6mN8bV0cX2zL4kJ6",
                  "url": "https://seu-sistema.com.br/webhooks/onzepay",
                  "events": [
                    "pix.in.received",
                    "pix.refund.completed",
                    "pix.refund.failed"
                  ],
                  "errorNotificationEmail": "dev@seu-sistema.com.br",
                  "autoPauseOnFailure": true,
                  "isPaused": false,
                  "status": "active",
                  "createdAt": "2026-11-15T20:00:00.000Z",
                  "updatedAt": "2026-11-15T20:00:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointUpdate"
              },
              "example": {
                "isPaused": false,
                "events": [
                  "pix.in.received",
                  "pix.refund.completed",
                  "pix.refund.failed"
                ]
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhook",
        "summary": "Remover um endpoint",
        "description": "Escopo: `webhooks.write`.",
        "tags": [
          "Endpoints de webhook"
        ],
        "security": [
          {
            "bearerAuth": [
              "webhooks.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/webhooks#delete-webhook"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id do endpoint (`whk_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Sem conteúdo"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks/endpoints/{id}/test": {
      "post": {
        "operationId": "testWebhook",
        "summary": "Enviar evento de teste",
        "description": "Envia um `webhook.test` assinado para a URL e devolve o status HTTP que ela respondeu. Limite próprio: 10 por minuto.\n\nEscopo: `webhooks.write`.",
        "tags": [
          "Endpoints de webhook"
        ],
        "security": [
          {
            "bearerAuth": [
              "webhooks.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/webhooks#test-webhook"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id do endpoint (`whk_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookTestResult"
                },
                "example": {
                  "delivered": true,
                  "status": 200,
                  "body": "ok"
                }
              }
            }
          },
          "400": {
            "description": "WEBHOOK_TEST_FAILED: A URL não respondeu (DNS, TLS ou tempo esgotado).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/webhooks/deliveries/{id}/retry": {
      "post": {
        "operationId": "retryDelivery",
        "summary": "Reenviar uma entrega",
        "description": "Coloca a entrega (`evt_…`, o mesmo `id` do evento recebido) de volta na fila.\n\nEscopo: `webhooks.write`.",
        "tags": [
          "Endpoints de webhook"
        ],
        "security": [
          {
            "bearerAuth": [
              "webhooks.write"
            ]
          }
        ],
        "externalDocs": {
          "url": "https://docs.onzepay.com/api/webhooks#retry-delivery"
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Id do evento (`evt_…`).",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                },
                "example": {
                  "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                  "type": "charge.paid",
                  "status": "queued",
                  "attemptCount": 2,
                  "createdAt": "2026-11-15T21:05:01.000Z",
                  "updatedAt": "2026-11-15T21:40:00.000Z"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "409": {
            "description": "IDEMPOTENCY_CONFLICT: Esta entrega já foi concluída.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "webhooks": {
    "charge.paid": {
      "post": {
        "operationId": "webhook_charge_paid",
        "summary": "charge.paid",
        "description": "A cobrança foi paga. `data` é a cobrança (`chg_…`), com `pixInId` do Pix recebido. Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "charge.paid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "charge.paid"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "txid": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "feeAmount": {
                        "type": "integer"
                      },
                      "netAmount": {
                        "type": "integer"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "copyPaste": {
                        "type": "string"
                      },
                      "qrCode": {
                        "type": "string"
                      },
                      "expiresAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "dueAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "endToEndId": {
                        "type": "string"
                      },
                      "pixInId": {
                        "type": "string"
                      },
                      "paidAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "charge.paid",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "id": "chg_034yDKstyRbto2AiOEPZJP",
                  "externalId": "order-4821",
                  "txid": "0f6a1c2e9b7d4e3fa1b2c3d4e5f60718",
                  "status": "paid",
                  "amount": 3000,
                  "feeAmount": 30,
                  "netAmount": 2970,
                  "currency": "BRL",
                  "description": "Pedido 4821",
                  "copyPaste": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "qrCode": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "expiresAt": "2026-11-15T22:00:00.000Z",
                  "dueAt": null,
                  "endToEndId": "E18236120202611152100abcdef123456",
                  "pixInId": "pxi_034yDKu1QwzR8mJb3XyTnE",
                  "paidAt": "2026-11-15T21:05:00.000Z",
                  "createdAt": "2026-11-15T21:00:00.000Z",
                  "updatedAt": "2026-11-15T21:05:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "charge.expired": {
      "post": {
        "operationId": "webhook_charge_expired",
        "summary": "charge.expired",
        "description": "A cobrança venceu sem pagamento. `data` é a cobrança. Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "charge.expired"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "charge.expired"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "txid": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "feeAmount": {
                        "type": "integer"
                      },
                      "netAmount": {
                        "type": "integer"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "copyPaste": {
                        "type": "string"
                      },
                      "qrCode": {
                        "type": "string"
                      },
                      "expiresAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "dueAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "endToEndId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "pixInId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "paidAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "charge.expired",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "id": "chg_034yDKstyRbto2AiOEPZJP",
                  "externalId": "order-4821",
                  "txid": "0f6a1c2e9b7d4e3fa1b2c3d4e5f60718",
                  "status": "expired",
                  "amount": 3000,
                  "feeAmount": 30,
                  "netAmount": 2970,
                  "currency": "BRL",
                  "description": "Pedido 4821",
                  "copyPaste": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "qrCode": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "expiresAt": "2026-11-15T22:00:00.000Z",
                  "dueAt": null,
                  "endToEndId": null,
                  "pixInId": null,
                  "paidAt": null,
                  "createdAt": "2026-11-15T21:00:00.000Z",
                  "updatedAt": "2026-11-15T22:00:05.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "charge.canceled": {
      "post": {
        "operationId": "webhook_charge_canceled",
        "summary": "charge.canceled",
        "description": "A cobrança foi cancelada. `data` é a cobrança. Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "charge.canceled"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "charge.canceled"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "txid": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "feeAmount": {
                        "type": "integer"
                      },
                      "netAmount": {
                        "type": "integer"
                      },
                      "currency": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "copyPaste": {
                        "type": "string"
                      },
                      "qrCode": {
                        "type": "string"
                      },
                      "expiresAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "dueAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "endToEndId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "pixInId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "paidAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "updatedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "charge.canceled",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "id": "chg_034yDKstyRbto2AiOEPZJP",
                  "externalId": "order-4821",
                  "txid": "0f6a1c2e9b7d4e3fa1b2c3d4e5f60718",
                  "status": "canceled",
                  "amount": 3000,
                  "feeAmount": 30,
                  "netAmount": 2970,
                  "currency": "BRL",
                  "description": "Pedido 4821",
                  "copyPaste": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "qrCode": "00020126580014br.gov.bcb.pix0136…6304ABCD",
                  "expiresAt": "2026-11-15T22:00:00.000Z",
                  "dueAt": null,
                  "endToEndId": null,
                  "pixInId": null,
                  "paidAt": null,
                  "createdAt": "2026-11-15T21:00:00.000Z",
                  "updatedAt": "2026-11-15T21:20:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "pix.in.received": {
      "post": {
        "operationId": "webhook_pix_in_received",
        "summary": "pix.in.received",
        "description": "Entrou um Pix na conta, com ou sem cobrança. `data` é o Pix recebido (`pxi_…`), com `chargeId` quando houver cobrança. Uma cobrança paga dispara `charge.paid` e `pix.in.received`. Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "pix.in.received"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "pix.in.received"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "chargeId": {
                        "type": "string"
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "endToEndId": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "feeAmount": {
                        "type": "integer"
                      },
                      "netAmount": {
                        "type": "integer"
                      },
                      "status": {
                        "type": "string"
                      },
                      "paidAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "pix.in.received",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "id": "pxi_034yDKu1QwzR8mJb3XyTnE",
                  "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                  "externalId": "order-4821",
                  "endToEndId": "E18236120202611152100abcdef123456",
                  "amount": 3000,
                  "feeAmount": 30,
                  "netAmount": 2970,
                  "status": "paid",
                  "paidAt": "2026-11-15T21:05:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "pix.out.queued": {
      "post": {
        "operationId": "webhook_pix_out_queued",
        "summary": "pix.out.queued",
        "description": "O saque entrou na fila de envio. Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "pix.out.queued"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "pix.out.queued"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "batchId": {
                        "type": "string"
                      },
                      "chunkCount": {
                        "type": "integer"
                      },
                      "totalAmount": {
                        "type": "integer"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "pix.out.queued",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "batchId": "pxo_034yDKxchvscPntZMUrVfI",
                  "chunkCount": 1,
                  "totalAmount": 3000
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "pix.out.settled": {
      "post": {
        "operationId": "webhook_pix_out_settled",
        "summary": "pix.out.settled",
        "description": "Uma parcela do saque foi liquidada. Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "pix.out.settled"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "pix.out.settled"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "paymentId": {
                        "type": "string"
                      },
                      "batchId": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "feeAmount": {
                        "type": "integer"
                      },
                      "totalAmount": {
                        "type": "integer"
                      },
                      "endToEndId": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "pix.out.settled",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "paymentId": "pxo_034yDKzCHd3nFfQ6o64Mun",
                  "batchId": "pxo_034yDKxchvscPntZMUrVfI",
                  "amount": 3000,
                  "feeAmount": 100,
                  "totalAmount": 3100,
                  "endToEndId": "E12345678202611152110abcdef654321"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "pix.out.failed": {
      "post": {
        "operationId": "webhook_pix_out_failed",
        "summary": "pix.out.failed",
        "description": "Uma parcela do saque falhou (o valor volta ao saldo). Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "pix.out.failed"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "pix.out.failed"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "paymentId": {
                        "type": "string"
                      },
                      "batchId": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "pix.out.failed",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "paymentId": "pxo_034yDKzCHd3nFfQ6o64Mun",
                  "batchId": "pxo_034yDKxchvscPntZMUrVfI",
                  "reason": "Conta de destino encerrada"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "pix.refund.completed": {
      "post": {
        "operationId": "webhook_pix_refund_completed",
        "summary": "pix.refund.completed",
        "description": "Uma devolução foi concluída. `data` é a devolução (`rfd_…`). Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "pix.refund.completed"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "pix.refund.completed"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "chargeId": {
                        "type": "string"
                      },
                      "endToEndId": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "feeAmount": {
                        "type": "integer"
                      },
                      "status": {
                        "type": "string"
                      },
                      "origin": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "failureReason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "pix.refund.completed",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "id": "rfd_034yDL0aB7cD9eF1gH2iJ3",
                  "externalId": "refund-4821",
                  "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                  "endToEndId": "D12345678202611161230abcdef987654",
                  "amount": 3000,
                  "feeAmount": 0,
                  "status": "completed",
                  "origin": "spontaneous",
                  "reason": "Cliente desistiu da compra",
                  "failureReason": null,
                  "createdAt": "2026-11-16T12:30:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "pix.refund.failed": {
      "post": {
        "operationId": "webhook_pix_refund_failed",
        "summary": "pix.refund.failed",
        "description": "O liquidante recusou a devolução. O saldo não é debitado; `failureReason` traz o motivo. Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "pix.refund.failed"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "pix.refund.failed"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "externalId": {
                        "type": "string"
                      },
                      "chargeId": {
                        "type": "string"
                      },
                      "endToEndId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "feeAmount": {
                        "type": "integer"
                      },
                      "status": {
                        "type": "string"
                      },
                      "origin": {
                        "type": "string"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "failureReason": {
                        "type": "string"
                      },
                      "createdAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "pix.refund.failed",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "id": "rfd_034yDL0aB7cD9eF1gH2iJ3",
                  "externalId": "refund-4821",
                  "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                  "endToEndId": null,
                  "amount": 3000,
                  "feeAmount": 0,
                  "status": "failed",
                  "origin": "spontaneous",
                  "reason": "Cliente desistiu da compra",
                  "failureReason": "Devolução recusada pelo liquidante",
                  "createdAt": "2026-11-16T12:30:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "med.opened": {
      "post": {
        "operationId": "webhook_med_opened",
        "summary": "med.opened",
        "description": "Um MED foi aberto contra um Pix recebido. O valor fica bloqueado. Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "med.opened"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "med.opened"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "endToEndId": {
                        "type": "string"
                      },
                      "chargeId": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "amount": {
                        "type": "integer"
                      },
                      "blockedAmount": {
                        "type": "integer"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "openedAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "deadlineAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "med.opened",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "id": "med_034yDL4kQ2wE5rT7yU9iO1",
                  "endToEndId": "E18236120202611152100abcdef123456",
                  "chargeId": "chg_034yDKstyRbto2AiOEPZJP",
                  "status": "open",
                  "amount": 3000,
                  "blockedAmount": 3000,
                  "reason": "Pagador relata golpe",
                  "openedAt": "2026-11-16T10:00:00.000Z",
                  "deadlineAt": "2026-11-23T10:00:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    },
    "med.updated": {
      "post": {
        "operationId": "webhook_med_updated",
        "summary": "med.updated",
        "description": "O MED mudou de estado (contestado, em revisão, vencido, resolvido). Assinado em `x-aurebank-signature` (HMAC-SHA256 hex do corpo com o seu whsec).",
        "parameters": [
          {
            "name": "x-aurebank-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-aurebank-event",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "med.updated"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "id",
                  "type",
                  "createdAt",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "pattern": "^evt_"
                  },
                  "type": {
                    "type": "string",
                    "const": "med.updated"
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "data": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string"
                      },
                      "blockedAmount": {
                        "type": "integer"
                      },
                      "deadlineAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              },
              "example": {
                "id": "evt_034yDL8pA1sD3fG5hJ7kL9",
                "type": "med.updated",
                "createdAt": "2026-11-16T10:00:01.000Z",
                "data": {
                  "id": "med_034yDL4kQ2wE5rT7yU9iO1",
                  "status": "contested",
                  "blockedAmount": 3000,
                  "deadlineAt": "2026-11-23T10:00:00.000Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Responda 2xx em até 10 s para confirmar o recebimento."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "sk_live_… | sk_test_…",
        "description": "Escopos: account.read, charges.read, charges.write, payments.read, payments.write, refunds.read, refunds.write, statement.read, meds.read, meds.write, webhooks.read, webhooks.write."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "Chave única por operação (mínimo 8 caracteres; use um UUID). Repetir a mesma chave com o mesmo corpo devolve a resposta original.",
        "schema": {
          "type": "string",
          "minLength": 8
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "INVALID_API_KEY",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "RateLimited": {
        "description": "RATE_LIMITED",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Limit": {
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Remaining": {
            "schema": {
              "type": "integer"
            }
          },
          "X-RateLimit-Reset": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "statusCode",
          "code",
          "message"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "statusCode": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "enum": [
              "VALIDATION_ERROR",
              "IDEMPOTENCY_KEY_REQUIRED",
              "INVALID_ID",
              "INVALID_PIX_KEY",
              "INSUFFICIENT_BALANCE",
              "CHUNKING_ACCEPTANCE_REQUIRED",
              "REFUND_TOO_HIGH",
              "INVALID_CHARGE",
              "INVALID_API_KEY",
              "IP_NOT_ALLOWED",
              "INSUFFICIENT_SCOPE",
              "ONBOARDING_REQUIRED",
              "ACCOUNT_NOT_PROVISIONED",
              "PAYOUT_API_DISABLED",
              "PAYOUT_OTHER_HOLDER_NOT_ALLOWED",
              "LIMIT_EXCEEDED",
              "NOT_FOUND",
              "ID_PREFIX_MISMATCH",
              "METHOD_NOT_ALLOWED",
              "IDEMPOTENCY_CONFLICT",
              "EXTERNAL_ID_CONFLICT",
              "CHARGE_NOT_EDITABLE",
              "CHARGE_ALREADY_PAID",
              "MED_NOT_CONTESTABLE",
              "MED_NOT_RESOLVABLE",
              "RATE_LIMITED",
              "DICT_RATE_LIMITED",
              "DICT_UNAVAILABLE",
              "PIX_PROVIDER_UNAVAILABLE"
            ]
          },
          "message": {
            "type": "string"
          },
          "details": {}
        }
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "cnpj": {
            "type": "string"
          },
          "legalName": {
            "type": "string"
          },
          "tradeName": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "environment": {
            "type": "string"
          },
          "limits": {
            "type": "object",
            "properties": {
              "daySendLimit": {
                "type": "integer"
              },
              "nightSendLimit": {
                "type": "integer"
              },
              "nightWindowStart": {
                "type": "string"
              },
              "nightWindowEnd": {
                "type": "string"
              },
              "timezone": {
                "type": "string"
              }
            }
          },
          "fees": {
            "type": "object",
            "properties": {
              "pixInFeeFixed": {
                "type": "integer"
              },
              "pixInFeePercent": {
                "type": "integer"
              },
              "pixOutFeeFixed": {
                "type": "integer"
              },
              "pixOutFeePercent": {
                "type": "integer"
              },
              "pixOutMaxChunkAmount": {
                "type": "integer"
              }
            }
          },
          "payout": {
            "type": "object",
            "properties": {
              "apiEnabled": {
                "type": "boolean"
              },
              "otherHoldersEnabled": {
                "type": "boolean"
              },
              "panelSameHolder": {
                "type": "boolean"
              }
            }
          },
          "pixKeys": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Balance": {
        "type": "object",
        "properties": {
          "available": {
            "type": "integer"
          },
          "blocked": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          }
        }
      },
      "ChargeCreate": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "Valor em centavos. 3000 = R$ 30,00."
          },
          "description": {
            "type": "string",
            "description": "Texto exibido ao pagador."
          },
          "externalId": {
            "type": "string",
            "description": "Seu identificador. Único por conta."
          },
          "expiresIn": {
            "type": "integer",
            "description": "Validade em segundos (cobrança imediata)."
          },
          "dueAt": {
            "type": "string",
            "format": "date-time",
            "description": "Vencimento em ISO 8601 UTC (cobrança com vencimento)."
          }
        },
        "required": [
          "amount"
        ]
      },
      "Charge": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "externalId": {
            "type": "string"
          },
          "txid": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "feeAmount": {
            "type": "integer"
          },
          "netAmount": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "copyPaste": {
            "type": "string"
          },
          "qrCode": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "dueAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "endToEndId": {
            "type": [
              "string",
              "null"
            ]
          },
          "pixInId": {
            "type": [
              "string",
              "null"
            ]
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ChargeList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "externalId": {
                  "type": "string"
                },
                "txid": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "feeAmount": {
                  "type": "integer"
                },
                "netAmount": {
                  "type": "integer"
                },
                "currency": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "copyPaste": {
                  "type": "string"
                },
                "qrCode": {
                  "type": "string"
                },
                "expiresAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "dueAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "endToEndId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "pixInId": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "paidAt": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": "string"
          }
        }
      },
      "ChargeUpdate": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "Novo valor em centavos."
          },
          "description": {
            "type": "string",
            "description": "Nova descrição."
          },
          "expiresIn": {
            "type": "integer",
            "description": "Nova validade em segundos a partir de agora."
          },
          "dueAt": {
            "type": "string",
            "format": "date-time",
            "description": "Novo vencimento (ISO 8601 UTC)."
          }
        }
      },
      "PixInList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "chargeId": {
                  "type": "string"
                },
                "externalId": {
                  "type": "string"
                },
                "endToEndId": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "feeAmount": {
                  "type": "integer"
                },
                "netAmount": {
                  "type": "integer"
                },
                "status": {
                  "type": "string"
                },
                "paidAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": "string"
          }
        }
      },
      "Statement": {
        "type": "object",
        "properties": {
          "balance": {
            "type": "object",
            "properties": {
              "available": {
                "type": "integer"
              },
              "blocked": {
                "type": "integer"
              },
              "currency": {
                "type": "string"
              }
            }
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "direction": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "feeAmount": {
                  "type": "integer"
                },
                "netAmount": {
                  "type": "integer"
                },
                "totalAmount": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "balanceAfter": {
                  "type": "integer"
                },
                "description": {
                  "type": "string"
                },
                "endToEndId": {
                  "type": "string"
                },
                "referenceId": {
                  "type": "string"
                },
                "referenceType": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "Transaction": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "externalId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "endToEndId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TransactionList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "externalId": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "endToEndId": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "PaymentPreviewRequest": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "Valor em centavos."
          },
          "pixKey": {
            "type": "string",
            "description": "Chave Pix do recebedor."
          },
          "pixKeyType": {
            "type": "string",
            "enum": [
              "cpf",
              "cnpj",
              "phone",
              "email",
              "evp"
            ],
            "description": "Tipo da chave. Sem ele, o tipo é detectado."
          }
        },
        "required": [
          "amount",
          "pixKey"
        ]
      },
      "PaymentPreview": {
        "type": "object",
        "properties": {
          "recipient": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "taxIdMasked": {
                "type": "string"
              },
              "taxIdMatchesAccount": {
                "type": "boolean"
              },
              "institution": {
                "type": "string"
              },
              "pixKey": {
                "type": "string"
              },
              "pixKeyType": {
                "type": "string"
              }
            }
          },
          "amount": {
            "type": "integer"
          },
          "feeAmount": {
            "type": "integer"
          },
          "totalDebitAmount": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "chunkCount": {
            "type": "integer"
          },
          "requiresChunkAcceptance": {
            "type": "boolean"
          },
          "withinLimits": {
            "type": "boolean"
          }
        }
      },
      "PaymentCreate": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "Valor em centavos."
          },
          "pixKey": {
            "type": "string",
            "description": "Chave Pix do recebedor."
          },
          "pixKeyType": {
            "type": "string",
            "enum": [
              "cpf",
              "cnpj",
              "phone",
              "email",
              "evp"
            ],
            "description": "Tipo da chave."
          },
          "description": {
            "type": "string",
            "description": "Até 140 caracteres."
          },
          "externalId": {
            "type": "string",
            "description": "Seu identificador. Único por conta."
          },
          "acceptedChunking": {
            "type": "boolean",
            "description": "Aceita dividir em parcelas quando passar do teto."
          }
        },
        "required": [
          "amount",
          "pixKey"
        ]
      },
      "PaymentBatch": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "externalId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "pixKey": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "feeAmount": {
            "type": "integer"
          },
          "totalDebitAmount": {
            "type": "integer"
          },
          "chunkCount": {
            "type": "integer"
          },
          "payments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "feeAmount": {
                  "type": "integer"
                },
                "totalAmount": {
                  "type": "integer"
                },
                "status": {
                  "type": "string"
                },
                "endToEndId": {
                  "type": "string"
                },
                "failureReason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RefundCreate": {
        "type": "object",
        "properties": {
          "chargeId": {
            "type": "string",
            "description": "Id da cobrança (chg_…)."
          },
          "endToEndId": {
            "type": "string",
            "description": "Alternativa ao chargeId."
          },
          "amount": {
            "type": "integer",
            "description": "Valor em centavos."
          },
          "externalId": {
            "type": "string",
            "description": "Seu identificador. Único por conta."
          },
          "reason": {
            "type": "string",
            "description": "Motivo (até 240 caracteres)."
          }
        },
        "required": [
          "amount"
        ]
      },
      "Refund": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "externalId": {
            "type": "string"
          },
          "chargeId": {
            "type": "string"
          },
          "endToEndId": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "feeAmount": {
            "type": "integer"
          },
          "status": {
            "type": "string"
          },
          "origin": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "failureReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RefundList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "externalId": {
                  "type": "string"
                },
                "chargeId": {
                  "type": "string"
                },
                "endToEndId": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "feeAmount": {
                  "type": "integer"
                },
                "status": {
                  "type": "string"
                },
                "origin": {
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                },
                "failureReason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "MedList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "endToEndId": {
                  "type": "string"
                },
                "chargeId": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                },
                "blockedAmount": {
                  "type": "integer"
                },
                "reason": {
                  "type": "string"
                },
                "openedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "deadlineAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "infractionOutcome": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "reviewRequired": {
                  "type": "boolean"
                },
                "reviewReason": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "defense": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "refund": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": "string"
          }
        }
      },
      "Med": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "endToEndId": {
            "type": "string"
          },
          "chargeId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "blockedAmount": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "openedAt": {
            "type": "string",
            "format": "date-time"
          },
          "deadlineAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "infractionOutcome": {
            "type": [
              "string",
              "null"
            ]
          },
          "reviewRequired": {
            "type": "boolean"
          },
          "reviewReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "defense": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "statement": {
                "type": "string"
              },
              "fileCount": {
                "type": "integer"
              },
              "submittedAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          "refund": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "MedContest": {
        "type": "object",
        "properties": {
          "statement": {
            "type": "string",
            "description": "Sua defesa."
          },
          "files": {
            "type": "string",
            "format": "binary",
            "description": "Até 5 anexos (PDF, JPG, PNG; 10 MB cada)."
          }
        },
        "required": [
          "statement"
        ]
      },
      "MedRefund": {
        "type": "object",
        "properties": {
          "amount": {
            "type": "integer",
            "description": "Valor em centavos. Padrão: o valor do MED."
          },
          "externalId": {
            "type": "string",
            "description": "Seu identificador para a devolução."
          },
          "reason": {
            "type": "string",
            "description": "Motivo (até 240 caracteres)."
          }
        }
      },
      "MedWithRefund": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "endToEndId": {
            "type": "string"
          },
          "chargeId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "amount": {
            "type": "integer"
          },
          "blockedAmount": {
            "type": "integer"
          },
          "reason": {
            "type": "string"
          },
          "openedAt": {
            "type": "string",
            "format": "date-time"
          },
          "deadlineAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "infractionOutcome": {
            "type": "string"
          },
          "reviewRequired": {
            "type": "boolean"
          },
          "reviewReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "defense": {
            "type": [
              "string",
              "null"
            ]
          },
          "refund": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "externalId": {
                "type": "string"
              },
              "chargeId": {
                "type": "string"
              },
              "endToEndId": {
                "type": "string"
              },
              "amount": {
                "type": "integer"
              },
              "feeAmount": {
                "type": "integer"
              },
              "status": {
                "type": "string"
              },
              "origin": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "failureReason": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              }
            }
          }
        }
      },
      "WebhookEndpointCreate": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "description": "URL HTTPS que recebe o POST."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Eventos assinados (ao menos um)."
          },
          "errorNotificationEmail": {
            "type": "string",
            "description": "E-mail de contato técnico do endpoint."
          },
          "autoPauseOnFailure": {
            "type": "boolean",
            "description": "Pausa o endpoint depois de falhas seguidas. Padrão true."
          },
          "isPaused": {
            "type": "boolean",
            "description": "Cria já pausado."
          },
          "headers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "required": [
                "key",
                "value"
              ]
            },
            "description": "Headers extras { key, value } enviados em cada entrega."
          }
        },
        "required": [
          "url",
          "events",
          "errorNotificationEmail"
        ]
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "errorNotificationEmail": {
            "type": "string"
          },
          "autoPauseOnFailure": {
            "type": "boolean"
          },
          "isPaused": {
            "type": "boolean"
          },
          "status": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WebhookEndpointList": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "url": {
                  "type": "string"
                },
                "events": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "errorNotificationEmail": {
                  "type": "string"
                },
                "autoPauseOnFailure": {
                  "type": "boolean"
                },
                "isPaused": {
                  "type": "boolean"
                },
                "status": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          }
        }
      },
      "WebhookEndpointUpdate": {
        "type": "object",
        "properties": {
          "isPaused": {
            "type": "boolean"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "WebhookTestResult": {
        "type": "object",
        "properties": {
          "delivered": {
            "type": "boolean"
          },
          "status": {
            "type": "integer"
          },
          "body": {
            "type": "string"
          }
        }
      },
      "WebhookDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "attemptCount": {
            "type": "integer"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      }
    }
  }
}