> ## Documentation Index
> Fetch the complete documentation index at: https://docs.laces.run/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Laces is event registration software for every kind of event, not only races. Use the event's own wording.
> There is one environment, production: payments made through the API are real. Money is integer minor units; read the event's currency.
> Collecting payments with no Laces event uses POST /payments, then POST /orders/{orderId}/pay: start at /guides/collect-payments. Never call pay to test: there is no sandbox.
> Never put a client secret in browser code or an LLM chat. Branch on error_code, not on message.
> Overview of Laces: https://laces.run/llms.txt

# Payments only: going live checklist for Laces

> The launch checklist for collecting payments on your own site with Laces: permissions, webhooks, retries, duplicates, refunds and one small real test payment.

> [!NOTE]
>
> **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.**

## What you can test without moving money

| Test | Moves money? |
| - | - |
| Get a token, `POST /payments/quote`, `POST /payments` | No |
| Reads, lists, and every `400`, `403` and `404` | No |
| **Send test event** (`ping`) to your webhook, in the Laces app | No |
| Your own fake of the Laces API, fed with the example payloads in these docs | No |
| `POST /orders/{orderId}/pay` | **Yes, for mobile money: it sends a real prompt** |
| Paying on the card page | **Yes** |

A payment you create and never pay appears in your organization's payments and
later becomes `expired`.

## One real payment

1. Ask whoever owns the Laces account first. It is real money.
2. Use the **smallest price you are happy to pay** and **your own phone**. The
   example number in these docs is `0763494235`: replace it. Never use a
   made-up number.
3. Make **one** payment, then stop. Check that: the prompt arrived, `order.paid`
   arrived and your check of the signature passed, you fulfilled once, the
   receipt reads well, and the payment shows in the Laces app.
4. Do the same for card if you offer it, and check the buyer came back to your
   success page.
5. If you want it back, tap **Request a refund** on the payment in the Laces app
   or email [support@laces.run](mailto:support@laces.run) with the order code and the amount, and watch for
   `order.refunded`. Laces handles the refund. It returns the price, not the fee,
   and a mobile money payout has a cost that you pay: see [Refunds](https://docs.laces.run/concepts/fees.md#refunds).

Never put a real payment in an automated test, a loop or a retry script, and
never let an LLM run one.

## Checklist

### Access

* [ ] Laces has turned payments on (`POST /payments/quote` answers `200`)
* [ ] The key has `payments:write`, `orders:write` and `orders:read`, and the token is newer than that change
* [ ] The client secret and webhook secret are only on your server
* [ ] Your live origin is in **Return URL domains**; `localhost` is removed
* [ ] Default site and return URLs are saved on the key, if you use them

### Paying

* [ ] The buyer sees the total from the quote or `order.total`, never your own sum
* [ ] You send the item price, not a price with the fee inside
* [ ] The method picker is built from `payment_methods`
* [ ] Idempotency keys are saved before each call and reused on retries
* [ ] Pay is never retried automatically, and never called while a payment is live
* [ ] You read the old order before creating a replacement payment

### Fulfilling

* [ ] The webhook checks the signature on the raw body, and skips an `X-Laces-Delivery` it has finished
* [ ] You fulfil only when a server-side read says `paid` now
* [ ] You compare `requested_amount` and `requested_currency` with your price
* [ ] Fulfilling twice is impossible, and two paid orders for one reference are flagged
* [ ] A refund undoes a purchase only if it is of the order that fulfilled it, and only once
* [ ] Nothing is released on `order.failed` alone
* [ ] The handler works without `event_id` and `registrations`
* [ ] A late `order.paid` after a failure or expiry is handled
* [ ] A job reads waiting orders, and lists payments until `next_cursor` is `null`

### Your own side

* [ ] You send your own order confirmation; the Laces email is a payment receipt
* [ ] Stock or places are kept before payment and released by you
* [ ] `metadata` holds ids, not personal data
* [ ] Your terms say how refunds work, and link the Laces refund policy
* [ ] Your support contact is set on the organization: buyers' emails show it

## If something goes wrong

Note the order id, the `X-Request-Id` header and the time, and write to
[support@laces.run](mailto:support@laces.run). Never send a secret or a token.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.