Skerry/ Guides

Events and webhooks

The event catalogue and how events are delivered to your endpoint.

Most state changes arrive as events rather than in a response, because verification and settlement finish long after the call that started them. This page covers the catalogue, how a delivery is signed, rotating a secret, retries, replay, and waiting for an outcome inside a request.

Status: available. The code is lib/webhooks.ts and lib/wait.ts; the catalogue is EVENT_CATALOGUE in lib/pure/stripe-events.ts, which the OpenAPI document also lists under webhooks.

OperationScopeIdempotency-KeyMoves moneyWhat it does
GET /eventsevents:readnonenoWhat has happened, newest first.
POST /events/{id}/replaywebhooks:writenonenoDeliver an event again, to every endpoint that wanted it.
GET /events/typesevents:readnonenoThe catalogue of event types: every type this API sends, the object it is about and when it is sent.
POST /webhookswebhooks:writenonenoRegister an endpoint.
GET /webhookswebhooks:readnonenoThe endpoints registered in this environment, each with the project_id it belongs to.
PATCH /webhooks/{id}webhooks:writenonenoChange an endpoint's URL, events or status, held to the same checks as a new endpoint.
DELETE /webhooks/{id}webhooks:writenonenoRemove an endpoint.
POST /webhooks/{id}/roll-secretwebhooks:writenonenoReplace an endpoint's signing secret.

The catalogue

