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

# Test webhook

> Sends test notifications, with fictitious data, and returns the HTTP status returned by the endpoint.



## OpenAPI

````yaml /openapi.yaml post /webhooks/{webhookId}/test
openapi: 3.0.3
info:
  title: Fincle API
  version: 1.0.0
  description: >-
    Fincle payments API: charges by Pix, credit card and boleto, subscriptions,
    transactions, refunds, infractions, notifications and transfers.
servers:
  - url: https://api.fincle.com.br
    description: Production server
security: []
tags:
  - name: Authentication
    description: Issuance of the access token from the API key.
  - name: Charges
    description: Creation of charges by Pix, credit card and boleto.
  - name: Subscriptions
    description: Recurring billing on credit card.
  - name: Transactions
    description: Retrieval and refund of transactions.
  - name: Refunds
    description: Refund requests submitted by payers.
  - name: Infractions and MED
    description: Pix infraction reports and the amounts blocked as a result.
  - name: Webhooks
    description: Registration of notification endpoints and tracking of deliveries.
  - name: Balance and transfers
    description: Balance, statement, fees and transfer of the amounts received.
paths:
  /webhooks/{webhookId}/test:
    post:
      tags:
        - Webhooks
      summary: Test webhook
      description: >-
        Sends test notifications, with fictitious data, and returns the HTTP
        status returned by the endpoint.
      operationId: testWebhook
      parameters:
        - schema:
            type: integer
            exclusiveMinimum: true
            minimum: 0
          in: path
          name: webhookId
          required: true
          description: Webhook identifier.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                events:
                  type: array
                  items:
                    type: string
                    enum:
                      - transaction_created
                      - transaction_paid
                      - transaction_refunded
                      - transaction_updated
                      - transfer_completed
                      - transfer_canceled
                      - transfer_created
                      - transfer_updated
                      - infraction
                      - card_declined
                      - sale_lost
                      - cart_abandoned
                      - product_canceled
                      - release_access
                      - vturb_paid
                      - vk_metrics_purchase
                      - refund_requested
                  minItems: 1
                  maxItems: 17
                  description: >-
                    Events to send in the test. When omitted, one payload is
                    sent for each subscribed event. An event the webhook does
                    not subscribe to returns 400.
              additionalProperties: false
            example:
              events:
                - transaction_paid
      responses:
        '200':
          description: Result of the test delivery.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Always `true` in a successful response.
                  data:
                    type: object
                    properties:
                      webhookId:
                        type: integer
                        description: Webhook tested.
                      url:
                        type: string
                        description: URL that received the test payloads.
                      results:
                        type: array
                        items:
                          type: object
                          properties:
                            event:
                              type: string
                              enum:
                                - transaction_created
                                - transaction_paid
                                - transaction_refunded
                                - transaction_updated
                                - transfer_completed
                                - transfer_canceled
                                - transfer_created
                                - transfer_updated
                                - infraction
                                - card_declined
                                - sale_lost
                                - cart_abandoned
                                - product_canceled
                                - release_access
                                - vturb_paid
                                - vk_metrics_purchase
                                - refund_requested
                              description: Event whose test payload was sent.
                            success:
                              type: boolean
                              description: '`true` when your server responded with 2xx.'
                            httpStatus:
                              type: integer
                              nullable: true
                              description: HTTP status returned by your server.
                            error:
                              type: string
                              nullable: true
                              description: >-
                                Reason for the failure, when the delivery did
                                not succeed.
                          required:
                            - event
                            - success
                            - httpStatus
                            - error
                          additionalProperties: false
                        description: One result per event sent.
                    required:
                      - webhookId
                      - url
                      - results
                    additionalProperties: false
                required:
                  - success
                  - data
                additionalProperties: false
                description: Result of the test delivery.
              example:
                success: true
                data:
                  webhookId: 412
                  url: https://api.example.com/webhooks/fincle
                  results:
                    - event: transaction_paid
                      success: true
                      httpStatus: 200
                      error: null
        '400':
          description: The request is well formed, but a business rule rejected it.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Always `false` in an error response.
                  message:
                    type: string
                    description: Readable message explaining the failure.
                required:
                  - success
                  - message
                additionalProperties: false
                description: The request is well formed, but a business rule rejected it.
              example:
                success: false
                message: >-
                  Não foi possível concluir: uma regra de negócio recusou os
                  dados enviados.
        '401':
          description: Token missing, invalid, expired or belonging to a blocked account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Always `false` in an error response.
                  message:
                    type: string
                    description: Readable message explaining the failure.
                required:
                  - success
                  - message
                additionalProperties: false
                description: >-
                  Token missing, invalid, expired or belonging to a blocked
                  account.
              example:
                success: false
                message: Token inválido ou expirado
        '404':
          description: >-
            The resource does not exist, was deleted or belongs to another
            account.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Always `false` in an error response.
                  message:
                    type: string
                    description: Readable message explaining the failure.
                required:
                  - success
                  - message
                additionalProperties: false
                description: >-
                  The resource does not exist, was deleted or belongs to another
                  account.
              example:
                success: false
                message: Recurso não encontrado
        '422':
          description: The request did not pass schema validation.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Always `false` in an error response.
                  message:
                    type: string
                    description: Readable message explaining the failure.
                required:
                  - success
                  - message
                additionalProperties: false
                description: The request did not pass schema validation.
              example:
                success: false
                message: 'name: Nome é obrigatório'
        '429':
          description: >-
            Too many requests: the limit is 1000 requests per minute per source
            IP. Wait the number of seconds given in the `retry-after` header and
            retry with exponential backoff.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Always `false` in an error response.
                  message:
                    type: string
                    description: Readable message explaining the failure.
                required:
                  - success
                  - message
                additionalProperties: false
                description: >-
                  Too many requests: the limit is 1000 requests per minute per
                  source IP. Wait the number of seconds given in the
                  `retry-after` header and retry with exponential backoff.
              example:
                success: false
                message: Muitas requisições. Tente novamente em breve.
          headers:
            retry-after:
              $ref: '#/components/headers/retry-after'
            x-ratelimit-limit:
              $ref: '#/components/headers/x-ratelimit-limit'
            x-ratelimit-remaining:
              $ref: '#/components/headers/x-ratelimit-remaining'
            x-ratelimit-reset:
              $ref: '#/components/headers/x-ratelimit-reset'
        '500':
          description: >-
            Internal failure while processing the request. Retry; if it
            persists, open a support ticket stating the time and the route.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: Always `false` in an error response.
                  message:
                    type: string
                    description: Readable message explaining the failure.
                required:
                  - success
                  - message
                additionalProperties: false
                description: >-
                  Internal failure while processing the request. Retry; if it
                  persists, open a support ticket stating the time and the
                  route.
              example:
                success: false
                message: Erro interno do servidor
      security:
        - bearerAuth: []
components:
  headers:
    retry-after:
      description: Seconds to wait before repeating the request.
      schema:
        type: integer
    x-ratelimit-limit:
      description: >-
        Maximum number of requests in the window (1000). Present in every
        response.
      schema:
        type: integer
    x-ratelimit-remaining:
      description: >-
        Number of requests still available in the current window. Present in
        every response.
      schema:
        type: integer
    x-ratelimit-reset:
      description: Seconds until the window counter resets. Present in every response.
      schema:
        type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.