Skip to main content
Card details never touch your site. You create a payment, the pay call returns a Laces page, the buyer pays there and comes back to you.
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.

Step 1: Check card is available

Get a token, then quote:
Response 200
Offer card only when payment_methods lists card. Show data.card.total_minor. Card follows the country: today Uganda, Kenya, Ghana, Rwanda and US, GB and EU organizations, not Zambia. Trust the quote, not this list. Otherwise create answers 400 rail_unavailable.

Step 2: Create with payment_method: "card"

Response 201

Step 3: Pay, with no number

Response 200
Nothing is charged here. The Idempotency-Key is required but not used up, so calling again is safe. Note that the answer has no payment_status and no failure_kind.

Step 4: Redirect the buyer

Send their browser to next_action.redirect_url (303 redirect or a link). Use the URL as given; don’t build it. The page shows your organization’s name, the description, the amount, the fee and the total. Where the card network can’t take your currency (UGX, for example), it shows the amount in USD before they pay. Your order stays in its own currency. The page can carry your color and logo: set them on the key (Branding).

Step 5: The buyer comes back

  • A payment’s own URL wins. Without one, the key’s saved default_success_url or default_failure_url is used. With neither, the buyer sees a short Laces result page and stays there.
  • https only (a registered http://localhost:<port> also works for URLs you send in a request, not for saved defaults). The origin must be in the key’s Return URL domains. At most 2048 characters with the order id and status added. Otherwise 400 invalid_return_url.
  • They are checked again when used. If you remove a domain from the key, or revoke the key, the buyer is not sent there.
  • laces_status can be paid, cart (they left without paying), failed, expired or cancelled. None of them is final: failed and expired can still become paid. Trust the webhook or an order read.
Laces adds two values to the URL:
  • Using a # fragment (single-page apps)? Use {LACES_STATUS} and {LACES_ORDER_ID} inside it. Otherwise the values go in the query, before the #. A fragment that already gives laces_status or laces_order_id a different value is dropped whole.
  • The query string is re-written when values are added: %20 can become +, and any laces_order_id or laces_status you put there is replaced. Read parameters by name; don’t sign or compare the raw query string.
  • Your own order_id or status parameters are left alone.
A return URL is never proof of payment. Anyone can type it. On your server, read the order or wait for the order.paid webhook, then fulfil. Show “We’re confirming your payment” until then.
thanks.js
“ended” says the reservation ended, and that you will contact the buyer if a payment arrived: a late one is in review. A purchase undone after it was fulfilled keeps fulfilled and still shows “thanks”; a second order for it shows “thanks” too, and your handler has sent the duplicate to review.

If the buyer does not come back

They may have closed the tab. A paid payment still sends order.paid. An abandoned one sends nothing: an untouched cart becomes expired 15 to 20 minutes after creation.

If the buyer wants to try again

Wants mobile money instead? retryPayment with the new method (guide) creates a new payment. No route cancels a card order, and a card page left open can still be paid, so replace one only when the buyer has come back to you, keep the old order id, and ask for one to be refunded if both are paid.

If the total changes

On the Laces page a buyer may be able to change how they pay, which changes the fee and total. Compare requested_amount and requested_currency with your price, never total. A changed method can also start a mobile money prompt for this order, so a “card” order can be prompt_sent. Treat it like any live payment: wait. Codes: Errors.
Last modified on November 26, 2026