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

# Simulate webhook

> Fire a test webhook in sandbox.

> [!NOTE]
>
> Sandbox only. Use sandbox keys; the webhook goes to your sandbox webhook URL.


## OpenAPI

````yaml POST /api/sandbox/b2b/utilities/simulate-webhook
openapi: 3.1.0
info:
  title: Tanda API
  version: 1.0.0
  description: >-
    Collect and send KES payments in Kenya through M-PESA, Airtel Money and bank
    transfer.
servers:
  - url: https://api.tandapay.io
    description: Sandbox and production (your keys decide which)
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Account
  - name: Checkout
  - name: Collections
  - name: Payouts
  - name: Beneficiaries
  - name: Transactions
  - name: Reference data
  - name: Webhooks
paths:
  /api/sandbox/b2b/utilities/simulate-webhook:
    post:
      tags:
        - Webhooks
      summary: Simulate webhook
      description: >-
        **Sandbox only.** Sends a webhook for a sandbox transaction to your
        sandbox webhook URL, so you can test your handler without waiting for a
        real event.
      operationId: simulate-webhook
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                externalReference:
                  type: string
                  description: Reference of a sandbox transaction.
                  example: order_10045
                webhookStatus:
                  type: string
                  description: Outcome to simulate.
                  enum:
                    - successful
                    - failed
                  default: successful
              required:
                - externalReference
            example:
              externalReference: order_10045
              webhookStatus: successful
      responses:
        '200':
          description: Webhook sent.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
              example:
                success: true
                message: Webhook simulated successfully
        '401':
          description: Missing, invalid or expired bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                message: Unauthorized
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: Human-readable; may change.
        errorCode:
          type: string
          description: Stable code to branch on.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Token from Generate bearer token.

````

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