Send test webhook API

Environment: Sandbox

Send a signed test webhook to your webhook_url or callback URL.

# Send test webhook API

Send a signed webhook.test event right now and see whether your endpoint accepted it. When the wallet has a webhook_url it goes there, in the webhook layout with one sample transaction (code WHT00, zero amount, reference WEBHOOK-TEST). A wallet without a webhook_url gets it on its callback URL, in the callback layout. The address must be an https URL on port 443 (WHT06 otherwise, and nothing is sent). A test event is sent once, with no retries, and appears in Webhook deliveries. Each wallet can send 10 tests a minute and 100 a day (WHT07). The response never includes your endpoint's reply, and a failed connection is reported only as "Connection failed", so a test cannot be used to probe addresses or ports.

## Endpoint
- **Method**: POST
- **URL**: https://sandbox.moolre.com/open/webhook/test

## Headers
| Header | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| X-API-USER | string | Yes | Your Moolre username. |
| X-API-KEY | string | Yes | Your wallet private API key. A public key is refused. |

## Request Body
| Parameter | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| accountnumber | string | Yes | Your Moolre wallet account number. |

## Response (200 Success)
The test event was sent. data.delivered tells you whether your endpoint accepted it (a 2xx answer). data.http is your endpoint's HTTP status (null when no answer came), data.duration_ms is how long the attempt took, and data.error is a short generic text when it failed: "Connection failed" (refused, timed out, unreachable or a TLS failure), "HTTP nnn" (a non-2xx status) or endpoint_rejected. data.response is always null; the key stays so existing clients keep working.

```json
{
  "status": 1,
  "code": "WHT01",
  "message": "Test webhook delivered.",
  "data": {
    "event_id": "evt_0123456789abcdef01234567",
    "delivered": true,
    "http": 200,
    "duration_ms": 142,
    "error": null,
    "response": null
  },
  "go": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```

## Response (200 (HTTP 422 in strict mode) No URL)
The wallet has neither a webhook_url nor a callback URL. Set one with Update account.

```json
{
  "status": 0,
  "code": "WHT02",
  "message": "No webhook_url or callback URL is set on this wallet.",
  "data": "callback",
  "go": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```

## Response (200 (HTTP 422 in strict mode) Not https on 443)
The webhook_url or callback is an http URL or uses another port. Nothing was sent. Change it to an https URL without a port with Update account.

```json
{
  "status": 0,
  "code": "WHT06",
  "message": "Test webhooks are sent only to https URLs on port 443. Change the callback URL of this wallet to an https URL without a port, then try again.",
  "data": "callback",
  "go": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```

## Response (200 (HTTP 429 in strict mode) Too many test webhooks)
The wallet has sent 10 test webhooks in the last minute or 100 in the last day. Try again later.

```json
{
  "status": 0,
  "code": "WHT07",
  "message": "Too many test webhooks. Try again later (10 per minute, 100 per day).",
  "data": null,
  "go": null,
  "meta": {
    "requestid": "req_c68f4c66115c26725c796242",
    "notices": []
  }
}
```


## Fields every response can carry

These fields are additive: existing fields keep their names, order and types.

| Field | Meaning |
| :--- | :--- |
| meta | Always present, last in the object. meta.replayed is true only when the response is the stored answer to a repeated Idempotency-Key (absent otherwise). meta.requestid is the unique id of the request (also the X-Request-Id response header): quote it when you contact support. meta.notices is always an array, empty when there is nothing to report; each notice is { code, message, docs? }, for example that a deprecated way of sending credentials was used. See [Deprecations](https://docs.moolre.com/guides/deprecations). |

There is no outcome field. Decide the result from status, code and, on payment and transfer endpoints, data.txstatus (0 pending, 1 succeeded, 2 failed). These codes mean the result is unknown and may still succeed, so treat them as pending and check the status: PY01, PY02, TR01, TR02, TP11, TP18, APY10, APY16, ASL06, IS30, SYS500. Status 1 with TR08, OBGH01, OTGH01, OBNG01, GHQ03 or OM03 is final success; any other status 1 is an accepted, unfinished request.

Send X-Moolre-Http-Status: strict to receive real HTTP status codes (400, 401, 403, 404, 409, 422, 429, 5xx) instead of HTTP 200. See [Responses and request IDs](https://docs.moolre.com/guides/responses).

Back to the Moolre AI documentation index