openapi: 3.0.3
info:
  title: Droppay API
  version: "1.3.1"
  description: |
    API REST v1 da Droppay para cobranças, consultas, conciliação,
    links de pagamento e saques Pix.

    Novas integrações devem enviar `Authorization: Bearer SEU_TOKEN` e
    `X-Client-ID: SEU_CLIENT_ID`. Por compatibilidade, integrações antigas
    que usam apenas o token ou `X-API-Token` continuam aceitas.

    Valores monetários públicos são em reais (BRL). Use `Idempotency-Key`
    na criação de cobrança Pix e de saque Pix.

    Webhooks enviados ao integrador são POST JSON assinados com HMAC-SHA256.
    Prefira `X-Webhook-Signature-V2`.

    Identificação de suporte: `merchant` é a conta cadastrada na Droppay vinculada
    à credencial autenticada; `integration` identifica o Client ID, nome e projeto
    da integração de origem. São campos de resposta, nunca dados de pagador.
    Não envie esses blocos para escolher outra conta: o servidor determina o titular.
    `payer` continua sendo o comprador e `reference` é a referência da operação
    no sistema do integrador. A identidade bancária no comprovante Pix é definida
    pela adquirente/conta recebedora e não é alterada por esses campos.

    Documentação humana: /documentacao (no domínio configurado em APP_URL)
servers:
  - url: /api/v1
security:
  - bearerAuth: []
    clientId: []
tags:
  - name: Pix
  - name: Cartao
  - name: Consultas
  - name: Saques
  - name: Links de pagamento
