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

# Simulate Card Webhook

> Trigger a synthetic card transaction webhook in Sandbox to verify your webhook listeners end-to-end

## Overview

The `POST /merchant/cards/{id}/simulate-webhook` endpoint fires a synthetic card webhook in the **Sandbox** environment directly to your configured webhook URL, allowing you to verify receivers end-to-end without real card swipes or third-party POS devices.

> \[!NOTE]
> **Sandbox Only**: This endpoint is strictly restricted to Sandbox/Test mode (`environment: TEST`). Live/Production keys will reject this request with a `400 Bad Request` or `403 Forbidden` error.

***

## Path Parameters

| Parameter | Type | Required | Description |
| :- | :- | :- | :- |
| `id` | `string` | **Yes** | The unique identifier or reference of the virtual card created in Sandbox. |

***

## Request Body Parameters

| Field | Type | Required | Allowed Values | Description |
| :- | :- | :- | :- | :- |
| `event_type` | `string` | **Yes** | `authorization`<br />`settlement`<br />`reversal`<br />`decline` | The card transaction lifecycle event you wish to simulate. |

***

## Event Types

| Event Type | Dispatched Webhook Event | Description |
| :- | :- | :- |
| `authorization` | `virtualcard.transaction.authorization` | Simulates an authorization hold approval on the card. |
| `settlement` | `virtualcard.transaction.settlement` | Simulates merchant settlement of a previously authorized transaction. |
| `reversal` | `virtualcard.transaction.reversed` | Simulates reversal of an authorization hold back to the card balance. |
| `decline` | `virtualcard.transaction.declined` | Simulates a transaction decline (e.g., insufficient funds or CVV failure). |

***

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.laikipay.com/v1/merchant/cards/crd_98a12e0bf4/simulate-webhook" \
    -H "Authorization: Bearer sk_test_..." \
    -H "Content-Type: application/json" \
    -d '{
      "event_type": "authorization"
    }'
  ```

  ```javascript Node.js theme={null}
  const res = await fetch("https://api.laikipay.com/v1/merchant/cards/crd_98a12e0bf4/simulate-webhook", {
    method: "POST",
    headers: {
      "Authorization": "Bearer sk_test_...",
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      event_type: "authorization"
    })
  });
  const data = await res.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.laikipay.com/v1/merchant/cards/crd_98a12e0bf4/simulate-webhook"
  headers = {
      "Authorization": "Bearer sk_test_...",
      "Content-Type": "application/json"
  }
  payload = {
      "event_type": "authorization"
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```
</CodeGroup>

***

## Response Schema

```json theme={null}
{
  "success": true,
  "message": "Card webhook simulated successfully",
  "data": {
    "event_type": "virtualcard.transaction.authorization",
    "reference": "SIMULATE_AUTH_9afbc353-6ead-41d4-b046-78fa23b1cf03",
    "callback_url": "https://your-domain.com/webhooks/cards",
    "dispatched": true,
    "skip_reason": null
  },
  "timestamp": "2026-10-14T15:30:00.000Z"
}
```


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