Integration preview · provisional

Backend-first affiliate tracking

Examples below are provisional until the public interface is stable. The merchant backend owns verified payment events. Browser pages never receive a financial write credential.

Core calls

  1. Capture an eligible referral on the merchant website.
  2. Identify a customer from the trusted backend with referral evidence.
  3. Report a successful payment with stable customer and payment references.
  4. Report refunds with a unique refund reference.
  5. Read event processing status and commission records.

Supported reference stack

TypeScript/Hono on Workers with a local SQLite outbox and a Stripe test-mode recipe. Any backend can call the REST interface. The browser helper is framework-independent.

await affiliateKit.payments.record({
  eventId: "event_123",
  paymentId: "payment_456",
  customerId: "customer_789",
  occurredAt: "2026-09-21T10:00:00Z",
  currency: "EUR",
  commissionableAmountMinor: 4900,
});