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

# Brand your Laces checkout: color, logo and theme

> Brand the Laces hosted and embedded checkout and the card payment page with your accent color, logo and light or dark scheme, per API key or per session.

You can give the Laces checkout your own accent color, your logo and a light
or dark color scheme, so it looks like part of your site.

## What can I brand?

Branding applies to:

* the Laces-hosted checkout page ([hosted checkout](https://docs.laces.run/guides/hosted-checkout.md)),
* the checkout in the modal ([embedded checkout](https://docs.laces.run/guides/embedded-checkout.md)),
* the Laces-hosted card payment page, including the one a
  [custom UI](https://docs.laces.run/guides/custom-ui.md) card order sends the buyer to.

You set three things: an **accent color**, a **logo** and a **color scheme**
(light, dark or auto). The payment fields and the layout stay Laces-styled.
Branding is not used in emails, receipts or webhooks.

> [!WARNING]
>
> Branding is **public**. Every buyer who opens the checkout sees it, and
> anyone can read it from the page. Never put anything private in it.

## Where do I set it?

There are two places. Use either or both.

### Per API key, in the Laces app

This is the default for every checkout session created with that key.

1. Open the Laces app: [app.laces.run](https://app.laces.run) on the web, or
   [laces.run/app](https://laces.run/app) on your phone.
2. Go to **Settings > Developers** and tap the key.
3. Under **Checkout branding**, set the **Brand color**, the **Logo URL** and
   the scheme (**Auto**, **Light** or **Dark**). A live preview shows the
   result as you type.
4. Tap **Save branding**. **Reset to Laces default** removes the key's
   branding.

### Per session

Send a `theme` when you create a session: in the body of
[`POST /checkout-sessions`](https://docs.laces.run/api-reference/v1/checkout-sessions/create), or as
the `theme` option of `laces.js` ([example below](#example)).

A session value overrides the key's value **field by field**. For example, if
the key sets a color and a logo and the session sends only `color_scheme`, the
checkout uses the key's color and logo with the session's scheme.

## The `theme` object

```json theme={null}
"theme": {
  "primary_color": "#3F7A12",
  "logo_url": "https://shop.example.com/logo.png",
  "color_scheme": "auto"
}
```

| Field | Rules |
| - | - |
| `primary_color` | Exactly `#RRGGBB`: a `#` and six hex digits. |
| `logo_url` | An `https` URL of at most 2048 characters. No `user:password@`, no spaces. The host must be a real domain name: not an IP address, not `localhost`, not a single-word host. |
| `color_scheme` | `light`, `dark` or `auto`. Absent means `auto`: the checkout follows the buyer's device setting. |

Every field is optional. A field set to `null` is treated as not set. A
session `theme` of `null`, or no `theme` at all, means no override: the key's
branding applies.

An invalid value, or a field that isn't one of these three, is refused with
`400 invalid_theme`. The `error` text names the field:

```json theme={null}
{
  "code": 400,
  "message": "Request failed",
  "error": "theme.primary_color must be a hex color in the form #RRGGBB",
  "error_code": "invalid_theme"
}
```

## How does it render?

* **Button label.** The text on your accent color is black or white,
  whichever is readable. You don't set it.
* **Readability.** Your accent must reach a 3:1 contrast ratio against both
  the page background and the white checkout card. If it doesn't, checkout
  does not use it in that scheme and uses the [fallback](#what-shows-when-i-set-nothing)
  instead.
* **Dark mode.** The page background turns dark, but the cards and payment
  fields stay light. Your accent has to read on both, so only accents of mid
  darkness pass in dark mode. Test yours with the **Dark** scheme.
  Setting any branding turns on automatic dark mode for buyers whose device
  is dark. To keep the checkout light, set `color_scheme: "light"`.
* **Logo.** Your logo shows in the header next to the Laces mark. The Laces
  mark always stays. When the checkout also shows a cover banner, your logo
  sits on the banner like a profile picture.
* **Where the logo comes from.** The buyer's browser loads the logo from
  **your** host. Serve it over `https` and keep the file small. In the header
  it is shown 32 px tall and at most 120 px wide (160 px on wider screens).
  On a cover banner it sits in a 56 px square tile, about 44 px inside. Use a
  transparent PNG, SVG or WebP at least 64 px tall so it stays sharp on
  high-density screens; wide logos are scaled down to fit. A logo that fails
  to load is simply hidden.

## What shows when I set nothing?

Each part falls back on its own:

| Part | Used, in order |
| - | - |
| Accent color | Your color, if it is readable in that scheme. Otherwise the event's own poster colors. Otherwise Laces green. |
| Image | Your logo: in the header next to the Laces mark, or on the event's cover banner when there is one. The cover banner is the event's own cover image, shown above the page heading. A placeholder or stock cover is never shown. |
| Scheme | Yours. Otherwise the buyer's device setting. |

An event with no poster and no branding looks like the standard Laces
checkout.

Where the banner appears: on the hosted and embedded checkout page while the
session is open (not on the completed or expired screen), and on the
Laces-hosted payment page for partner orders.

## Custom UI

With a [custom UI](https://docs.laces.run/guides/custom-ui.md) you build your own form, so your own
colors already apply there. Branding applies to the Laces-hosted card page
your buyer is sent to for a card order. A custom UI order has no checkout
session to carry a `theme`, so set the branding **on the key** in the Laces
app.

The card page for a custom-UI order uses the key's current branding, so key
changes apply to it immediately, including for orders created earlier.
Sessions keep the branding they were created with.

## Example

### Create a session with a theme

```bash theme={null}
curl -s -X POST "$BASE/checkout-sessions" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "event_id": "q3Zk9mVx",
    "on_success_url": "https://shop.example.com/thanks?session={CHECKOUT_SESSION_ID}",
    "on_cancel_url": "https://shop.example.com/events/kampala-city-10k",
    "theme": {
      "primary_color": "#3F7A12",
      "logo_url": "https://shop.example.com/logo.png",
      "color_scheme": "auto"
    }
  }'
```

The response is the usual session. It does not repeat the theme.

### laces.js

Pass `theme` to `LacesCheckout.open()`:

```js theme={null}
LacesCheckout.open({
  publishableKey: "LCSPUBK-ABCDEFGHJKLMNPQRSTUVWXYZ23456789-X",
  eventId: "q3Zk9mVx",
  theme: {
    primaryColor: "#3F7A12",
    logoUrl: "https://shop.example.com/logo.png",
    colorScheme: "auto",
  },
  onSuccess: (result) => verifyOnServer(result.session_id),
});
```

The option keys are `primaryColor`, `logoUrl` and `colorScheme`. The API's
names (`primary_color`, `logo_url`, `color_scheme`) work too.

`theme` is used only when `laces.js` creates the session from your
publishable key. With `sessionId`, the session your server created already
carries its theme, so set `theme` there instead.

`laces.js` ignores option keys it doesn't know inside `theme`; they are not
sent. Only an invalid value for one of the three fields comes back, through
`onError`, as `invalid_theme`.

## Why isn't my color showing?

* **The value is invalid.** It must be `#` and exactly six hex digits, like
  `#3F7A12`. `#3F7` or `green` is refused with `400 invalid_theme`.
* **It is too close to the background.** A color without 3:1 contrast against
  the page and the white card falls back. Try a darker or more saturated
  shade.
* **The scheme differs from the buyer's device.** A theme set to **Dark** or
  **Light** shows that scheme whatever the device prefers, and a color can
  pass in one scheme and fall back in the other. Check both.
* **The session has no `theme`.** A session `theme` that is `null` or absent
  uses the key's branding. If the key has none, you see the fallback.
* **The session is older than your change.** A session keeps the theme it was
  created with. Branding changes on a key apply to **new** sessions only
  (the card page for a custom-UI order always uses the key's current
  branding).
* **The logo doesn't show.** Check that it is `https`, that your host doesn't
  block it, and that it isn't too large or slow to load.


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