{
  "openapi": "3.1.0",
  "info": {
    "title": "Auryon369 — API legada (compatibilidade)",
    "version": "1.0.0-legacy",
    "description": "⚠️ DEPRECIADA. Camada de compatibilidade com a API da plataforma anterior, para migrar trocando só o endereço e as chaves. Novas integrações devem usar a API v1. Ver docs/api/API-LEGADA.md e docs/api/MIGRACAO.md."
  },
  "servers": [
    {
      "url": "https://api.auryon369.com.br/api/v1"
    }
  ],
  "components": {
    "securitySchemes": {
      "publicKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-public-key"
      },
      "secretKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-secret-key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "number"
          },
          "errorCode": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {}
        },
        "required": [
          "statusCode",
          "errorCode",
          "message"
        ]
      },
      "TooManyRequests": {
        "type": "object",
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "const": "TOO_MANY_REQUESTS"
              },
              "message": {
                "type": "string"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "success",
          "error"
        ]
      }
    }
  },
  "security": [
    {
      "publicKey": [],
      "secretKey": []
    }
  ],
  "paths": {
    "/ping": {
      "get": {
        "tags": [
          "Status"
        ],
        "summary": "Status da API",
        "security": [],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "const": "pong"
                    }
                  },
                  "required": [
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": null
      }
    },
    "/gateway/producer": {
      "get": {
        "tags": [
          "Produtor"
        ],
        "summary": "Meus dados",
        "deprecated": true,
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "email": {
                      "type": "string"
                    },
                    "phone": {
                      "type": "string"
                    },
                    "document": {
                      "type": "string"
                    },
                    "address": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {
                        "type": "string"
                      }
                    },
                    "legalRepresentative": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    }
                  },
                  "required": [
                    "name",
                    "email",
                    "phone"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_DATA"
      }
    },
    "/gateway/producer/balance": {
      "get": {
        "tags": [
          "Produtor"
        ],
        "summary": "Meu saldo — SÓ BRL",
        "description": "⚠️ Devolve apenas o saldo em Reais. Saldo em USD ou BDM não aparece aqui — use a API v1 (/v1/balance), que devolve por moeda.",
        "deprecated": true,
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "available": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "pending": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "fundLock": {
                      "description": "Valor em reais",
                      "type": "number"
                    }
                  },
                  "required": [
                    "available",
                    "pending",
                    "fundLock"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_DATA"
      }
    },
    "/gateway/producer/credentials": {
      "get": {
        "tags": [
          "Produtor"
        ],
        "summary": "Testar credenciais",
        "deprecated": true,
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "permissions": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "grantAllPermissions": {
                      "type": "boolean"
                    },
                    "expiresAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "name",
                    "permissions",
                    "grantAllPermissions",
                    "expiresAt"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "ANY"
      }
    },
    "/gateway/transactions": {
      "get": {
        "tags": [
          "Consultas"
        ],
        "summary": "Buscar transação",
        "description": "Não use para polling: a consulta repetida é bloqueada (429). Receba atualizações via webhook.",
        "deprecated": true,
        "parameters": [
          {
            "name": "id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "transactionId devolvido na criação"
          },
          {
            "name": "clientIdentifier",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "o identifier que você enviou"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "clientIdentifier": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "currency": {
                      "type": "string"
                    },
                    "amount": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "chargeAmount": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "exchangeRate": {
                      "type": "number"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "COMPLETED",
                        "FAILED",
                        "REFUNDED",
                        "CHARGED_BACK"
                      ]
                    },
                    "paymentMethod": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "webhookUrl": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "payedAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "refundedAt": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "boletoInformation": {
                      "anyOf": [
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "pixInformation": {
                      "anyOf": [
                        {
                          "type": "object",
                          "propertyNames": {
                            "type": "string"
                          },
                          "additionalProperties": {
                            "type": "string"
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "clientIdentifier",
                    "currency",
                    "amount",
                    "chargeAmount",
                    "exchangeRate",
                    "status",
                    "paymentMethod",
                    "webhookUrl",
                    "createdAt",
                    "payedAt",
                    "refundedAt",
                    "boletoInformation",
                    "pixInformation"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Não existe, ou não é da sua conta",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_TRANSACTIONS"
      }
    },
    "/gateway/subscriptions": {
      "get": {
        "tags": [
          "Consultas"
        ],
        "summary": "Buscar assinaturas",
        "deprecated": true,
        "parameters": [
          {
            "name": "transactionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "subscriptionId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "orderId",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientIdentifier",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "clientEmail",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "subscriptions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      }
                    }
                  },
                  "required": [
                    "subscriptions"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_TRANSACTIONS"
      }
    },
    "/gateway/producer/refunds": {
      "post": {
        "tags": [
          "Consultas"
        ],
        "summary": "Solicitar reembolso (total)",
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transactionId": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "reason": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 500
                  },
                  "description": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 2000
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "transactionId",
                  "reason"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "transactionId": {
                      "type": "string"
                    },
                    "producerId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "COMPLETED",
                        "CANCELED"
                      ]
                    },
                    "amount": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "reason": {
                      "type": "string"
                    },
                    "description": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "transactionId",
                    "producerId",
                    "status",
                    "amount",
                    "reason",
                    "description"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Não existe, ou não é da sua conta",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Pedido válido, mas não atendível agora",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_TRANSACTIONS"
      }
    },
    "/gateway/pix/receive": {
      "post": {
        "tags": [
          "Gateway (legado)"
        ],
        "summary": "Receber PIX",
        "description": "Repetir o mesmo `identifier` com o mesmo pedido devolve a MESMA transação; com outro valor ou outra forma de pagamento, responde 409 GATEWAY_FAILED_PRECONDITION.",
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "identifier": {
                    "description": "Único por transação — é a chave de idempotência",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "amount": {
                    "description": "Valor em reais (mín. 0.01)",
                    "type": "number"
                  },
                  "shippingFee": {
                    "type": "number"
                  },
                  "extraFee": {
                    "type": "number"
                  },
                  "discount": {
                    "type": "number"
                  },
                  "products": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "quantity": {
                          "type": "integer"
                        },
                        "price": {
                          "type": "number"
                        },
                        "physical": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "price"
                      ]
                    }
                  },
                  "splits": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "producerId": {
                          "description": "ID da conta Auryon que recebe",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "amount": {
                          "description": "Valor em reais",
                          "type": "number"
                        }
                      },
                      "required": [
                        "producerId",
                        "amount"
                      ]
                    }
                  },
                  "dueDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "string",
                        "maxLength": 5000
                      }
                    ]
                  },
                  "callbackUrl": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "client": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "email": {
                        "type": "string",
                        "maxLength": 254,
                        "format": "email",
                        "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "document": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "address": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "description": "País, ISO 3166-1 alpha-2",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 2
                          },
                          "zipCode": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "state": {
                            "description": "UF, ex.: SP",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 3
                          },
                          "city": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "street": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "neighborhood": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "number": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "complement": {
                            "type": "string",
                            "maxLength": 120
                          }
                        },
                        "required": [
                          "country",
                          "zipCode",
                          "state",
                          "city",
                          "street",
                          "neighborhood",
                          "number"
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "email"
                    ]
                  }
                },
                "required": [
                  "identifier",
                  "amount",
                  "client"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactionId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "OK",
                        "FAILED",
                        "PENDING"
                      ]
                    },
                    "transactionStatus": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "COMPLETED",
                        "FAILED"
                      ]
                    },
                    "webhookToken": {
                      "description": "Devolvido quando callbackUrl é informado",
                      "type": "string"
                    },
                    "fee": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "errorDescription": {
                      "type": "string"
                    },
                    "pix": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "image": {
                          "type": "string"
                        },
                        "base64": {
                          "description": "Sempre vazio — renderize o QR a partir de `code`",
                          "type": "string",
                          "const": ""
                        },
                        "expiresAt": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code",
                        "base64"
                      ]
                    }
                  },
                  "required": [
                    "transactionId",
                    "status",
                    "transactionStatus",
                    "fee",
                    "order",
                    "pix"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflito com o estado atual (ver a descrição da operação)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_TRANSACTIONS"
      }
    },
    "/gateway/boleto/receive": {
      "post": {
        "tags": [
          "Gateway (legado)"
        ],
        "summary": "Receber boleto",
        "description": "Repetir o mesmo `identifier` com o mesmo pedido devolve a MESMA transação; com outro valor ou outra forma de pagamento, responde 409 GATEWAY_FAILED_PRECONDITION.",
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "identifier": {
                    "description": "Único por transação — é a chave de idempotência",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "amount": {
                    "description": "Valor em reais (mín. 0.01)",
                    "type": "number"
                  },
                  "shippingFee": {
                    "type": "number"
                  },
                  "extraFee": {
                    "type": "number"
                  },
                  "discount": {
                    "type": "number"
                  },
                  "products": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "quantity": {
                          "type": "integer"
                        },
                        "price": {
                          "type": "number"
                        },
                        "physical": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "price"
                      ]
                    }
                  },
                  "splits": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "producerId": {
                          "description": "ID da conta Auryon que recebe",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "amount": {
                          "description": "Valor em reais",
                          "type": "number"
                        }
                      },
                      "required": [
                        "producerId",
                        "amount"
                      ]
                    }
                  },
                  "dueDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "string",
                        "maxLength": 5000
                      }
                    ]
                  },
                  "callbackUrl": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "client": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "email": {
                        "type": "string",
                        "maxLength": 254,
                        "format": "email",
                        "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "document": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "address": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "description": "País, ISO 3166-1 alpha-2",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 2
                          },
                          "zipCode": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "state": {
                            "description": "UF, ex.: SP",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 3
                          },
                          "city": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "street": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "neighborhood": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "number": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "complement": {
                            "type": "string",
                            "maxLength": 120
                          }
                        },
                        "required": [
                          "country",
                          "zipCode",
                          "state",
                          "city",
                          "street",
                          "neighborhood",
                          "number"
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "email",
                      "address"
                    ]
                  }
                },
                "required": [
                  "identifier",
                  "amount",
                  "client"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactionId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "OK",
                        "FAILED",
                        "PENDING"
                      ]
                    },
                    "transactionStatus": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "COMPLETED",
                        "FAILED"
                      ]
                    },
                    "webhookToken": {
                      "description": "Devolvido quando callbackUrl é informado",
                      "type": "string"
                    },
                    "fee": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "errorDescription": {
                      "type": "string"
                    },
                    "boleto": {
                      "type": "object",
                      "properties": {
                        "barcode": {
                          "type": "string"
                        },
                        "digitableLine": {
                          "type": "string"
                        },
                        "pdfUrl": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "barcode",
                        "digitableLine"
                      ]
                    }
                  },
                  "required": [
                    "transactionId",
                    "status",
                    "transactionStatus",
                    "fee",
                    "order",
                    "boleto"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflito com o estado atual (ver a descrição da operação)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_TRANSACTIONS"
      }
    },
    "/gateway/crypto/receive": {
      "post": {
        "tags": [
          "Gateway (legado)"
        ],
        "summary": "Receber cripto (BDM Digital)",
        "description": "A Auryon recebe cripto em BDM Digital: `crypto.currency` deve ser \"BDM\". Repetir o mesmo `identifier` com o mesmo pedido devolve a MESMA transação; com outro valor ou outra forma de pagamento, responde 409 GATEWAY_FAILED_PRECONDITION.",
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "identifier": {
                    "description": "Único por transação — é a chave de idempotência",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "amount": {
                    "description": "Valor em reais (mín. 0.01)",
                    "type": "number"
                  },
                  "shippingFee": {
                    "type": "number"
                  },
                  "extraFee": {
                    "type": "number"
                  },
                  "discount": {
                    "type": "number"
                  },
                  "products": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "quantity": {
                          "type": "integer"
                        },
                        "price": {
                          "type": "number"
                        },
                        "physical": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "price"
                      ]
                    }
                  },
                  "splits": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "producerId": {
                          "description": "ID da conta Auryon que recebe",
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        },
                        "amount": {
                          "description": "Valor em reais",
                          "type": "number"
                        }
                      },
                      "required": [
                        "producerId",
                        "amount"
                      ]
                    }
                  },
                  "dueDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "string",
                        "maxLength": 5000
                      }
                    ]
                  },
                  "callbackUrl": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "client": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "email": {
                        "type": "string",
                        "maxLength": 254,
                        "format": "email",
                        "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "document": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "address": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "description": "País, ISO 3166-1 alpha-2",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 2
                          },
                          "zipCode": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "state": {
                            "description": "UF, ex.: SP",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 3
                          },
                          "city": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "street": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "neighborhood": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "number": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "complement": {
                            "type": "string",
                            "maxLength": 120
                          }
                        },
                        "required": [
                          "country",
                          "zipCode",
                          "state",
                          "city",
                          "street",
                          "neighborhood",
                          "number"
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "email"
                    ]
                  },
                  "crypto": {
                    "type": "object",
                    "properties": {
                      "currency": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "network": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 40
                      }
                    },
                    "required": [
                      "currency",
                      "network"
                    ]
                  }
                },
                "required": [
                  "identifier",
                  "amount",
                  "client",
                  "crypto"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactionId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "OK",
                        "FAILED",
                        "PENDING"
                      ]
                    },
                    "transactionStatus": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "COMPLETED",
                        "FAILED"
                      ]
                    },
                    "webhookToken": {
                      "description": "Devolvido quando callbackUrl é informado",
                      "type": "string"
                    },
                    "fee": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "errorDescription": {
                      "type": "string"
                    },
                    "qr": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "image": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "code"
                      ]
                    }
                  },
                  "required": [
                    "transactionId",
                    "status",
                    "transactionStatus",
                    "fee",
                    "order",
                    "qr"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflito com o estado atual (ver a descrição da operação)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_TRANSACTIONS"
      }
    },
    "/gateway/card/receive": {
      "post": {
        "tags": [
          "Gateway (legado)"
        ],
        "summary": "⛔ Cartão pela API — RECUSADO",
        "description": "A Auryon NÃO recebe dados de cartão pela API (PCI-DSS). Esta rota responde sempre 400 GATEWAY_FAILED_PRECONDITION e não lê o corpo. Use POST /gateway/checkout e redirecione o comprador.",
        "deprecated": true,
        "security": [],
        "responses": {
          "400": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "errorCode": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {}
                  },
                  "required": [
                    "statusCode",
                    "errorCode",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": null
      }
    },
    "/gateway/card/subscription": {
      "post": {
        "tags": [
          "Gateway (legado)"
        ],
        "summary": "⛔ Assinatura no cartão pela API — RECUSADO",
        "description": "Mesma recusa do card/receive. Use uma oferta recorrente no checkout.",
        "deprecated": true,
        "security": [],
        "responses": {
          "400": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "errorCode": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {}
                  },
                  "required": [
                    "statusCode",
                    "errorCode",
                    "message"
                  ]
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": null
      }
    },
    "/gateway/pix/subscription": {
      "post": {
        "tags": [
          "Assinaturas (legado)"
        ],
        "summary": "Assinatura em PIX",
        "description": "Cada ciclo emite uma cobrança nova e o comprador paga. ⚠️ `periodicityType: DAYS` e `firstChargeIn > 0` não são suportados. Repetir o mesmo `identifier` com o mesmo pedido devolve a MESMA transação; com outro valor ou outra forma de pagamento, responde 409 GATEWAY_FAILED_PRECONDITION.",
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "identifier": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "amount": {
                    "description": "Valor de cada cobrança, em reais",
                    "type": "number"
                  },
                  "product": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "price": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "subscription": {
                    "type": "object",
                    "properties": {
                      "periodicityType": {
                        "type": "string",
                        "enum": [
                          "DAYS",
                          "WEEKS",
                          "MONTHS",
                          "YEARS"
                        ]
                      },
                      "periodicity": {
                        "type": "integer"
                      },
                      "firstChargeIn": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "periodicityType",
                      "periodicity"
                    ]
                  },
                  "client": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "email": {
                        "type": "string",
                        "maxLength": 254,
                        "format": "email",
                        "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "document": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "address": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "description": "País, ISO 3166-1 alpha-2",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 2
                          },
                          "zipCode": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "state": {
                            "description": "UF, ex.: SP",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 3
                          },
                          "city": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "street": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "neighborhood": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "number": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "complement": {
                            "type": "string",
                            "maxLength": 120
                          }
                        },
                        "required": [
                          "country",
                          "zipCode",
                          "state",
                          "city",
                          "street",
                          "neighborhood",
                          "number"
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "email"
                    ]
                  },
                  "dueDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "string",
                        "maxLength": 5000
                      }
                    ]
                  },
                  "callbackUrl": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "crypto": {
                    "type": "object",
                    "properties": {
                      "currency": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "network": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 40
                      }
                    },
                    "required": [
                      "currency",
                      "network"
                    ]
                  }
                },
                "required": [
                  "identifier",
                  "amount",
                  "product",
                  "subscription",
                  "client"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactionId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "OK",
                        "FAILED",
                        "PENDING"
                      ]
                    },
                    "transactionStatus": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "COMPLETED",
                        "FAILED"
                      ]
                    },
                    "webhookToken": {
                      "type": "string"
                    },
                    "fee": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "pix": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "qr": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "subscription": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "periodicity": {
                          "type": "number"
                        },
                        "periodicityType": {
                          "type": "string",
                          "enum": [
                            "WEEKS",
                            "MONTHS",
                            "YEARS"
                          ]
                        },
                        "nextChargeAt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "startAt": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "ACTIVE",
                            "INACTIVE",
                            "CANCELED"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "periodicity",
                        "periodicityType",
                        "nextChargeAt",
                        "startAt",
                        "status"
                      ]
                    }
                  },
                  "required": [
                    "transactionId",
                    "status",
                    "transactionStatus",
                    "fee",
                    "order",
                    "subscription"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflito com o estado atual (ver a descrição da operação)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_TRANSACTIONS"
      }
    },
    "/gateway/crypto/subscription": {
      "post": {
        "tags": [
          "Assinaturas (legado)"
        ],
        "summary": "Assinatura em cripto (BDM Digital)",
        "description": "Repetir o mesmo `identifier` com o mesmo pedido devolve a MESMA transação; com outro valor ou outra forma de pagamento, responde 409 GATEWAY_FAILED_PRECONDITION.",
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "identifier": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "amount": {
                    "description": "Valor de cada cobrança, em reais",
                    "type": "number"
                  },
                  "product": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "price": {
                        "type": "number"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "subscription": {
                    "type": "object",
                    "properties": {
                      "periodicityType": {
                        "type": "string",
                        "enum": [
                          "DAYS",
                          "WEEKS",
                          "MONTHS",
                          "YEARS"
                        ]
                      },
                      "periodicity": {
                        "type": "integer"
                      },
                      "firstChargeIn": {
                        "type": "integer"
                      }
                    },
                    "required": [
                      "periodicityType",
                      "periodicity"
                    ]
                  },
                  "client": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "email": {
                        "type": "string",
                        "maxLength": 254,
                        "format": "email",
                        "pattern": "^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "document": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "address": {
                        "type": "object",
                        "properties": {
                          "country": {
                            "description": "País, ISO 3166-1 alpha-2",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 2
                          },
                          "zipCode": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "state": {
                            "description": "UF, ex.: SP",
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 3
                          },
                          "city": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "street": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "neighborhood": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 120
                          },
                          "number": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 20
                          },
                          "complement": {
                            "type": "string",
                            "maxLength": 120
                          }
                        },
                        "required": [
                          "country",
                          "zipCode",
                          "state",
                          "city",
                          "street",
                          "neighborhood",
                          "number"
                        ]
                      }
                    },
                    "required": [
                      "name",
                      "email"
                    ]
                  },
                  "dueDate": {
                    "type": "string",
                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                  },
                  "metadata": {
                    "anyOf": [
                      {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {}
                      },
                      {
                        "type": "string",
                        "maxLength": 5000
                      }
                    ]
                  },
                  "callbackUrl": {
                    "type": "string",
                    "maxLength": 2048
                  },
                  "crypto": {
                    "type": "object",
                    "properties": {
                      "currency": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 20
                      },
                      "network": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 40
                      }
                    },
                    "required": [
                      "currency",
                      "network"
                    ]
                  }
                },
                "required": [
                  "identifier",
                  "amount",
                  "product",
                  "subscription",
                  "client"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "transactionId": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "OK",
                        "FAILED",
                        "PENDING"
                      ]
                    },
                    "transactionStatus": {
                      "type": "string",
                      "enum": [
                        "PENDING",
                        "COMPLETED",
                        "FAILED"
                      ]
                    },
                    "webhookToken": {
                      "type": "string"
                    },
                    "fee": {
                      "description": "Valor em reais",
                      "type": "number"
                    },
                    "order": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "id"
                      ]
                    },
                    "pix": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "qr": {
                      "type": "object",
                      "propertyNames": {
                        "type": "string"
                      },
                      "additionalProperties": {}
                    },
                    "subscription": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "periodicity": {
                          "type": "number"
                        },
                        "periodicityType": {
                          "type": "string",
                          "enum": [
                            "WEEKS",
                            "MONTHS",
                            "YEARS"
                          ]
                        },
                        "nextChargeAt": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "startAt": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "ACTIVE",
                            "INACTIVE",
                            "CANCELED"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "periodicity",
                        "periodicityType",
                        "nextChargeAt",
                        "startAt",
                        "status"
                      ]
                    }
                  },
                  "required": [
                    "transactionId",
                    "status",
                    "transactionStatus",
                    "fee",
                    "order",
                    "subscription"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflito com o estado atual (ver a descrição da operação)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_TRANSACTIONS"
      }
    },
    "/gateway/pix/deposit": {
      "post": {
        "tags": [
          "Gateway (legado)"
        ],
        "summary": "Depósito PIX no saldo — não disponível (501)",
        "deprecated": true,
        "security": [],
        "responses": {
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "501": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "number"
                    },
                    "errorCode": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "details": {}
                  },
                  "required": [
                    "statusCode",
                    "errorCode",
                    "message"
                  ]
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": null
      }
    },
    "/gateway/checkout": {
      "post": {
        "tags": [
          "Checkout"
        ],
        "summary": "Criar checkout (o caminho do CARTÃO)",
        "description": "Cria (ou reusa, pelo product.externalId) produto e oferta e devolve o link. ⚠️ `offer.price` em REAIS. Produto ainda não aprovado (sua conta não aprova automaticamente) responde 409 GATEWAY_FAILED_PRECONDITION com `details.productId` e `details.approvalStatus`, sem criar oferta: chame de novo depois da aprovação.",
        "deprecated": true,
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "product": {
                    "type": "object",
                    "properties": {
                      "externalId": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 100
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1,
                        "maxLength": 200
                      },
                      "photos": {
                        "maxItems": 10,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "maxLength": 2048
                        }
                      },
                      "offer": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "price": {
                            "description": "Preço em reais",
                            "type": "number"
                          },
                          "offerType": {
                            "type": "string",
                            "enum": [
                              "INTERNATIONAL",
                              "NATIONAL",
                              "UNDEFINED"
                            ]
                          },
                          "currency": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 10
                          },
                          "lang": {
                            "type": "string",
                            "maxLength": 10
                          },
                          "warranty": {
                            "type": "string",
                            "maxLength": 40
                          },
                          "type": {
                            "type": "string",
                            "maxLength": 60
                          },
                          "category": {
                            "type": "string",
                            "maxLength": 60
                          }
                        },
                        "required": [
                          "name",
                          "price",
                          "offerType"
                        ]
                      }
                    },
                    "required": [
                      "externalId",
                      "name",
                      "offer"
                    ]
                  },
                  "settings": {
                    "type": "object",
                    "properties": {
                      "paymentMethods": {
                        "maxItems": 7,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "PIX",
                            "CREDIT_CARD",
                            "BOLETO",
                            "CRYPTO",
                            "CASH_ON_DELIVERY",
                            "GOOGLE_PAY",
                            "APPLE_PAY"
                          ]
                        }
                      },
                      "acceptedDocs": {
                        "maxItems": 2,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": [
                            "CPF",
                            "CNPJ"
                          ]
                        }
                      },
                      "thankYouPage": {
                        "type": "string",
                        "maxLength": 2048
                      },
                      "askForAddress": {
                        "type": "boolean"
                      },
                      "colors": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": "string",
                          "maxLength": 20
                        }
                      }
                    },
                    "required": [
                      "askForAddress"
                    ]
                  },
                  "customer": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "email": {
                        "type": "string",
                        "maxLength": 254
                      },
                      "phone": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "document": {
                        "type": "string",
                        "maxLength": 40
                      },
                      "address": {
                        "type": "object",
                        "propertyNames": {
                          "type": "string"
                        },
                        "additionalProperties": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    }
                  },
                  "trackProps": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string",
                          "maxLength": 500
                        },
                        {
                          "type": "number"
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "product",
                  "settings"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "productId": {
                      "type": "string"
                    },
                    "offerCode": {
                      "type": "string"
                    },
                    "checkoutUrl": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "productId",
                    "offerCode",
                    "checkoutUrl"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Credencial ausente, inválida, revogada ou expirada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A credencial não tem a permissão da rota",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Conflito com o estado atual (ver a descrição da operação)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": "PRODUCER_CHECKOUT"
      }
    },
    "/utils/exchange-rates": {
      "get": {
        "tags": [
          "Outros"
        ],
        "summary": "Taxas de câmbio",
        "deprecated": true,
        "security": [],
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "amount",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "convertedAmount": {
                      "type": "number"
                    },
                    "exchangeRate": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "convertedAmount",
                    "exchangeRate"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Parâmetro ou corpo inválido",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Limite de requisições: 100 por minuto por credencial",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TooManyRequests"
                }
              }
            }
          },
          "503": {
            "description": "Manutenção ou indisponibilidade temporária",
            "headers": {
              "Retry-After": {
                "description": "Segundos até poder tentar de novo",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-auryon-permission": null
      }
    }
  },
  "x-callbackUrl": {
    "type": "string",
    "maxLength": 2048
  }
}
