Skip to content

Event stream

Payment updates as server-sent events.

Operations

Events

Request

Stream payment events such as payment status or quote responses

Security
bearerAuth
Headers
last-event-idstring or null(Last-Event-Id)
Any of:

The id of the last event received; the stream resumes right after it. Any other value starts the stream live.

string
curl -i -X GET \
  https://docs.swiftxpay.com/_mock/openapi/v2/events \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'last-event-id: string'

Responses

Server-sent event stream of your payments. Each event has an event name and a JSON data line: payment carries the full payment (the same shape as GET /v2/payments/{id}); payment-update carries only its id, timestamp and new status.

Each event has an id (a UUID7). Reconnect with that id in Last-Event-ID to resume right after it; without one, the stream starts when you connect. Replay is best effort: only recent events are retained, and events sent before ids existed have none, so after a long disconnect fetch the payments you are waiting on with GET /v2/payments/{id}. Lines starting with : are comments (a ping every 15 seconds keeps the connection open) and carry no data. There is no filtering: you receive events for every payment on your account.

The Authorization header is required, so use a server-side SSE client; the browser EventSource API cannot send it.

Bodytext/event-stream
datastring
eventstring

Event type; selects the data shape.

Enum:"payment""payment-update"
idstring, (uuid)

UUID7 event id; send it back as Last-Event-ID to resume after it.

retryinteger, >= 0
Response
event: payment-update
data: {"id":"00000000-0000-4000-A000-000000000000","timestamp":"2024-12-01T01:05:00Z","status":"succeeded"}