Skip to main content
Build your own event pages and checkout form, and drive the order from your server. Mobile money is fully native: the buyer approves a prompt on their phone without leaving your site. Buyers pay with mobile money (MTN or Airtel) or card. Card is paid on a Laces-hosted page, not in your form. You need: a server, and an API key with Read events and Create orders. Add Read orders only if you want to poll order status (it returns personal data); webhooks work without it.
The client secret (LCSSECK-…-X) is server-only. It mints tokens that can create and pay orders. Keep it in your server’s environment or secret manager, never in a browser, a mobile app or source control. The token endpoint refuses any request that carries an Origin header, so it cannot be called from a web page even by mistake.
Every key, token and id on this site is a made-up example value. Your real keys are issued to you in the Laces app, under Settings → Developers.

The flow

1. Get a token

Cache it for its hour. See Authentication for the full helper.

2. Show events and prices

List your events, then read one for its ticket types and fees.
Response (abbreviated)
What to do with it:
  • Prices. Show price_minor, laces_fee_minor and total_minor exactly as returned. The top-level pair is MTN mobile money; airtel and card each have their own (card.total_minor is what a card buyer pays). A method’s quote is null where it can’t be sold. Never compute fees. See Fees and totals.
  • payment_methods lists the methods you can sell for this event right now, for example ["momo", "airtel", "card"]. A method that isn’t listed (its ticket quote is null) can’t be sold: build your picker from this list. An event in a card-only region (US, UK or EU) lists only card.
  • payments_enabled: false means your organization isn’t cleared to take payments yet. Show “Registration not open” rather than a buy button that can’t work.
  • waiver_required: true means you must show the event’s waiver (the text covered by your agreement with the organizer), collect the buyer’s agreement, and send waiver_accepted: true with this exact waiver_version on the order.
  • additional_questions are the organizer’s questions. Ask them, and send answers in custom_fields, keyed by key.
  • Distances. If ticket types have distance_km, send each participant’s distance_km on the order.
Cache event reads for a minute or two.
A Tickets table listing Free Fun Run at 0 UGX and 10K Entry at 50,000 UGX with a 3,400 UGX mobile money fee and a 53,400 UGX total

A partner page built from the event read: each ticket's price, mobile money fee and total, shown exactly as returned. The example site and event are made up.

3. Create the order

When the buyer submits, create the order. This holds their places until hold_expires_at; no money moves yet. Choose payment_method now: it sets the price. momo is MTN Mobile Money only (the default) and airtel is Airtel Money. Ask the buyer how they’ll pay, or infer it from their number’s network, before you create the order. Paying a momo order from an Airtel number (or an airtel order from an MTN number) is refused with 409 reprice_required, and you must create a new order with the right method. A card order still needs buyer_phone (it is the buyer’s contact number), but its pay call takes no msisdn; see Card orders below. Use only methods in the event’s payment_methods. Card (or bank transfer) where it isn’t offered in the event’s country is refused with 400 rail_unavailable, and mobile money on a card-only event (US, UK, EU) with 422 no_rate_for_method.
A 'Your details' form with a ticket picker set to 10K Entry, full name, email and mobile money number fields, an 'I accept the race waiver' checkbox and a Register and pay button

A partner's own registration form: ticket, buyer details, mobile money number and the waiver checkbox.

Response 201 (200 on an idempotent replay):
  • order.total is the amount due. Show it on your confirm step. A multi-ticket cart costs less than the per-ticket quotes added up, because part of the fee is per order.
  • checkout_lines is a ready-made breakdown for your UI.
  • order.id is what you pay. order_code is what the buyer sees on their ticket and receipt.
  • order is the same partner order view that GET /orders/{orderId} returns (without registrations): timestamps are ISO 8601 UTC, and buyer.phone is in E.164 form (+2567…) whatever format the buyer typed.
Every order you create is stamped channel: partner_api for audit.

Card orders

The request is the same as above with "payment_method": "card". Send it only when card is in the event’s payment_methods.
The response has the same shape, priced at the card rate. order.total matches the ticket’s card.total_minor from the event read (for one ticket), and fee_rate.payment_method is card:
Response 201 (abbreviated)
The Partner API has no call to change an order’s payment_method. If the buyer wants to pay another way, create a new order with the other method.

