> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mx.ntxpay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enviar webhook de teste

> **Requer Bearer JWT**. Dispara um webhook de teste assinado (`X-NTXPay-Signature`) no webhook configurado para o `eventType` escolhido — ou numa `overrideUrl` (ex.: webhook.site). Use `status` `REJECTED`/`RETURNED` para simular estados de ERRO. One-shot (sem retry).



## OpenAPI

````yaml post /api/webhooks-config/test
openapi: 3.0.0
info:
  title: NTX Pay Public API — México
  description: >-
    API Pública NTX Pay para integração com SPEI (cash-in/cash-out) no México.
    Todos os valores monetários são expressos em centavos MXN.
  version: 1.0.0
  contact: {}
servers:
  - url: https://sandbox.mx.ntxpay.com
    description: Sandbox
security: []
tags:
  - name: auth
    description: Geração de token via certificado X.509 + clientId/clientSecret
  - name: SPEI
    description: >-
      Transferências interbancárias instantâneas mexicanas (cash-in via CLABE
      descartável; cash-out para CLABE)
  - name: Balance
    description: Consulta de saldo da conta (centavos MXN)
  - name: Webhooks Config
    description: Configuração de webhooks para notificações de eventos
paths:
  /api/webhooks-config/test:
    post:
      tags:
        - Webhooks Config
      summary: Enviar webhook de teste
      description: >-
        **Requer Bearer JWT**. Dispara um webhook de teste assinado
        (`X-NTXPay-Signature`) no webhook configurado para o `eventType`
        escolhido — ou numa `overrideUrl` (ex.: webhook.site). Use `status`
        `REJECTED`/`RETURNED` para simular estados de ERRO. One-shot (sem
        retry).
      operationId: WebhooksConfigController_test
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestWebhookInputDto'
      responses:
        '200':
          description: >-
            Resultado da entrega (delivered, statusCode, payloadSent,
            assinatura).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWebhookOutputDto'
        '400':
          description: Nenhum webhook configurado p/ o evento, ou payload inválido
        '401':
          description: Token inválido
        '502':
          description: Serviço temporariamente indisponível
      security:
        - bearer: []
components:
  schemas:
    TestWebhookInputDto:
      type: object
      required:
        - eventType
      properties:
        eventType:
          type: string
          enum:
            - cash_in
            - cash_out
            - refund_in
            - refund_out
            - internal_transfer
          description: Evento a simular (qual webhook recebe).
        status:
          type: string
          enum:
            - LIQUIDATED
            - PENDING
            - REJECTED
            - RETURNED
          default: LIQUIDATED
          description: Status no payload. REJECTED/RETURNED simulam estados de ERRO.
        overrideUrl:
          type: string
          description: >-
            URL temporária de teste (ex.: webhook.site). Se omitida, entrega na
            URL configurada. A assinatura usa o secret do webhook configurado.
        amountCentavos:
          type: integer
          minimum: 1
          default: 1000
          description: Valor em centavos (default 1000 = $10).
    TestWebhookOutputDto:
      type: object
      properties:
        delivered:
          type: boolean
          description: true = o endpoint do integrador respondeu 2xx.
        url:
          type: string
          description: URL para onde o webhook de teste foi enviado.
        eventId:
          type: string
          description: ID do evento (header x-event-id) — use para idempotência.
        status:
          type: string
        signed:
          type: boolean
          description: true = payload assinado (X-NTXPay-Signature).
        statusCode:
          type: integer
          description: >-
            Status HTTP que o endpoint do integrador respondeu (0 = erro de
            conexão).
        timeMs:
          type: integer
        signatureHeader:
          type: string
          nullable: true
          description: Header X-NTXPay-Signature enviado (sha256=<hex>).
        payloadSent:
          type: object
          description: Payload enviado — compare com o que seu endpoint recebeu.
          additionalProperties: true
        merchantResponse:
          nullable: true
          description: Trecho da resposta do seu endpoint.
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT obtido em POST /api/auth/token

````