Skip to main content
For a site that already sells through the Laces API with POST /orders and a Laces event, and runs its own registration form. After the move, Laces only collects.
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.
Never paste the client secret, the webhook secret or an access token into an LLM chat, a browser or a public repository. Use placeholders. The first pay request after the change moves real money: a person makes that payment, not a tool, and only once.

What changes, and what stays

Nothing is migrated. Old orders, refunds and earnings stay on the Laces event. New ones are payments. Both count in the same organization balance.

Step 1: Make the webhook handler accept both, and deploy it

Do this first: the moment payments are turned on, your endpoints and orders:read keys can see payment orders. In this order:
  1. Pause your deadline job (the one that gives places back).
  2. Add fulfilled, undone and released to registrations, and run the backfill: the confirmed ones, then those whose places the old code gave back.
  3. Deploy the handler below. Keep the delivery ids you have saved, so an event the old code handled is skipped.
  4. Run the backfill again, for what the old code confirmed in between.
  5. Restart the deadline job, as releaseIfOver. Then step 2.
Payments have no event_id (at the top or on the order), no ticket_count and no registrations. Ticket orders have no order_type, requested_amount or requested_currency: keep your own check on total for those. Add this above your existing ticket code:
ticketPaid is in cutover.js, in step 4. In webhook.js the ticket part is the body of handleTicketOrder. Skip events of another key only for payments: a ticket order can carry another client id, or null, and is still yours if you saved its id. Make sure your ticket code ignores anything it doesn’t know. fulfilIfPaid reads the order, requires status: "paid" now, and compares reference, amount and currency. refundPayment undoes once the price is back. Both, and the whole handler, are on Webhooks. refundPayment takes ticket orders too.

Backfill

For every registration your old code confirmed, with the ticket order that confirmed it. Without it your deadline job could give a confirmed registration’s places back, and a payment could be fulfilled on top of it without “paid twice”. Safe to run again.
backfill.js

Step 2: Switch it on

  1. Ask support@laces.run to turn payments on for your organization.
  2. An owner or admin adds payments:write and orders:read to your API key, and your site to its Return URL domains.
  3. Get a new token, clear any cached one, and check its scope.

Step 3: Quote instead of reading the event

Response 200
amount is the item price for everything in this payment, before the fee. If your page shows all-in prices that already contain the Laces fee, take the fee out, or the buyer pays it twice. Part of the fee is per payment, so quote the whole sum, and quote again for each method.

Step 4: Create a payment instead of an order

Before:
POST /v1/orders
After (same headers: Authorization, Idempotency-Key, Content-Type):
POST /v1/payments
Response 201
A registration that already has a ticket order: retryPayment and pay read its ticket orders (db.ticketOrdersOf, { orderId, unansweredAt? }) every time and stop if one is paid or could be. Stop calling pay on ticket orders from now on.
cutover.js
A card page still open can pay a failed or expired ticket order at any time, even on a closed event, also just after pay read it. Nothing cancels it: that is what the shared fulfil and the review are for. Ask the buyer to close it. A retry with the same key answers 200 with the same data and the message “Payment already created (idempotent replay)”. In the answer, registrations, event_name, event_when_label and poster_theme are gone, and order.event_id is replaced by order.order_type.

Step 5: Pay, unchanged

(0763494235 is the example number in these docs; use the payer’s own.)
Response 200: prompt sent, wait
Response 200: nothing sent, safe to try again
For card, create with payment_method: "card" and pay with {}:
POST /v1/payments
Response 201
POST /v1/orders/Wn2dG6jR/pay answers 200: redirect the buyer
New: after the Laces card page, the buyer comes back to your on_success_url or on_failure_url with laces_order_id and laces_status added. That is not proof of payment.

Step 6: Handle every outcome

Webhook: order.paid (fulfil once)
Webhook: order.failed (once per order; the buyer may retry, release nothing yet)
Webhook: order.refunded (the price only)
GET /v1/orders/Zs5kF8nA: paid
GET /v1/orders/Zs5kF8nA: failed
GET /v1/orders/Zs5kF8nA: expired (no webhook if the buyer walked away)
Create or quote before Laces turns payments on: 403
Pay: too many prompts to one number: 429
Every code: Errors. Signature check and a full handler: Webhooks.

Step 7: Close sales on the Laces event

When new payments arrive, close the event in the Laces app so nobody can still buy there. Do not delete it: its orders, refunds and history hang off it. Closing stops new orders; an order created before it can still be paid, so keep handling both kinds. Checkout sessions already open can’t start new orders on a closed event. Selling on both at once? Don’t: Laces counts only its own places. If you must, split the places between the two.

Rolling back

Point your server at POST /orders again and reopen the event. Payments already created can still be paid, and stay as payments: before you create a ticket order, read the registration’s payments, as look does, and go on only if none is paid or could be. Keep the handler for both kinds.

Checklist

  • Laces has turned payments on for the organization
  • payments:write, orders:write and orders:read are on the key, and the token is new
  • The site is in Return URL domains
  • In this order, before payments are turned on: deadline job paused, backfill, webhook handler deployed, backfill again, deadline job restarted
  • Every registration whose places were already given back has released set before the job restarts
  • A ticket order of another API key is matched by order id only, never by reference
  • The webhook handler works without event_id and registrations, accepts both kinds of order, and both fulfil and undo through the shared code
  • A ticket order that can’t be matched, or has another total, goes to review
  • A registration’s ticket orders are read before a payment is created and before pay, and two paid orders for one registration are flagged
  • Prices come from the quote; amount has no fee in it
  • One payment per registration, amount is the sum, product never changes for this event
  • partner_reference is always sent; metadata holds an id, no attendee or child data
  • The consent, attendee list, tickets and check-in are on your side
  • Places are reserved before the payment and released by you
  • Fulfilment only when a server read says paid now, once
  • requested_amount and requested_currency are compared with your price (payments only)
  • No fixed fee or rate is left in your code
  • The old event is closed, not deleted
  • One small real payment was made by a person, and refunded if wanted

A prompt for your LLM

Copy this. It contains no secrets: keep it that way.
Last modified on November 26, 2026