paths:
  /payments/pix:
    post:
      tags:
        - Pix
      summary: Criar cobranca Pix para terceiro
      operationId: createPix
      description: |
        Endpoint canonico para gateways, marketplaces e plataformas cobrarem
        clientes finais. A criacao nunca confirma o pagamento. O vencimento
        real e sempre o `expires_at` devolvido pela API.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PixRequest'
      responses:
        "200":
          description: Replay idempotente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixResponse'
        "201":
          description: Cobranca criada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PixResponse'
        "400":
          $ref: '#/components/responses/Error'
        "401":
          $ref: '#/components/responses/Error'
        "403":
          $ref: '#/components/responses/Error'
        "422":
          $ref: '#/components/responses/ValidationError'
        "429":
          $ref: '#/components/responses/Error'
        "500":
          $ref: '#/components/responses/Error'
  /cashin/pix:
    post:
      tags:
        - Pix
      summary: Deposito Pix na propria conta
      operationId: createCashin
      description: |
        Autofunding da propria conta Droppay. Para cobrar cliente final use
        `POST /payments/pix`. O valor pago e o bruto; a taxa e descontada no
        ato e `amount_net` e o valor efetivamente creditado na carteira.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - amount
              properties:
                amount:
                  type: number
                  format: double
                  minimum: 1
                  description: Valor bruto pago no Pix; a taxa e descontada deste valor
                payer_name:
                  type: string
                  maxLength: 255
                webhook_url:
                  type: string
                  format: uri
      responses:
        "200":
          description: QR Code criado
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  transaction:
                    type: object
                    properties:
                      merchant:
                        $ref: '#/components/schemas/Merchant'
                      integration:
                        $ref: '#/components/schemas/Integration'
                      uuid:
                        type: string
                        format: uuid
                      external_id:
                        type: string
                      amount_gross:
                        type: number
                      amount_net:
                        type: number
                      fee:
                        type: number
                      status:
                        $ref: '#/components/schemas/TransactionStatus'
                      expires_at:
                        type: string
                        format: date-time
                  qr_code:
                    type: string
                  qr_code_base64:
                    type: string
                    nullable: true
        "400":
          $ref: '#/components/responses/Error'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /payments/credit-card:
    post:
      tags:
        - Cartao
      summary: Cobrar no cartao de credito
      operationId: createCreditCard
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CardRequest'
      responses:
        "201":
          description: Aprovada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardResult'
        "202":
          description: Requer 3DS ou esta em processamento
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardResult'
        "402":
          description: Recusada pelo emissor
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CardResult'
        "403":
          $ref: '#/components/responses/Error'
        "422":
          $ref: '#/components/responses/ValidationError'
  /payments/{uuid}:
    get:
      tags:
        - Consultas
      summary: Consultar cobranca
      operationId: getPayment
      description: |
        Retorna o estado salvo na Droppay sem esperar uma consulta a adquirente.
        Para cobrancas abertas, pode agendar uma verificacao em segundo plano, com intervalo
        minimo de 30 segundos e sem acumular jobs duplicados da mesma transacao.
        Webhooks, jobs e conciliacao agendada atualizam o estado; a confirmacao pode aparecer com atraso.
        Prefira webhooks e, se precisar consultar, use intervalo de pelo menos 30 segundos.
        Em HTTP 429, respeite Retry-After e aplique backoff.
      parameters:
        - $ref: '#/components/parameters/Uuid'
      responses:
        "200":
          description: Cobranca
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/PaymentDetail'
        "404":
          $ref: '#/components/responses/Error'
  /payments/{uuid}/refund:
    post:
      tags:
        - Cartao
      summary: Estornar venda no cartao
      operationId: refundCard
      parameters:
        - $ref: '#/components/parameters/Uuid'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  format: double
                  minimum: 0.01
                  description: "Sem este campo, o estorno e total."
      responses:
        "200":
          description: Estorno concluido
        "400":
          $ref: '#/components/responses/Error'
        "404":
          $ref: '#/components/responses/Error'
        "422":
          $ref: '#/components/responses/ValidationError'
  /transactions:
    get:
      tags:
        - Consultas
      summary: Listar transacoes
      operationId: listTransactions
      parameters:
        - name: status
          in: query
          schema:
            $ref: '#/components/schemas/TransactionStatus'
        - name: type
          in: query
          schema:
            type: string
            enum:
              - pix
              - credit
        - name: start_date
          in: query
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          schema:
            type: string
            format: date
        - name: reference
          in: query
          schema:
            type: string
            maxLength: 120
        - name: page
          in: query
          schema:
            type: integer
            minimum: 1
            default: 1
        - name: per_page
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
      responses:
        "200":
          description: Pagina de transacoes
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Transaction'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        "422":
          $ref: '#/components/responses/ValidationError'
  /transactions/{uuid}:
    get:
      tags:
        - Consultas
      summary: Consultar transacao
      operationId: getTransaction
      parameters:
        - $ref: '#/components/parameters/Uuid'
      responses:
        "200":
          description: Transacao
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    $ref: '#/components/schemas/Transaction'
        "404":
          $ref: '#/components/responses/Error'
  /balance:
    get:
      tags:
        - Consultas
      summary: Consultar saldo
      operationId: getBalance
      description: |
        Pode reconciliar pendencias recentes no maximo uma vez por minuto por conta.
      responses:
        "200":
          description: Saldos da conta
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  balance:
                    $ref: '#/components/schemas/Balance'
  /statement:
    get:
      tags:
        - Consultas
      summary: Extrato para conciliacao
      operationId: getStatement
      description: |
        O extrato preserva bruto, taxa e liquido. Em recebimentos, `net` e o
        valor efetivamente creditado. Em saques, `gross` e o total debitado do
        saldo e `net` e o valor efetivamente enviado para a chave Pix.
      parameters:
        - name: from
          in: query
          schema:
            type: string
            format: date
        - name: to
          in: query
          schema:
            type: string
            format: date
        - name: reference
          in: query
          schema:
            type: string
            maxLength: 120
        - name: format
          in: query
          schema:
            type: string
            enum:
              - json
              - csv
            default: json
      responses:
        "200":
          description: Extrato JSON ou CSV
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Statement'
            text/csv:
              schema:
                type: string
        "422":
          $ref: '#/components/responses/ValidationError'
  /cashout/pix:
    post:
      tags:
        - Saques
      summary: Criar saque via Pix
      operationId: createCashout
      description: |
        `amount` e o total em BRL que sera debitado do saldo. A taxa e
        descontada desse valor no ato; `withdrawal.amount` e `payout_amount`
        informam o liquido efetivamente enviado para a chave Pix. Portanto:
        `amount_gross = amount solicitado`, `liquido = amount_gross - fee`.
        A chave e validada antes da reserva. Em modo automatico, o IP de origem
        precisa estar cadastrado na credencial.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CashoutRequest'
      responses:
        "200":
          description: Saque criado ou replay idempotente
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawalResponse'
        "400":
          $ref: '#/components/responses/Error'
        "403":
          $ref: '#/components/responses/Error'
        "422":
          $ref: '#/components/responses/ValidationError'
        "500":
          $ref: '#/components/responses/Error'
  /cashout/{id}:
    get:
      tags:
        - Saques
      summary: Consultar saque
      operationId: getCashout
      parameters:
        - $ref: '#/components/parameters/WithdrawalId'
      responses:
        "200":
          description: Saque
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawalQueryResponse'
        "404":
          $ref: '#/components/responses/Error'
  /withdrawals/{id}:
    get:
      tags:
        - Saques
      summary: Consultar saque por alias
      operationId: getWithdrawal
      parameters:
        - $ref: '#/components/parameters/WithdrawalId'
      responses:
        "200":
          description: Saque
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WithdrawalQueryResponse'
        "404":
          $ref: '#/components/responses/Error'
  /payment-links:
    post:
      tags:
        - Links de pagamento
      summary: Criar link de pagamento
      operationId: createPaymentLink
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentLinkRequest'
      responses:
        "201":
          description: Link criado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentLinkResponse'
        "403":
          $ref: '#/components/responses/Error'
        "422":
          $ref: '#/components/responses/ValidationError'
  /payment-links/{id}:
    get:
      tags:
        - Links de pagamento
      summary: Consultar link de pagamento
      operationId: getPaymentLink
      parameters:
        - $ref: '#/components/parameters/PaymentLinkId'
      responses:
        "200":
          description: Link
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentLinkResponse'
        "404":
          $ref: '#/components/responses/Error'
    delete:
      tags:
        - Links de pagamento
      summary: Cancelar link ainda nao pago
      operationId: cancelPaymentLink
      parameters:
        - $ref: '#/components/parameters/PaymentLinkId'
      responses:
        "200":
          description: Link cancelado
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentLinkResponse'
        "404":
          $ref: '#/components/responses/Error'
        "422":
          $ref: '#/components/responses/Error'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Droppay API token
    clientId:
      type: apiKey
      in: header
      name: X-Client-ID
  parameters:
    Uuid:
      name: uuid
      in: path
      required: true
      schema:
        type: string
        format: uuid
    WithdrawalId:
      name: id
      in: path
      required: true
      schema:
        type: integer
        minimum: 1
    PaymentLinkId:
      name: id
      in: path
      required: true
      schema:
        type: string
        format: uuid
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: |
        Recomendado. De 8 a 80 caracteres: letras, numeros, ponto,
        underline, dois-pontos e hifen.
      schema:
        type: string
        minLength: 8
        maxLength: 80
        pattern: '^[A-Za-z0-9._:-]+$'
  responses:
    Error:
      description: Erro da operacao
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: Campos invalidos
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
  schemas:
    Merchant:
      type: object
      readOnly: true
      description: |
        Conta responsável registrada na Droppay, determinada pelo titular da operação.
        Dados cadastrais atuais, sem substituir o pagador/comprador.
        Disponível apenas em respostas autenticadas e webhooks da própria conta.
      required: [id]
      properties:
        id:
          type: integer
          minimum: 1
          example: 42
        name:
          type: string
          nullable: true
          example: Gateway Exemplo
        email:
          type: string
          nullable: true
          example: suporte@gateway.example
        document:
          type: string
          nullable: true
          description: CPF/CNPJ cadastrado, somente dígitos
          example: "11222333000181"
        phone:
          type: string
          nullable: true
          example: "5511999999999"
    Integration:
      type: object
      nullable: true
      readOnly: true
      description: |
        Credencial de origem, sem token, senha ou segredo. Pode ser null quando
        a origem não estiver registrada. Transações preservam o snapshot da
        credencial na criação; saques e links usam a credencial vinculada atual.
        Nunca representa a credencial destinatária escolhida para entregar um webhook.
      properties:
        client_id:
          type: string
          nullable: true
          example: cli_gateway_01
        name:
          type: string
          nullable: true
          example: Produção
        project:
          type: string
          nullable: true
          example: Gateway Exemplo
    Error:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
    ValidationError:
      allOf:
        - $ref: '#/components/schemas/Error'
        - type: object
          properties:
            errors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
    TransactionStatus:
      type: string
      enum:
        - pending
        - waiting_payment
        - processing
        - completed
        - failed
        - cancelled
        - refunded
        - chargeback
        - mediation
      description: |
        `cancelled` tambem representa expiracao. Nesse caso o webhook de falha
        pode trazer `reason=expired`.
    WithdrawalStatus:
      type: string
      enum:
        - pending
        - processing
        - paid
        - rejected
        - failed
        - cancelled
      description: |
        `processing` pode voltar a `pending` quando nenhuma adquirente consegue
        enviar por indisponibilidade operacional e o saque vai para fila.
    PixRequest:
      type: object
      required:
        - amount
        - payer_name
        - payer_email
        - payer_cpf
      properties:
        amount:
          type: number
          format: double
          minimum: 0.01
          maximum: 1000000
        payer_name:
          type: string
          maxLength: 255
        payer_email:
          type: string
          format: email
        payer_cpf:
          type: string
          maxLength: 18
          description: CPF ou CNPJ valido por digito verificador
        payer_phone:
          type: string
          description: DDD e numero; o codigo 55 e opcional
        description:
          type: string
          maxLength: 500
        webhook_url:
          type: string
          format: uri
        reference:
          type: string
          maxLength: 120
        settlement:
          type: string
          enum:
            - brl
            - usdt
          default: brl
        splits:
          type: array
          items:
            type: object
            required:
              - email
              - percentage
            properties:
              email:
                type: string
                format: email
              percentage:
                type: number
                minimum: 0.01
                maximum: 100
    PixResponse:
      type: object
      properties:
        success:
          type: boolean
        idempotent_replay:
          type: boolean
        data:
          $ref: '#/components/schemas/PixCharge'
    PixCharge:
      type: object
      properties:
        merchant:
          $ref: '#/components/schemas/Merchant'
        integration:
          $ref: '#/components/schemas/Integration'
        transaction_uuid:
          type: string
          format: uuid
        reference:
          type: string
          nullable: true
        amount:
          type: number
        fee:
          type: number
        amount_net:
          type: number
        status:
          $ref: '#/components/schemas/TransactionStatus'
        qr_code:
          type: string
          nullable: true
        pix_code:
          type: string
          nullable: true
        pix_key:
          type: string
          nullable: true
          description: Alias legado do codigo Pix; prefira pix_code
        qr_code_base64:
          type: string
          nullable: true
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: Fonte da verdade para vencimento
        expires_in_seconds:
          type: integer
          nullable: true
        settlement:
          type: string
          enum:
            - brl
            - usdt
    CardRequest:
      type: object
      required:
        - amount
        - card
        - payer_name
      properties:
        amount:
          type: number
          minimum: 1
        installments:
          type: integer
          minimum: 1
          maximum: 12
          default: 1
        card:
          type: object
          required:
            - number
            - holder
            - expiration
            - cvv
          properties:
            number:
              type: string
            holder:
              type: string
            expiration:
              type: string
            cvv:
              type: string
        payer_name:
          type: string
        payer_email:
          type: string
          format: email
        payer_cpf:
          type: string
        payer_phone:
          type: string
        billing:
          type: object
        description:
          type: string
        three_ds:
          type: string
          enum:
            - none
            - auto
            - required
        return_url:
          type: string
          format: uri
    CardResult:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          type: object
          properties:
            merchant:
              $ref: '#/components/schemas/Merchant'
            integration:
              $ref: '#/components/schemas/Integration'
            transaction_uuid:
              type: string
              format: uuid
            status:
              type: string
              enum:
                - approved
                - requires_authentication
                - processing
                - declined
                - failed
            amount:
              type: number
            fee:
              type: number
            amount_net:
              type: number
            installments:
              type: integer
            authentication_url:
              type: string
              nullable: true
    PaymentDetail:
      type: object
      properties:
        merchant:
          $ref: '#/components/schemas/Merchant'
        integration:
          $ref: '#/components/schemas/Integration'
        uuid:
          type: string
          format: uuid
        amount:
          type: number
        fee:
          type: number
        amount_net:
          type: number
        type:
          type: string
          enum:
            - pix
            - credit
        status:
          $ref: '#/components/schemas/TransactionStatus'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        card:
          type: object
          nullable: true
        release_schedule:
          type: array
          nullable: true
          items:
            type: object
        settlement:
          type: object
          nullable: true
    Transaction:
      type: object
      properties:
        merchant:
          $ref: '#/components/schemas/Merchant'
        integration:
          $ref: '#/components/schemas/Integration'
        uuid:
          type: string
          format: uuid
        transaction_uuid:
          type: string
          format: uuid
        reference:
          type: string
          nullable: true
        amount:
          type: number
        amount_gross:
          type: number
        amount_net:
          type: number
        fee:
          type: number
        type:
          type: string
        payment_method:
          type: string
        status:
          $ref: '#/components/schemas/TransactionStatus'
        settlement:
          type: string
        description:
          type: string
          nullable: true
        external_id:
          type: string
          nullable: true
        payer:
          type: object
          nullable: true
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        paid_at:
          type: string
          format: date-time
          nullable: true
        expires_at:
          type: string
          format: date-time
          nullable: true
    Pagination:
      type: object
      properties:
        current_page:
          type: integer
        last_page:
          type: integer
        per_page:
          type: integer
        total:
          type: integer
    Balance:
      type: object
      properties:
        currency:
          type: string
          example: BRL
        balance:
          type: number
        frozen:
          type: number
        debt:
          type: number
        reserve:
          type: number
        available_for_withdrawal:
          type: number
    Statement:
      type: object
      properties:
        merchant:
          $ref: '#/components/schemas/Merchant'
        success:
          type: boolean
        period:
          type: object
        totals:
          type: object
        entries:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                format: date-time
              type:
                type: string
              id:
                type: string
              reference:
                type: string
                nullable: true
              status:
                type: string
              gross:
                type: number
                description: Bruto recebido ou total debitado no saque
              fee:
                type: number
              net:
                type: number
                description: Valor efetivamente creditado ou enviado
    CashoutRequest:
      type: object
      required:
        - amount
        - pix_key
      properties:
        amount:
          type: number
          description: Total a debitar do saldo; a taxa sera descontada deste valor
        pix_key:
          type: string
          minLength: 5
          maxLength: 140
        pix_key_type:
          type: string
          enum:
            - CPF
            - CNPJ
            - EMAIL
            - PHONE
            - EVP
        reference:
          type: string
          maxLength: 120
        webhook_url:
          type: string
          format: uri
    Withdrawal:
      type: object
      properties:
        merchant:
          $ref: '#/components/schemas/Merchant'
        integration:
          $ref: '#/components/schemas/Integration'
        id:
          type: integer
        withdrawal_id:
          type: integer
        kind:
          type: string
        status:
          $ref: '#/components/schemas/WithdrawalStatus'
        amount:
          type: number
          description: Valor liquido efetivamente enviado para a chave Pix
        amount_gross:
          type: number
          description: Total debitado do saldo, igual ao amount solicitado na criacao
        fee:
          type: number
          description: Taxa descontada de amount_gross
        payout_amount:
          type: number
          description: Alias explicito do valor liquido enviado
        pix_key:
          type: string
        pix_key_type:
          type: string
        reference:
          type: string
          nullable: true
        created_at:
          type: string
          format: date-time
        processed_at:
          type: string
          format: date-time
          nullable: true
    WithdrawalResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        idempotent_replay:
          type: boolean
        withdrawal:
          $ref: '#/components/schemas/Withdrawal'
    WithdrawalQueryResponse:
      type: object
      properties:
        success:
          type: boolean
        withdrawal:
          $ref: '#/components/schemas/Withdrawal'
    PaymentLinkRequest:
      type: object
      required:
        - amount
        - description
      properties:
        amount:
          type: number
          minimum: 1
          maximum: 1000000
        description:
          type: string
          minLength: 2
          maxLength: 120
        methods:
          type: array
          items:
            type: string
            enum:
              - pix
              - credit_card
        max_installments:
          type: integer
          minimum: 1
          maximum: 12
        success_url:
          type: string
          format: uri
        cancel_url:
          type: string
          format: uri
        webhook_url:
          type: string
          format: uri
        expires_in_minutes:
          type: integer
          minimum: 5
          maximum: 43200
        single_use:
          type: boolean
          default: true
        external_reference:
          type: string
          maxLength: 100
    PaymentLink:
      type: object
      properties:
        merchant:
          $ref: '#/components/schemas/Merchant'
        integration:
          $ref: '#/components/schemas/Integration'
        id:
          type: string
          format: uuid
        status:
          type: string
          enum:
            - active
            - paid
            - expired
            - cancelled
        checkout_url:
          type: string
          format: uri
        amount:
          type: number
        description:
          type: string
        methods:
          type: array
          items:
            type: string
        max_installments:
          type: integer
          nullable: true
        single_use:
          type: boolean
        external_reference:
          type: string
          nullable: true
        success_url:
          type: string
          nullable: true
        cancel_url:
          type: string
          nullable: true
        expires_at:
          type: string
          format: date-time
          nullable: true
        created_at:
          type: string
          format: date-time
        paid_at:
          type: string
          format: date-time
          nullable: true
        transaction_uuid:
          type: string
          format: uuid
          nullable: true
        payment_method:
          type: string
          nullable: true
    PaymentLinkResponse:
      type: object
      properties:
        success:
          type: boolean
        payment_link:
          $ref: '#/components/schemas/PaymentLink'
    WebhookEvent:
      type: object
      description: Corpo enviado para a URL de webhook do integrador
      properties:
        id:
          type: string
          format: uuid
        event:
          type: string
          enum:
            - deposit.completed
            - transaction.waiting_payment
            - transaction.failed
            - transaction.refunded
            - transaction.chargeback
            - transaction.completed
            - withdrawal.pending
            - withdrawal.completed
            - withdrawal.failed
            - pix_payment.pending
            - pix_payment.completed
            - pix_payment.failed
            - crypto_settlement.completed
            - crypto_settlement.failed
            - checkout.order_paid
        data:
          type: object
          properties:
            merchant:
              $ref: '#/components/schemas/Merchant'
            integration:
              $ref: '#/components/schemas/Integration'

        created_at:
          type: string
          format: date-time

