Webhooks overview
Swop calls your server when a buyer pays and when you get paid, so you don't have to poll.
A webhook is an HTTP request Swop sends to a URL on your server when something happens. Instead of asking Swop "is it paid yet?" over and over, you register an endpoint once and Swop tells you.
The two events
| Event | Fires when | What to do |
|---|---|---|
checkout.paid | The buyer's money arrived and the order exists | Fulfil the order: ship it, send the download, grant access |
payout.released | Swop released your money (escrow released, or transfer sent) | Book the revenue |
checkout.paid doesn't mean you've been paid
For physical goods sold online, your payout is held in escrow until the buyer confirms delivery. For card sales that can be days later. Ship on checkout.paid; count the money on payout.released.
There's also a ping event, sent only when you press Send test in the Developer page.
How a delivery works
- A sale crosses a milestone (paid, or payout released).
- Within about a minute, Swop queues one delivery per webhook that subscribed to that event.
- Swop
POSTs JSON to your URL with aSwop-Signatureheader. - Your server verifies the signature, does its work, and returns any
2xx. - Anything else (or no answer within 10 seconds) is retried with backoff.