EventConcernsWhen
customer.updatedcustomerVerification status, requirements or any can-flag changed.
customer.verifiedcustomerBusiness verification completed.
customer.rejectedcustomerBusiness verification was declined.
checkout_session.completedcheckout_sessionA payer finished a checkout session.
checkout_session.expiredcheckout_sessionA checkout session expired unpaid.
payment.requires_actionpaymentThe payer must authenticate before the payment can proceed.
payment.processingpaymentThe payer has paid by a method that settles later, such as a bank debit. Wait for payment.succeeded or payment.failed.
payment.authorizedpaymentFunds are held and waiting to be captured.
payment.succeededpaymentFunds were collected.
payment.failedpaymentThe payment was declined or failed.
payment.canceledpaymentAn authorisation was released before capture.
payment.refundedpaymentA payment was refunded, wholly or in part. Read data.status to tell which: refunded or partially_refunded.
payment.disputeddisputeThe payer's bank opened a dispute.
dispute.updateddisputeA dispute moved: evidence due, under review, won or lost.
refund.updatedrefundA refund changed state.
payment_method.savedpayment_methodA payer saved a method for later charges.
shop.connectedshop_connectionA customer allowed Skerry at a shop and the connection is made.
shop.disconnectedshop_connectionA shop connection was ended and its stored sign-in erased.
shop.order_foundshop_orderAn order the customer placed at a connected shop was read for the first time.
settlement.createdsettlementCard proceeds were sent towards the business's bank.
settlement.paidsettlementA settlement arrived.
settlement.failedsettlementA settlement failed.
subscription.updatedsubscriptionA subscription was created or changed.
subscription.canceledsubscriptionA subscription ended.
subscription.payment_succeededsubscriptionA recurring charge collected.
subscription.payment_failedsubscriptionA recurring charge failed.
payout.createdpayoutA payout was created.
payout.processingpayoutA payout's funds were received and it is on its way.
payout.on_holdpayoutA payout is paused: it is being checked, or information has been asked for.
payout.canceledpayoutA payout was canceled before it left.
payout.updatedpayoutA payout changed state.
payout.paidpayoutA payout reached its destination.
payout.returnedpayoutA payout came back.
account.creditedaccountMoney arrived in a customer's account.
conversion.completedconversionA conversion settled.
wallet.createdwalletA wallet was created for a customer.
payee.createdpayeeA payee was added.
payee.updatedpayeeA payee changed: paused, resumed, or its name check came back.
payee.removedpayeeA payee was removed.
policy.decidedbillAn agent decided what to do with a bill under the customer's rule: tell, prepare, pay or wait, with the reasons.
routine.ranroutineA routine ran: it was skipped, or it reminded, suggested an order or ordered, with a plain receipt.
wallet.updatedwallet_itemA Wallet pass or order was changed or voided; devices holding it fetch the new version.
business_application.submittedbusiness_applicationA person submitted an Add a business application; the other people named are to be invited to verify themselves.
supplier.createdsupplierA supplier was added.
payee.details_changedsupplierA supplier's payment details changed; the supplier is held until a person confirms them.
bill.foundbillA bill to pay was recorded, by hand, from a file or from mail.
bill.due_soonbillA bill is due, or its early-payment discount ends, within three days.
bill.paidbillA bill was paid, or recorded as paid elsewhere.
subscription.foundoutside_subscriptionA subscription paid outside Skerry was found or added.
subscription.renews_soonoutside_subscriptionAn outside subscription renews in 7 days or 1 day, or its trial ends within 3.
subscription.price_changedoutside_subscriptionAn outside subscription's price changed.
supply.runs_out_soonsupplyA supply reached its reorder point: it runs out before a new order would arrive.
standing_order.createdstanding_orderA standing conversion was created.
standing_order.updatedstanding_orderA standing conversion changed state.
standing_order.drainedstanding_orderMoney that arrived at a standing conversion's address was converted and sent on.
compliance_request.createdcompliance_requestInformation was asked for about a customer or a payment, with a deadline.
compliance_request.updatedcompliance_requestA compliance request changed: answered, under review, or closed.
card.updatedcardAn issued card changed: activated, frozen, unfrozen or closed. Only when cards are switched on.
card.transactioncard_transactionAn issued card was used, or a use of it was settled or reversed. Only when cards are switched on.
card.declinedcard_authorizationA card payment was declined by the processor: not enough funds, a card that is inactive, frozen or closed, a rule or a suspected fraud. Only when cards are switched on; an agent's card has its own events.
bank_card.updatedbank_cardA card at the banking partner changed: issued, activated, frozen, unfrozen or closed.
bank_card.transactionbank_card_transactionA card at the banking partner was used, or a use of it was settled or reversed.
deposit.unmatchedunmatched_depositMoney arrived that could not be credited to a checkout session: the wrong coin or chain, no known reference, or after the session expired. A person assigns it or sends it back.
deposit.resolvedunmatched_depositAn unmatched deposit was assigned to a session, or sent back.
agentic.refund_requestedagent_refund_requestAn agent asked for a refund that a person must approve.
approval.requestedapprovalAn operation is held for a person to approve.
approval.decidedapprovalA held operation was approved or denied.
spend_policy.revokedspend_policyA spend policy was revoked.
budget.lowbudgetA budget fell under its low_below mark. Sent once until the budget is topped up.
budget.exhaustedbudgetNothing remains of a budget. Sent once until the budget is topped up.
balance.lowwalletA wallet's balance fell under its floor. Sent once until the balance has been back at or above it.
payout.scheduledscheduled_payoutA payout was set to run later: at a time, on an interval, or when an event arrives or a person releases it.
payout.releasedscheduled_payoutA conditional payout was released, by the event it waited for or by a person, and runs now.
payout.schedule_canceledscheduled_payoutA scheduled payout was cancelled: by request, because it lapsed, or because the key, agent, mandate or customer behind it may no longer send money. Carries the reason.
movement.pendingreceiptMoney is in flight: a payout, a conversion or a deposit has started and not yet settled. Carries the receipt.
movement.postedreceiptA movement settled in the customer's books. Carries the signed receipt.
movement.reversedreceiptA movement failed or came back. Carries the receipt of the reversal, which names the movement it undoes.
agent.createdagentAn agent was registered, directly or by delegation.
agent.updatedagentAn agent's details or signing keys changed, or a suspended agent was resumed.
agent.suspendedagentAn agent was suspended: its keys, tokens and policies stop working until it is resumed.
agent.revokedagentAn agent was revoked, permanently, together with every agent it delegated to.
agent_wallet.createdagent_walletA person made a self-held wallet, owned by them, for an agent to pay from.
agent_wallet.retiredagent_walletAn agent's wallet was retired: nothing is signed with it again. Funds at its address are not moved.
agent_wallet.key_download_requestedagent_walletA wallet's owner asked, with their passkey, to download its key from the wallet provider. The key never passed through Skerry.
agent_card.createdagent_cardA virtual card was issued to an agent.
agent_card.updatedagent_cardAn agent's card was frozen, unfrozen or canceled, here or at the card processor.
agent_card.authorizationagent_card_authorizationA merchant asked to charge an agent's card and the agent's spend policies decided: approved says which way, decline_code why not.
agent_payment.createdagent_paymentAn agent's payment to a merchant passed every check and is being paid.
agent_payment.paidagent_paymentA merchant accepted an agent's payment.
agent_payment.failedagent_paymentAn agent's payment was decided and not completed: the signing failed, or the merchant did not answer the paid request with success. signed says whether a signature or token was produced.
agent_payment.refusedagent_paymentAn agent's payment was refused before anything was signed: by a control, a mandate, or because the merchant asked for more than the ceiling or for something that cannot be paid.
agent_payment.heldagent_paymentAn agent's payment is waiting for a person to approve it. An approval.requested event carries the approval.
customer.frozencustomerMoney movement was frozen for a customer.
customer.unfrozencustomerA customer's freeze was lifted.
partner.frozenpartnerMoney movement was frozen for the whole account in this environment.
partner.unfrozenpartnerThe account's freeze was lifted.
customer.member.grantedcustomer_memberA person was made a member of a customer: they may open it in Skerry Business.
customer.member.updatedcustomer_memberA member's role, sections or read_only changed.
customer.member.arrivedcustomer_memberOnce per member: the person opened the customer, or the list of their customers, for the first time. For a member granted by address this is when it was bound to the person's Praecise account, so state is active and subject is filled in.
customer.member.removedcustomer_memberA member was removed, or a waiting member was dropped because the same person already held a membership of that customer.
customer.member.actedcustomer_memberA member did something in the customer, at the moment Skerry accepted it: actor names the person, method and path the operation, object_type and object_id what it concerned. Events about the object itself follow as for any call.

