Quickstart
Take your first sandbox payment with Tranzak in a few minutes: create an account, get a test key, create a payment and confirm it.
This guide takes you from zero to a working test payment. No real money moves while you use a test key.
Before you start
You need a Tranzak account. Create one and sign in to the dashboard.
Note Everything below uses test keys (
tk_test_…). Going live is a separate step, described in Go live.
1. Register your website and get a test key
- In the dashboard, open Developer and create a Website. Give it a name, your domain, and a webhook URL: the public HTTPS address on your server that will receive payment events.
- Open the API Keys tab and generate a test key. It starts with
tk_test_and is shown only once. - Copy the website's webhook secret (it starts with
whsec_).
Store both values as environment variables on your server. Never write them in your source code, your front end or your repository.
export TRANZAK_API_KEY="tk_test_xxxxxxxxxxxxxxxx"
export TRANZAK_WEBHOOK_SECRET="whsec_xxxxxxxxxxxxxxxx"
Tip If you do not have a public webhook URL yet (local development), use a placeholder such as
https://example.com/webhookand read results from the events feed.
2. Create a payment
Call the API from your server, with the amount and currency computed from your own order data.
curl https://api.tranzak.co/api/gateway/v1/payments \
-H "X-Api-Key: $TRANZAK_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 500,
"currency": "HTG",
"payment_method": "moncash",
"customer_name": "Jean Dupont",
"reference": "ORDER-4821"
}'
const response = await fetch('https://api.tranzak.co/api/gateway/v1/payments', {
method: 'POST',
headers: {
'X-Api-Key': process.env.TRANZAK_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 500,
currency: 'HTG',
payment_method: 'moncash',
customer_name: 'Jean Dupont',
reference: 'ORDER-4821',
}),
});
const payment = await response.json();
console.log(payment.payment_url);
import os, requests
response = requests.post(
"https://api.tranzak.co/api/gateway/v1/payments",
headers={"X-Api-Key": os.environ["TRANZAK_API_KEY"]},
json={
"amount": 500,
"currency": "HTG",
"payment_method": "moncash",
"customer_name": "Jean Dupont",
"reference": "ORDER-4821",
},
)
payment = response.json()
print(payment["payment_url"])
$ch = curl_init('https://api.tranzak.co/api/gateway/v1/payments');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-Api-Key: ' . getenv('TRANZAK_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'amount' => 500,
'currency' => 'HTG',
'payment_method' => 'moncash',
'customer_name' => 'Jean Dupont',
'reference' => 'ORDER-4821',
]),
]);
$payment = json_decode(curl_exec($ch), true);
echo $payment['payment_url'];
The API answers with 201 Created:
{
"success": true,
"transaction_id": "17843268616389",
"amount": "500.00",
"currency": "HTG",
"status": "processing",
"created_at": "2026-10-04T14:00:00.000000Z",
"payment_url": "https://…"
}
Save the transaction_id against your order before you redirect the customer.
3. Send the customer to pay
Redirect the customer's browser to payment_url. They pay on the MonCash screen and are sent back to the return URL of your website.
With a test key the payment is simulated. See Sandbox and test mode to learn how each method completes in test.
4. Confirm the payment on your server
A customer coming back to your site is not proof of payment. Confirm with one of these:
- the signed webhook (
payment.success), which is the primary signal; - a read of the payment:
GET /api/gateway/v1/payments/{transaction_id}, which must returnstatus: "completed".
Only then mark the order as paid, once. Read Confirm a payment for the full recommended flow.
Next steps
- Authentication: keys, test and live modes, rate limits.
- Payment methods: MonCash, NatCash and cards.
- Verify the webhook signature.
- Go live when your integration passes the sandbox scenarios.