4. Pay

Call pay with a new Idempotency-Key (not the create key).
Send the payer’s number as msisdn: an MTN Uganda number for a momo order, an Airtel Uganda number for an airtel order.
Laces sends a prompt to the payer’s phone, and the call returns at once with payment_status: "prompt_sent" and next_action.kind: "await_confirmation". Tell the buyer to check their phone and enter their PIN, then wait for the result (step 5).Branch on next_action.kind. Don’t rely on next_action.message: it is there on the usual path but missing on some others. prompt_expires_at says when the phone approval window ends; see Show the buyer a timer.
A message reading 'Check your phone to approve the payment of 53,400 UGX', with the order code

Illustrative: a partner page telling the buyer to approve the prompt on their phone.

A number on the wrong network for the order’s payment_method (an Airtel number on a momo order, or an MTN number on an airtel order) is 409 reprice_required, and no prompt is sent. Create a new order with the right payment_method (a new create idempotency key), then pay that one.409 prompt_in_progress means a prompt is already waiting on the phone. It is not a failure: wait the seconds in Retry-After (also in details.retry_after_seconds), read the order, and let the buyer decide.

5. Learn the result

Webhooks (recommended). order.paid or order.failed arrives at your endpoint. Match it to your cart with attribution.partner_reference. See Webhooks. Polling (needs orders:read). Read the order every few seconds until status leaves payment_initiated / prompt_sent:
Fulfil only when status is paid.
A green confirmation reading 'You're registered!' with an order code and the email the confirmation was sent to

The partner page's own confirmation once the order is paid.

Why it failed: failure_kind

A failed or expired order carries failure_kind, a short, safe reason you can branch on. It is on order reads, on the order.failed webhook (data.order.failure_kind) and on the pay response. It is null while the order hasn’t failed, and it is never the payment provider’s own wording. Treat an unknown value as other: more kinds may be added.

Trying again after a failure

If an attempt fails or expires, the pay response also includes retry_safe:
  • true: this attempt can’t charge. When the buyer asks, call pay again with a new idempotency key (and the same or a different number on the same network).
  • false: don’t retry automatically. Check the order’s status first.
failure_kind: "provider_not_reached" always comes with retry_safe: true. 409 hold_expired means the places were released: create a new order.

Show the buyer a timer

Two server timestamps tell you how long the buyer has. Both are ISO 8601 UTC. prompt_expires_at is null for free orders, card orders, bank transfer, whenever pay answers with a redirect, when no prompt is live, and once the order is finished. In webhook payloads it is always null. Read the order for the live value. Read these points before you build on it:
  • It is a lower bound. It is stamped when the pay request starts, so it can end a few seconds before the prompt actually reaches the phone, never after.
  • It is not a failure signal. When it passes, don’t tell the buyer the payment failed. Re-read the order (GET /orders/{orderId}) or wait for the order.paid / order.failed webhook: a late approval can still arrive.
  • It can be later than hold_expires_at. A prompt that started before the hold ended can still be approved and paid after the hold time, so keep the prompt timer running until prompt_expires_at.
  • A retry gets a new value. Each new prompt has its own prompt_expires_at.
  • Old replays don’t have it. Replaying an Idempotency-Key that was first used before this field existed returns the stored body, without prompt_expires_at.
  • Mind the clock. The time is the server’s. Allow for skew when you compare it with your own clock, or count down from the moment you got the response.
The buyer’s device clock can be minutes off, so don’t hand it the raw timestamp. Your server, which called pay, works out the seconds left, and the page counts down from when it receives them:
At zero, show “Still waiting: we’ll update you when it’s confirmed”, and keep polling the order (step 5) or waiting for the webhook. Once the time has passed, and if no prompt is live (the order is no longer payment_initiated or prompt_sent), also offer Try another number: pay again as described in Trying again after a failure (or create a new order if the hold has expired). Hide the timer as soon as the order’s status is paid, failed, expired or cancelled.
In a custom UI, keeping the buyer from closing your checkout dialog while a payment is in flight is up to you: disable your own close button and Esc handling until there is a result. Laces’ embedded checkout modal already does this.

Errors

The full list is on Errors.

A complete server example (Node)

Last modified on November 26, 2026