Quickstart
Signup only asks for an email address and your business name, with no documents and no waiting. You get a Test mode API key straight away, and Test mode simulates payments: no M-PAiSA or MyCash wallet is charged and no real money moves, so you can build and test your whole integration before anyone checks your documents. Live mode opens once your Verification is approved: your company registration, TIN and TIN card photo, your directors and owners, and a few details about what you sell. It’s reviewed in the background.
Building with an AI agent?
Give your coding agent Integrate with an AI agent, one linear recipe from install to Live mode. It can also read the whole site:
-
docs.transxact.io/llms.txtindexes every page, and adding.mdto any page’s URL returns it as Markdown. -
The docs MCP server lets the agent search these docs itself. In Claude Code:
Other MCP clients, such as Cursor, take the same URL.
1. Get a Test mode key
Sign up and choose the Business account. Your
Test mode key (sk_test_...) is shown on the next screen, once. Copy it then:
we keep only a hash, and the dashboard shows just its last characters. If you
lose it, Roll key on the dashboard revokes it and gives you a new one.
Keep the key on your server. It never belongs in a browser or a mobile app (see Mobile integration).
2. Create a Checkout Session
It answers 201 with the Checkout Session:
amount is in FJD cents and must be under FJD 5,000.00 (at most 499999), in
Test mode and Live mode alike. A larger amount returns 400 invalid_request.
The Idempotency-Key header is required. If your server times out and retries
the create call, the same key replays the original response instead of
creating a second Checkout Session for the same customer. Replayed responses
are stored for ~24h. Use something tied to the order, like its id.
Prefer a library? Install an SDK and make the same call from its client:
The client sends your key as Authorization: Bearer and calls
https://api.transxact.io unless you point it elsewhere. In Node:
In PHP:
Both return the Checkout Session above, so session.hostedUrl (Node) or
$session->hostedUrl (PHP) is where you send your customer next. Each client
also has retrieve and cancel under checkoutSessions, taking the
session’s id.
3. Send your customer to hostedUrl
Redirect your customer to the session’s hostedUrl. That page offers every
way to pay, takes the payment, and handles each wallet’s own steps, so you
build one integration, not one per wallet.
To bring your customer back afterwards, add successUrl and cancelUrl to
the create call (both optional, HTTPS only):
Once the payment succeeds, the hosted page returns them to successUrl. If
they cancel, or the payment doesn’t go through, it offers a way back to
cancelUrl. Both arrive with ?session_id=cs_... appended. Anyone can open
a URL, so use session_id to look the Checkout Session up
(GET /v1/checkout-sessions/{id}) or wait for the webhook before fulfilling
the order.
To match a session to your own order without keeping a mapping, add
"metadata": { "orderId": "9912" }. You can send up to 20 string pairs. They
come back on retrieve and in every webhook, and are never shown to your
customer.
A Checkout Session expires 24 hours after you create it. To change that, set
expiresAt to a Unix-milliseconds time between 30 minutes and 24 hours
ahead. Once a session expires it can’t be paid, and it moves to cancelled
with a checkout_session.cancelled webhook. To withdraw a session before
then, call POST /v1/checkout-sessions/{id}/cancel. That returns
payment_in_progress if your customer has already started paying.
4. Pay it yourself in Test mode
Open the hostedUrl and pay as your customer would. The page is marked as a
test payment, and in place of each wallet’s own steps it shows a practice
version:
- M-PAiSA: a practice screen with the amount. Approve payment makes
the session
succeeded; Decline payment makes itfailed. - MyCash: enter any 7-digit Fiji mobile number, such as
7123456. No text is sent: the page shows the test code,123456. A wrong code is refused so you can try again, and the right one makes the sessionsucceeded.
Everything after that runs as it does for a real payment: the webhook is sent,
the fee is taken, the session shows on your dashboard, and your customer is
returned to successUrl.
5. Listen for the webhook
Transxact tells your server the outcome with a webhook, so you don’t have to poll. Add your endpoint’s URL in the Webhooks section of the dashboard. Every event looks like this, with the Checkout Session as it now stands:
The types are checkout_session.succeeded, checkout_session.failed and
checkout_session.cancelled. Check the signature before trusting one: see
Verifying webhooks.
Developing on your own machine? Webhook endpoints must be public
https:// URLs, so localhost can’t receive them directly. Run a tunnel
(such as cloudflared tunnel --url http://localhost:3000 or
ngrok http 3000) and add its https:// address as an endpoint. The
dashboard’s Send test button sends a signed webhook.test event there, so
you can check your endpoint before paying anything.
6. Go live
Send your Verification from the dashboard whenever you’re ready. It’s reviewed
in the background, with no blocking step or sales call, and you can keep
building in Test mode meanwhile. Once it’s approved, the dashboard offers
Create Live mode key. Swap sk_test_... for sk_live_... and nothing
else changes. See Test vs Live mode.