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

# Déclencher un webhook de test

> Trigger a test event to mimic a webhook event at a given URL.

### Événements Webhook valides

Nous acceptons les événements Webhook suivants

| Événement                          | Déclencheur                                                                     |
| :--------------------------------- | :------------------------------------------------------------------------------ |
| `customer.tokenized`               | Un client est tokenisé                                                          |
| `order.authorized`                 | Une commande est autorisée par Sezzle                                           |
| `order.captured`                   | Une commande est capturée par Sezzle                                            |
| `order.refunded`                   | Une commande est remboursée par Sezzle                                          |
| `dispute.merchant_input_requested` | Un litige est déposé par un acheteur et la contribution du marchand est requise |
| `dispute.deadline_approaching`     | Un litige est transféré en avis final par Sezzle                                |
| `dispute.closed.customer_win`      | L'acheteur gagne le litige et la commande est remboursée                        |
| `dispute.closed.merchant_win`      | Le marchand gagne le litige et il est résolu en sa faveur                       |
| `dispute.closed.neutral`           | Aucun gagnant clair n'est déterminé et le litige est résolu de manière neutre   |


## OpenAPI

````yaml post /v2/webhooks/test
openapi: 3.1.0
info:
  title: Sezzle API v2
  description: >-
    This Sezzle API is for merchants who want to accept Sezzle as a payment
    option
  termsOfService: https://legal.sezzle.com
  version: 2.0.0
  x-logo:
    url: https://media.sezzle.com/branding/2.0/png/Logo_WhiteWordmark_500x126.png
    backgroundColor: '#392558'
servers:
  - url: https://sandbox.gateway.sezzle.com
    description: development server, usa, ca
  - url: https://gateway.sezzle.com
    description: production server, usa, ca
security:
  - Bearer: []
externalDocs:
  description: Sezzle API guides and tutorials
  url: https://docs.sezzle.com/sezzle-integration
paths:
  /v2/webhooks/test:
    post:
      tags:
        - Webhooks
      summary: Trigger a test webhook
      description: Trigger a test event to mimic a webhook event at a given URL.
      operationId: HandleTestWebhooks
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WebhookTestRequest'
            example:
              event: order.authorized
              url: https://example.com/webhooks
      responses:
        '201':
          $ref: '#/components/responses/StatusCreatedV2'
        '400':
          $ref: '#/components/responses/BadRequestV2'
          example:
            code: bad_request
            message: bad request
        '401':
          $ref: '#/components/responses/UnauthorizedV2'
          example:
            code: unauthorized
            message: authorization not accepted
        '404':
          $ref: '#/components/responses/NotFoundV2'
          example:
            code: record_not_found
            message: not found
        '422':
          $ref: '#/components/responses/UnprocessableV2'
          example:
            code: invalid
            message: UnprocessableV2 entity
components:
  schemas:
    WebhookTestRequest:
      type: object
      properties:
        event:
          $ref: '#/components/schemas/WebhookTestEvents'
        url:
          type: string
          description: >-
            A url to receive the test webhook. If omitted, the test webhook is
            sent to all urls subscribed to that event.
      required:
        - url
        - event
    WebhookTestEvents:
      type: string
      description: One of the Valid Webhook Events
      enum:
        - customer.tokenized
        - order.authorized
        - order.captured
        - order.refunded
        - dispute.merchant_input_requested
        - dispute.deadline_approaching
        - dispute.closed.customer_win
        - dispute.closed.merchant_win
        - dispute.closed.neutral
    ErrorV2:
      type: object
      properties:
        code:
          type: string
          description: The general error type
        message:
          type: string
          description: A more specific error message, if available
        location:
          type: string
          description: Where the error occurred
        debug_uuid:
          type: string
          description: The unique identifier assigned to this error for troubleshooting
  responses:
    StatusCreatedV2:
      description: Status Created
    BadRequestV2:
      description: Invalid request
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ErrorV2'
          example:
            - code: bad_request
              message: bad request
    UnauthorizedV2:
      description: >-
        Unauthorized. Returned for any failed bearer or basic auth, including
        expired bearer tokens.
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ErrorV2'
          example:
            - code: unauthorized
              message: authorization not accepted
    NotFoundV2:
      description: The specified resource was not found
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ErrorV2'
          example:
            - code: record_not_found
              message: not found
    UnprocessableV2:
      description: Unable to process the request entity
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ErrorV2'
          example:
            - code: invalid
              message: Unprocessable entity
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header
      description: >-
        The authentication token generated from providing API Keys to Sezzle
        Gateway

````