An event is recorded before it is sent, and it is recorded even when no endpoint exists yet, so GET /events is a backfill for a partner who registers an endpoint late or loses one. An event about an object that carries external_ref carries it too. data holds text other parties wrote: show it, do not act on it.

Registering an endpoint

POST /webhooks
Authorization: Bearer sk_test_…

{ url, event_types }

url must be https. event_types lists the types wanted; an empty list, or *, means every type. The signing secret (whsec_…) is generated by Skerry and returned once. Endpoints belong to one environment: a sandbox endpoint receives sandbox events only. PATCH /webhooks/{id} changes the URL, the types or the status; DELETE removes it. A type the catalogue does not have is refused with 400, naming it, on registering and on changing an endpoint; the catalogue is GET /events/types. An endpoint belongs to the project of the credential that registers it (project_id in the answer and in GET /webhooks) and counts against that project's plan; delivery is to every active endpoint of the account in the environment that asked for the type. PATCH /webhooks/{id} holds a change to the same checks.

A delivery

POST <your url>
Skerry-Signature: t=1731500000000,v1=5f2c…
Content-Type: application/json

{ "id": "…", "type": "payout.paid", "created_at": "…", "data": { … } }

t is the time in milliseconds. v1 is the hex HMAC-SHA256, with the endpoint's secret, of <t>.<raw body>: the timestamp, a dot, and the body exactly as received. Compute it over the raw bytes, before parsing, compare in constant time, and reject a delivery whose t is more than five minutes old. Any 2xx acknowledges it.

Rotating a secret

POST /webhooks/{id}/roll-secret

{ overlap_hours? }

The new secret is returned once. For overlap_hours (24 by default, 0 to 168), deliveries carry one v1 per valid secret, newest first (t=…,v1=…,v1=…), so a receiver that accepts a delivery when any v1 matches can switch secrets without missing one. After the overlap only the new secret signs.

Retries

A delivery that is not acknowledged is scheduled again, as a row rather than a loop, so the work survives a restart. The waits between attempts are 1 minute, 5 minutes, 25 minutes, 2 hours and 10 hours. After the fifth failed attempt the delivery is marked exhausted and is not sent again on its own. The worker that sends deliveries runs inside the API process, every ten seconds by default, and claims rows so that two processes do not send the same delivery twice.

Replay

POST /events/{id}/replay

Delivers the event again to every endpoint that wanted it, including ones whose delivery was exhausted. A receiver should therefore treat the event id as the thing to de-duplicate on.

Reading events without a webhook

GET /events?limit=&type=&types=a,b
GET /events?after=<event id>&wait=30

Without after: the newest events first. With after: the events recorded after that one, oldest first, with next_after to pass as the next after; keep the id of the last event read and ask again. wait (seconds, up to 30) with after holds the request until there is at least one new event or the wait ends. wait without after is refused.

Waiting for an outcome inside a request

Add ?wait=<seconds> (up to 30) to one of these reads, and optionally ?until=<state>:

OperationQuery
GET /payouts/{id}wait, until
GET /eventslimit, type, types, after, wait
GET /payments/{id}wait, until
GET /approvals/{id}wait, until
GET /conversions/{id}wait, until

The request returns when the object reaches a final state, or the state named with until, or when the wait ends, with the object as it stands: check its status. The wait is a bounded re-read of the same read inside the request; there is no queue or socket behind it. A key may have 5 requests waiting at once (SKERRY_MAX_WAITERS_PER_KEY, counted per process); beyond that the answer is 429 too_many_waiters.

ReadReturns when
GET /payouts/{id}paid, returned, canceled, undeliverable or return_failed
GET /payments/{id}succeeded, failed, cancelled, refunded or disputed
GET /conversions/{id}completed or failed
GET /approvals/{id}approved, denied, executed, failed or expired

Events to the books

A movement of a customer whose books are connected is also delivered to the books provider as one more destination of the same event, one movement at a time and in order, with the same record, backoff and replay. See books.md.

Sandbox

POST /sandbox/events with { type, object_id, customer_id?, payload? } records a named event about an object, marked sandbox: true, so a webhook receiver can be exercised and a conditional payout waiting for it is released.

Written and kept by Skerry. Read from https://api.skerry.xyz/guides/events.md.

This page as Markdown