ExamplesOverview

Examples — Overview

Choose one task and download its source files. Start with a small read-only request; a funded balance and webhook configuration are only needed for their respective scenarios.

TaskNode.jsPythonExpected result
First catalogue requestFirst GETFirst GETHTTP 200 and at most one item.
Save a purchase intent and recover an uncertain resultPurchasePurchaseOne stable business custom_id; current purchase details.
Stream a snapshot, then replay and follow live updatesCatalogueCatalogueAtomic local catalogue plus saved ETag, cursor and epoch.
Verify and accept a webhook durablyReceiverReceiverA committed inbox entry before HTTP 204; no duplicate business effect.

What you need before starting

  • First GET: a merchant API key and Node.js 22.13+ or Python 3.11+.
  • Catalogue synchronization: disk space for a complete catalogue and its staging transaction, plus the optional streaming/WebSocket dependencies listed on each language page.
  • A real purchase: an existing business order, its recipient’s trade URL, a current item, a consent ceiling, and a funded balance. The submit command spends real money.
  • Local webhook test: only the downloadable synthetic fixture. It uses a test secret and sends to 127.0.0.1; no purchase, payment, tunnel or production replay is needed.

The same catalogue fixture, purchase input and webhook/HMAC fixture feed both offline test suites. They cover unknown purchase outcomes, changing by-name attempts, recipient mismatch, interrupted snapshots, WS checkpointing/pong/resync, duplicate and out-of-order events, a late rollback, and two deposit event IDs with one provider_uuid. These checks exercise the samples; they do not replace provider integration tests.

The SQLite examples use one local worker per database. The inbox and business-effect records are committed in transactions; connect external side effects through your own transactional outbox and idempotent worker. They are runnable integration patterns, not a hosted sandbox or a production deployment template.