Skip to main content
This guide walks a platform — a storefront builder, a marketplace, a booking or delivery app — through a complete integration. By the end, each of your stores can be paid in USDT or USDC at checkout, priced in its own currency, and receive naira in its own bank account, with your platform fee kept by you. It uses Node.js with fetch; every call is plain HTTPS and JSON, so any language works the same way. Read Platforms & marketplaces for the concepts; this page is the how-to.

How it fits together

1. Access, keys and your webhook

  1. Request access at payments.rach.finance/contact. Rach sends an activation link; sign in and complete business verification (KYB) — your platform is the verified business, and you vouch for your stores.
  2. Under Developers → API Keys take your test_sk_… and live_sk_… keys. Keep them on your server only.
  3. Under Developers → Webhooks set your HTTPS webhook URL and copy the signing secret (whsec_…, shown once). Every event below is signed with it.

2. Create each store

When a merchant signs up on your platform, create them on Rach with your own ID for the store as reference. Store the returned sm_… ID next to your store record — though anywhere a store is named, your reference works too.
Repeating the call with the same reference and name returns the same store (200), so it is safe to retry. A different name for an existing reference is a 409. To pause a store, PATCH /platform/sub-merchants/{id} with {"status": "disabled"}: it takes no new checkouts or payouts, and its money stays ring-fenced.

3. Add the store’s bank account

Get the bank list once and show it in your own onboarding form:
  • Up to five accounts per store; the first becomes primary.
  • An account added (or changed) with an API key can receive payouts only after 24 hours — the response’s payable_after. Accounts your team adds in the dashboard are payable at once.
  • Rach’s operations team confirms the account name with the bank before the first payout to it. A mismatch holds the payout.

4. Price and create the checkout

Create one checkout per order, from your server, priced in the store’s currency.
The response tells you exactly what the customer will pay:
Counter sales. For a walk-in customer, create the checkout the same way and show payment_url as a QR code on the store’s screen. The customer scans and pays from their phone; you get the same webhook.
How the money divides (customer bears the fee): With fee_bearer: "merchant" the customer pays 36.50, Rach’s 0.5% comes out of your platform fee first, and the store still receives the price less your platform fee. To show customers a naira price converted live before creating a checkout, use GET /fx/convert?from=NGN&to=USD&amount=50000 (FX rates) — then rely on the amount the checkout returns.

5. Confirm orders from the webhook

Fulfil an order only from the signed payment.confirmed event (or a server-side GET /checkout/verify/{session_id}), never from the browser.
The exact payloads are in Webhooks. Respond 2xx quickly; failed deliveries are retried with the same body and event_id. A customer who pays from an exchange sometimes arrives short, because many exchanges take their withdrawal fee out of the amount sent. The payment stays open until the full amount has arrived (the hosted page tells customers this), and a late payment is still matched for 24 hours after the checkout expires.

6. Pay stores out

Switch on payouts by API key

In the dashboard, Payment gateway → Stores → Payouts by API key → Turn on (a workspace owner, with a 2FA code). Until then the payout endpoint answers 403 api_payouts_disabled; your team can still pay stores from the dashboard.

Quote, then pay

A daily payout job

Pay each store everything it holds, once a day:
Because reference is unique per store per day, rerunning the job never pays twice. Each payout ends in payout.completed (with payout_reference, the bank transfer reference) or payout.failed (the store’s money returns to its share). Payouts are made within 24 hours on business days.

7. Reconcile

Ledger entry types: checkout_share (a payment’s share), payout_locked (held for a payout), payout_settled (paid out), payout_reversed (a failed payout returned).

Test mode

Test keys create testnet checkouts: the hosted page, webhooks and sub-merchant fields behave exactly as in live mode, but testnet receipts never credit balances or store shares, so payouts are tested with small live amounts. Never send mainnet funds to a test checkout.

Errors you will meet

Go-live checklist

  • KYB approved; live key on your server only
  • Webhook URL set; signatures verified; event_id deduplicated in the same transaction as the order update
  • Every store created with your own reference, and a primary bank account
  • Checkouts send sub_merchant, platform_fee, an Idempotency-Key per order attempt
  • Orders fulfilled only from payment.confirmed or server-side verify
  • API payouts switched on, payout job idempotent per store per period
  • payout.completed / payout.failed handled