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

# Test Webhook

> Send a test event to a registered webhook endpoint

Sends a test payload to the partner's webhook URL to verify connectivity and correct signature validation on the receiving end. The test event uses a clearly marked test payload that should not trigger production logic.

## Path Parameters

<ParamField path="partnerId" type="string" required>
  ID of the webhook partner to test.
</ParamField>

## Response Fields

<ResponseField name="success" type="boolean">Request status.</ResponseField>

<ResponseField name="data" type="object">
  Test delivery result including the HTTP status code returned by the webhook endpoint.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://api.trusset.org/stocks/api/webhooks/test/wh_abc123" \
    -H "X-API-Key: trusset_abc123xy_secret..."
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch(
    `https://api.trusset.org/stocks/api/webhooks/test/${partnerId}`,
    {
      method: 'POST',
      headers: { 'X-API-Key': 'trusset_abc123xy_secret...' }
    }
  );
  const { data } = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "delivered": true,
      "statusCode": 200,
      "responseTime": 142
    },
    "metadata": {
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-06-15T12:00:00.000Z",
      "instanceId": "inst_abc123"
    }
  }
  ```

  ```json Error - Not Found theme={null}
  {
    "success": false,
    "error": {
      "code": "NOT_FOUND",
      "message": "Partner not found"
    },
    "metadata": {
      "requestId": "550e8400-e29b-41d4-a716-446655440000",
      "timestamp": "2025-06-15T12:00:00.000Z",
      "instanceId": "inst_abc123"
    }
  }
  ```
</ResponseExample>
