> ## 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

# Payment countries and currencies with Laces

> Currencies, minor units and payer_country for Laces payments: what the buyer is charged, what your order shows, and how to take buyers in another country.

You always price in **your organization's currency**. Tell Laces where the
buyer pays from, and it works out the rest.

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

## Amounts are whole numbers in minor units

| Currency | Minor units | `amount` for "50" |
| - | - | - |
| UGX, RWF | None | `50` |
| KES, GHS, ZMW, USD, GBP, EUR | 100 per unit | `5000` |

A decimal, a string, zero, a negative number, or an amount too large or too
small to charge is `400 invalid_amount`. `currency` is optional; if it is not
your organization's, the answer is `400 currency_mismatch`.

Laces can set a highest amount for your organization:
`400 amount_too_large`. It applies to your `amount`, before the fee.

## A buyer in another country: `payer_country`

Send it on **both** the quote and the create. Accepted today: `UG`, `KE`,
`GH`, `RW`, `ZM`. Anything else is `400 unsupported_country`, and the error
lists the accepted codes. `US`, `GB` and `EU` are organization zones, not payer
countries: for a card buyer there, leave `payer_country` out. Also leave it out
for a **card** buyer in Zambia: with `ZM` there is no card
(`400 rail_unavailable`), without it they can pay by card where your organization's country has it.

Left out, the buyer is taken to be in your organization's country.

```bash theme={null}
export LACES_BASE="https://connect.laces.run/v1"

TOKEN=$(curl -s -X POST "$LACES_BASE/oauth/token" \
  -u "$LACES_CLIENT_ID:$LACES_CLIENT_SECRET" \
  -d "grant_type=client_credentials" \
  | python3 -c 'import json,sys; print(json.load(sys.stdin)["access_token"])')
```

```bash theme={null}
curl -s -X POST "$LACES_BASE/payments/quote" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "amount": 50000, "currency": "UGX", "payer_country": "KE" }'
```

```json Response 200 (a Ugandan organization, a buyer in Kenya) theme={null}
{
  "code": 200,
  "message": "Payment quoted successfully",
  "data": {
    "currency": "KES",
    "price_minor": 172000,
    "laces_fee_minor": 6988,
    "total_minor": 178988,
    "card": { "laces_fee_minor": 14976, "total_minor": 186976 },
    "airtel": { "laces_fee_minor": 6988, "total_minor": 178988 },
    "payment_methods": ["momo", "card", "airtel"],
    "fx": { "rate": "0.0344", "source_currency": "UGX", "source_price_minor": 50000 }
  }
}
```

Figures are examples. `currency`, `price_minor` and every fee and total are now
in the **buyer's** currency. `fx.rate` is how many units of `currency` one unit
of `source_currency` buys, and `fx.source_price_minor` is what you asked for.
There is no `fx` when no conversion is needed.

**The quote's rate is indicative.** The create uses a fresh one, so show
`order.total` from the create before the buyer pays:

```bash theme={null}
curl -s -X POST "$LACES_BASE/payments" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Idempotency-Key: 2d9c7f64-18ab-4e35-8b02-c5f3a7e6d910" \
  -H "Content-Type: application/json" \
  -d '{
  "amount": 50000,
  "currency": "UGX",
  "payer_country": "KE",
  "payment_method": "momo",
  "partner_reference": "SHOP-ORDER-8814",
  "description": "Club jersey, size S",
  "product": "jersey",
  "customer": { "name": "Amina Nakato", "email": "amina@example.com" },
  "metadata": { "cart_id": "c-8814" },
  "source_url": "https://shop.example.com/jerseys/home"
}'
```

```json Response 201 theme={null}
{
  "code": 201,
  "message": "Payment created successfully",
  "data": {
    "order": {
      "id": "Tb6vC3hN",
      "order_code": "LC-8M4D7Q",
      "order_type": "partner_payment",
      "status": "cart",
      "currency": "KES",
      "subtotal": 172000,
      "discount_total": 0,
      "donation_total": 0,
      "laces_fee": 6988,
      "total": 178988,
      "failure_kind": null,
      "partner_reference": "SHOP-ORDER-8814",
      "description": "Club jersey, size S",
      "product": "jersey",
      "metadata": { "cart_id": "c-8814" },
      "source_url": "https://shop.example.com/jerseys/home",
      "source_site": "shop.example.com",
      "requested_amount": 50000,
      "requested_currency": "UGX",
      "payer_country": "KE",
      "buyer": { "name": "Amina Nakato", "email": "amina@example.com" },
      "attribution": {
        "channel": "partner_api",
        "api_client_id": "LCSCLI-EXAMPLECLNT2345EXAMP",
        "checkout_session_id": null,
        "partner_reference": "SHOP-ORDER-8814"
      },
      "hold_expires_at": "2026-11-25T08:29:03.000Z",
      "prompt_expires_at": null,
      "created_at": "2026-11-25T08:14:03.000Z"
    },
    "checkout_lines": [
      { "label": "Subtotal", "amount": 172000 },
      { "label": "Laces Service Fee", "amount": 6988 },
      { "label": "Total", "amount": 178988 }
    ],
    "is_free": false,
    "is_test_mode": false,
    "fee_rate": { "flat_fee": 2000, "percent_fee": 2.9, "currency": "KES", "payment_method": "momo" }
  }
}
```

| Field | Meaning |
| - | - |
| `currency`, `subtotal`, `laces_fee`, `total` | What the buyer pays, in their currency |
| `requested_amount`, `requested_currency` | What **you** asked for. Compare these with your price. Present on every payment. (`null` only if the stored record can't be read: check by hand.) |
| `payer_country` | Present when you sent it |

The rate holds for the 15-minute payment window. After that, pay answers
`409 rate_lock_expired`: create a new payment. If no rate can be had, create
and quote answer `503 fx_unavailable`: try again shortly.

Money from a buyer in another currency lands in your organization's balance
**in that currency**. The organizer converts it in the Laces app.

## Organizations in US dollars, pounds or euros

Their buyers pay by card only:

```json Quote for amount 5000 in a USD organization theme={null}
{
  "code": 200,
  "message": "Payment quoted successfully",
  "data": {
    "currency": "USD",
    "price_minor": 5000,
    "laces_fee_minor": null,
    "total_minor": null,
    "card": { "laces_fee_minor": 330, "total_minor": 5330 },
    "airtel": null,
    "payment_methods": ["card"]
  }
}
```

* `laces_fee_minor` and `total_minor` are `null`: no mobile money.
* Leave `payment_method` out and it is `card`.
* `momo` or `airtel` is `422 no_rate_for_method`.
* **Phone numbers must carry the country code** (`+…`), or the answer is
  `400 invalid_request`.

## Phone numbers

`customer.phone` is a contact, and optional. Best sent as `+` and the country
code. A local number is read in `payer_country` if you sent one, else in your
organization's country. The number that is **charged** is `msisdn` on the pay
call: local form is accepted only for Ugandan numbers, and it must be a
number of the payment's country (`400 invalid_msisdn`). A Kenyan buyer needs
`payer_country: "KE"`.

## Card in another currency

A card order stays in the order's currency. Where the card network can't take
it (UGX, KES, GHS, RWF), the Laces page shows the buyer a USD amount before
they pay, and the receipt shows what the card was charged. Your order, webhooks
and refunds stay in the order's currency.


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