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

# Replay & test

> Inspect delivery history, manually replay events, and fire synthetic test events for handler development.

Webhook infrastructure is only useful if you can debug it. The Integration
API exposes three tools: delivery history (30-day retention), manual
replay, and synthetic test fire.

## Delivery history

```bash theme={null}
curl "https://api.novatrade24.com/v1/webhooks/${WEBHOOK_ID}/deliveries?status=FAILED&since=2026-04-20T00:00:00Z" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}"
```

Response is a paginated list:

```json theme={null}
{
  "data": [
    {
      "id": "del_...",
      "eventId": "evt_a1b2c3d4",
      "eventType": "compliance.status_changed",
      "status": "FAILED",
      "httpStatus": 503,
      "attempts": 10,
      "lastAttemptAt": "2026-04-21T15:30:00Z",
      "nextRetryAt": null,
      "createdAt": "2026-04-21T10:00:00Z"
    },
    ...
  ],
  "pagination": { ... }
}
```

Query params:

* `status` — `PENDING`, `DELIVERED`, `FAILED`.
* `since` — ISO timestamp, filters to deliveries created after.
* `page`, `size`, `sort`.

Deliveries are retained for **30 days**. Older deliveries are purged and
no longer replayable.

## Manual replay

```bash theme={null}
curl -X POST "https://api.novatrade24.com/v1/webhooks/${WEBHOOK_ID}/deliveries/${DELIVERY_ID}/replay" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -H "Idempotency-Key: $(uuidgen)"
```

Returns `202 Accepted`. The original event payload is re-delivered to your
endpoint with a fresh `X-Novatrade-Signature` (timestamp updated).

Use cases:

* Your endpoint was down; you fixed it and want to process missed events.
* You deployed a bug fix and want to re-process yesterday's events
  idempotently (your handler dedups on event `id`).
* You want to debug a single failure in a new environment.

Your handler should be idempotent on event `id` — replays share the
original `id`, so reprocessing is detected as a duplicate and is a no-op.

## Synthetic test fire

Fire a test event with an arbitrary payload to exercise your handler
without waiting for real state changes:

```bash theme={null}
curl -X POST "https://api.novatrade24.com/v1/webhooks/${WEBHOOK_ID}/test" \
  -H "Authorization: Bearer ${ACCESS_TOKEN}" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "eventType": "compliance.status_changed",
    "data": {
      "orderUuid": "00000000-0000-0000-0000-000000000000",
      "previousStatus": "INCOMPLETE",
      "currentStatus": "VALID",
      "blockers": []
    }
  }'
```

* Signed identically to real events.
* The `data` payload is forwarded verbatim — your handler should treat
  it as a real event.
* Typically used with UUIDs you recognize as synthetic (all-zero,
  reserved test UUIDs) so your handler branches into a no-op path for
  downstream side effects.

## Debugging checklist

<AccordionGroup>
  <Accordion title="No deliveries appearing in history">
    * Check the endpoint is `ACTIVE` (not paused) via `GET /v1/webhooks/{id}`.
    * Confirm the event type is in your subscribed `events` list.
    * Confirm `partnerIds` filter (if set) includes the partner the event
      pertains to.
    * Fire a synthetic test event via `/test` — it appears in history
      regardless of subscription filters.
  </Accordion>

  <Accordion title="Signature verification fails">
    * Use the **raw** request body, not a parsed/re-serialized one.
    * Use the endpoint's `secret` from the original create response, not a
      different endpoint's secret.
    * Check the timestamp is within 5 minutes of now — if you replay an
      old captured event via your test harness, it may be outside the window.
  </Accordion>

  <Accordion title="Endpoint auto-paused">
    * Check email to your organization admin.
    * Use `GET /v1/webhooks/{id}` → `status` field should read `PAUSED`.
    * Look at delivery history for the failure pattern.
    * Fix the downstream issue, then `PATCH /v1/webhooks/{id}` with
      `status: ACTIVE`.
    * Replay important missed events from history.
  </Accordion>

  <Accordion title="Duplicate events arriving">
    * Expected — at-least-once delivery. Dedupe on event `id`.
    * If you see the same event delivered \~72h apart, it's a successful
      initial delivery followed by a manual replay you (or your team) ran.
  </Accordion>
</AccordionGroup>

## Local development with Prism

For handler development without touching the real API, use Prism to
serve stub webhook events:

```bash theme={null}
npx @stoplight/prism-cli mock \
  "https://raw.githubusercontent.com/novatrade24/.../asyncapi-integration-v1.yaml" \
  -p 4011
```

Prism is best for request-shape verification; for end-to-end testing use
the `/test` endpoint on a real registered webhook.

## Next

<CardGroup cols={2}>
  <Card title="Setup" icon="plug" href="/webhooks/setup">
    Register an endpoint.
  </Card>

  <Card title="Event catalog" icon="list" href="/webhooks/event-catalog">
    All payload schemas.
  </Card>
</CardGroup>
