Streaming
Streaming client for receiving real-time events
Introduction
The Streaming client is a package that interacts with our web API to receive real-time payment events, reliably, with a simple interface.
This feature is available to Pro and Business plan users only
Supported langauges
JS
JavaScript
Supports Node.js and other JavaScript runtimes
Installation
npm install @wayout/streaming-clientCode examples
const StreamingClient = require('@wayout/streaming-client');
const client = new StreamingClient("REPLACE_WITH_API_KEY");
client.serve((event) => {
// Handle the event here
});API key must have
Automate Payments permission
scope or higher.The serve function will receive all payment events
sequentially.
After the handler completes for one event, the next event will be received, or the client will wait for one to be sent.
If the serve function's handler completes without error, the notification is considered a success.
The handler can also be asynchronous, and the promise it returns will automatically be awaited before
the next event will be served. However, if you run the async function without the await operator, we can no longer
guarantee reliable delivery because uncaught errors will not be detectable.
Event Payloads
{
"id": "17000000000-0",
"invoice_id": "12345",
"status": "Paid",
"paid_at": "2025-11-11T11:11:00.000Z",
"payment_id": "6789"
}Schema
| Field | Type | Description |
|---|---|---|
| id | string | The unique identifier for the event. |
| invoice_id | string | The ID of the invoice. |
| status | string | The status of the invoice. Possible values are "Paid", "Confirming", and "Failed". |
| paid_at | string | The timestamp when the invoice was paid, in ISO 8601 |
| payment_id | string | The ID of the payment triggering this event associated with the invoice. |