Webhooks

Connect a webhook in Integrations and every event on the account POSTs to your URL the moment it happens — sales, refunds, upsells, cancellations, payouts. No polling.

How delivery works

One HTTP POST per event. The body is JSON, the event name is repeated in the x-swipefast-event header, every request is signed (below), and every payload carries event and sentAt. Return any 2xx to acknowledge. Every attempt — delivered or failed — is visible in your Recent activity log.

POST https://your-endpoint.example/hook
Content-Type: application/json
x-swipefast-event: order.paid
x-swipefast-signature: t=1792152204,v1=5f2b…

{ "event": "order.paid", "orderId": "ord_x1y2z3", …, "sentAt": "2026-07-20T14:03:24.001Z" }

Check the signature

Every webhook is signed with your account’s signing secret, found under Integrations → Webhook. The x-swipefast-signature header holds a timestamp t and v1, the hex HMAC-SHA256 of `${t}.${rawBody}`. Compute it from the raw request body, compare in constant time, and reject requests more than five minutes old.

import crypto from "node:crypto";

function isFromSwipefast(rawBody, header, secret) {
  const { t, v1 } = Object.fromEntries(header.split(",").map((p) => p.split("=")));
  if (Math.abs(Date.now() / 1000 - Number(t)) > 300) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(v1));
}

Every event

order.paidSale completed

A checkout settles — including held orders once the buyer decides on the upsell.

{
  "event": "order.paid",
  "orderId": "ord_x1y2z3",
  "orderNumber": "#000042",
  "product": "The Launch Playbook",
  "productId": "prd_a1b2c3",
  "email": "buyer@example.com",
  "name": "Anna Peeters",
  "firstName": "Anna",
  "country": "Belgium",
  "countryCode": "BE",
  "totalCents": 12600,
  "total": "$126",
  "currency": "usd",
  "affiliate": "ryanh",
  "accessUrl": "https://your-course.com/access",
  "supportEmail": "help@you.com",
  "answers": [
    {
      "id": "q_linkedin",
      "question": "Your LinkedIn or X link",
      "answer": "https://linkedin.com/in/anna"
    }
  ],
  "sentAt": "2026-07-20T14:03:24.001Z"
}
order.refundedOrder refunded

You refund an order. Any subscription born from it is cancelled, and its commission is voided.

{
  "event": "order.refunded",
  "orderId": "ord_x1y2z3",
  "orderNumber": "#000042",
  "product": "The Launch Playbook",
  "email": "buyer@example.com",
  "totalCents": 12600,
  "total": "$126",
  "currency": "usd",
  "sentAt": "2026-07-21T09:12:00.410Z"
}
upsell.acceptedUpsell taken

A buyer says yes to the post-purchase upsell.

{
  "event": "upsell.accepted",
  "orderId": "ord_x1y2z3",
  "orderNumber": "#000042",
  "upsell": "Upgrade to the full implementation call",
  "amountCents": 20000,
  "amount": "$200",
  "currency": "usd",
  "email": "buyer@example.com",
  "sentAt": "2026-07-20T14:04:01.812Z"
}
subscription.rebilledRenewal collected

A subscription's renewal charge went through.

{
  "event": "subscription.rebilled",
  "subscriptionId": "sub_m4k3r",
  "product": "Maker Club Membership",
  "email": "member@example.com",
  "amountCents": 4900,
  "amount": "$49",
  "currency": "usd",
  "sentAt": "2026-08-21T09:00:04.120Z"
}
subscription.payment_failedRenewal failed

A renewal charge was declined. Swipefast retries in 3 days; after 4 failed tries the subscription cancels.

{
  "event": "subscription.payment_failed",
  "subscriptionId": "sub_m4k3r",
  "product": "Maker Club Membership",
  "email": "member@example.com",
  "amountCents": 4900,
  "amount": "$49",
  "currency": "usd",
  "attempt": 1,
  "nextTryDays": 3,
  "sentAt": "2026-08-21T09:00:04.560Z"
}
subscription.canceledSubscription cancelled

You cancel a subscription. `subscription.paused` and `subscription.resumed` fire the same shape for those actions. `subscription.upgraded` and `subscription.downgraded` fire when a subscriber moves to another tier, with `fromPlan`, `toPlan`, `fromPriceCents`, `toPriceCents`, `effectiveAt` and `by` (buyer, seller or ai); an upgrade adds `amountCents`, what was charged for the rest of the period.

{
  "event": "subscription.canceled",
  "subscriptionId": "sub_m4k3r",
  "product": "Maker Club Membership",
  "email": "member@example.com",
  "mrrCents": 4900,
  "sentAt": "2026-07-21T10:00:12.230Z"
}
checkout.abandonedCheckout started, not paid

Only sent by an Automations rule with the trigger Checkout started, not paid and the action Send it to a web address, not by the webhook integration. Someone typed their email on the checkout and still hasn't paid `delayHours` later (1, 3, 12, 24 or 48, chosen on the rule). Once per person and checkout; never for anyone who bought in the meantime, and never in test mode or on the free trial. `name` is empty when they hadn't typed it yet.

{
  "automation": "Remind after a day",
  "event": "checkout.abandoned",
  "leadId": "lead_p9q8r7",
  "productId": "prd_a1b2c3",
  "product": "The Launch Playbook",
  "email": "buyer@example.com",
  "name": "Anna Peeters",
  "firstName": "Anna",
  "startedAt": "2026-07-20T14:01:10.220Z",
  "delayHours": 24,
  "checkoutUrl": "https://you.swipefast.io/launch-playbook",
  "sentAt": "2026-07-21T14:15:02.540Z"
}
affiliate.paidPartner paid

You record a commission payout to a partner.

{
  "event": "affiliate.paid",
  "affiliate": "ryanh",
  "name": "Ryan H",
  "email": "ryan@example.com",
  "amountCents": 12000,
  "commissionCount": 3,
  "payoutId": "pay_9f8e7d",
  "sentAt": "2026-07-21T11:30:00.000Z"
}
funnel.email.syncEmail handed over

A seller pushes their post-purchase emails to your tool — one event per email.

{
  "event": "funnel.email.sync",
  "productId": "prd_a1b2c3",
  "productSlug": "launch-playbook",
  "product": "The Launch Playbook",
  "position": 1,
  "sendDay": 0,
  "subject": "You're in — here's your access",
  "body": "…full email body…",
  "sentAt": "2026-07-19T16:21:00.551Z"
}

Testing without writing a receiver

Point a webhook at a request bin (webhook.site or similar), switch on test mode in Settings, and buy through your own checkout. You’ll see the full event stream for a real purchase without charging anyone — the order is tagged as a rehearsal and stays out of your numbers.