Skip to main content
A verified webhook tells your server when to look. Proof of payment is a server-side read of the order that says paid now (scope orders:read).
Every request on this page goes to https://connect.laces.run/v1, from your server, with Authorization: Bearer <token>. Laces must first turn on payments for your organization, and your API key needs payments:write, orders:write and orders:read. Never send an organization id: Laces takes the organization from the token. The client secret stays on your server, never in a browser or an LLM chat. There is no sandbox: a pay request moves real money.

Set it up

In the Laces app (app.laces.run), an owner or admin opens Settings → Developers → Webhooks, adds a public https URL, picks the events, and copies the signing secret (LCSWHSEC-…-X, shown once) to your server. Send test event posts a signed ping, with no money involved.
Webhooks go to every subscribed endpoint of your organization, for every order: ticket orders and payments, whoever created them. Once Laces turns payments on, endpoints you already have start receiving payment orders, and API keys with orders:read start seeing them in reads and lists. Branch on data.order.order_type.

What is different from a ticket order

source_site is the host of source_url, or of the key’s default site. It says where you said the buyer was; it is not proof. No payload carries the buyer’s name, email or phone: read the order for those.

The payloads

order.paid
order.failed
order.refunded (the price only)
order.refunded (part)
  • order.paid can be late or out of order. Read the order and fulfil only if it is paid now: it may have been refunded since.
  • order.failed says an attempt failed, not that the buyer gave up. It can arrive while they are already trying again, and the order can still become paid. It is sent once per order: a second failure sends nothing. Its data.order.status is failed or expired. It is not sent for a try that never reached the payment provider. Don’t release stock or places on it: at your own deadline, read the order.
  • An abandoned payment sends nothing. Read the order.
  • refund.amount is in the order’s currency, minor units. For a cross-border payment that is the buyer’s currency, not requested_currency. refunded means the price is back; less is partially_refunded. Act on refund.amount, not only on the status. Order reads don’t show refunded amounts, and a refund that fails sends nothing. The fee can come back later, and one charge of an order paid twice can be returned without an event: see Refunds.
  • order.refunded is not proof that the buyer has the money. Where your balance is too low and you pay the buyer directly, it is sent when Laces records the refund, before you have paid them.

A complete handler (Node, Express)

webhook.js
Your db must do this: The price below is subtotal - discount_total + donation_total, on ticket orders and payments alike (on a payment it equals subtotal). stateOf reads fulfilled, undone and released of the purchase, shared by its ticket orders and payments. fulfilOnce, recordRefund, undo, rebook, release and adopt are one transaction each that locks the purchase’s row. They are short and never take withLock, which can be held for minutes.
  • fulfilOnce(purchaseId, order): sets fulfilled to order.id if it is empty and the purchase is not released. Only rebook changes it later. Returns "fulfilled", or does nothing and returns "already" (this same order did it, undone since or not), "refunded" (there are refunds saved for order.id, and they reach the price), "undone" (another order did it and it was undone), "paid_by_other_order", or "released" (nothing did it, and the stock or places were given back).
  • rebook(purchaseId, order): only if the purchase is released or undone, and no refunds saved for order.id reach the price. Takes stock or places again, clears undone and released, sets fulfilled to order.id. In any other case it changes nothing, so twice is the same as once and a purchase that stands is never overwritten.
  • undo(purchaseId, orderId): once, and only if purchase.fulfilled is orderId and purchase.undone is empty: sets purchase.undone to orderId and takes the goods or places back. A person who undoes by hand uses it too. purchase.fulfilled stays set.
  • recordRefund(purchaseId, order, refund): saves the refund once per refund.id, with order.id, then looks at all the refunds saved for that order, also when this one was saved before:
    • purchase.undone is order.id: returns "recorded". The fee coming back later, or an event after an undo by hand, changes nothing.
    • They are less than the price: returns "short", for a person to adjust.
    • They reach the price: does what undo does, in this same transaction, so a crash can’t save the refund without the undo. Returns "undone", or "recorded" if another order fulfilled the purchase, or none did. So refunding the second of two paid orders never undoes a real purchase.
  • priceIsBack(order): do the refunds saved for order.id reach the price?
  • saveForReview(purchaseId, order, why): a person looks at it, once per order and reason, also after they closed it. Unknown payments go there too.
  • attemptsOf(purchaseId): its payments. ticketOrdersOf(purchaseId): its event orders, { orderId, unansweredAt? }. Keep them apart: a payment retry can’t reuse a ticket order.
  • release: gives kept stock or places back, once, and sets released. Never if fulfilled is set, so it does nothing after an undo, which already gave them back.
  • adopt, findByTicketOrderId, saveTicketOrder: only if you move from event orders. adopt(purchaseId, orderId, { undone }) sets fulfilled, and undone if asked, only where fulfilled is empty. saveTicketOrder(purchaseId, orderId) adds the order to ticketOrdersOf once.
  • seenDelivery, markDelivery: the X-Laces-Delivery ids you have handled.
The secret is the whole string, with LCSWHSEC- and -X. Roll signing secret has no overlap: the old one stops at once, and queued events are signed with the new one, so deploy the new secret straight away. The 503 above keeps Laces trying meanwhile; a 400 stops after 3 tries. Those 503s still count towards the 50 failures in a row that switch the endpoint off. Other languages: Webhooks.

Delivery

Answer any 2xx within 10 seconds. Otherwise Laces tries again after about 1 minute, 5 minutes, 30 minutes, 2, 6 and 12 hours: 7 attempts in all. Redirects are not followed. Network errors, timeouts, 5xx, 408 and 429 use every attempt; any other 4xx stops after 3. After 50 failures in a row the endpoint is switched off until you re-enable it in the app.

Reconcile: catch what you missed

Every few minutes, read each purchase you are still waiting for (GET /orders/{orderId}, scope orders:read). Once a day, list the payments and compare them with your records:
Response 200
Keep going until next_cursor is null. A page can be short, or even empty, and still have a next page.
laces.js
reconcile.js
Reads carry no refunded amount, so a second missed part refund of an order that is still partially_refunded can’t be seen here. Check the app when you close such a review. order_type=ticket lists ticket orders only. Without the filter you get both. event_id never matches a payment.
Last modified on November 26, 2026