Payments are created server-side with an API key and an idempotency key, then completed through a hosted checkout.
PAY ITUNDA · API
Create a payment
REQUEST EXAMPLE
POST /api/v1/pay/payments
X-Api-Key: sk_test_...
Idempotency-Key: <unique-request-key>
Content-Type: application/json
{
"amount": 1000,
"currency": "RWF",
"reference": "order_123"
}const response = await fetch("/api/v1/pay/payments", {
method: "POST",
headers: {
"X-Api-Key": process.env.ITUNDA_API_KEY,
"Idempotency-Key": crypto.randomUUID(),
"Content-Type": "application/json"
},
body: JSON.stringify({
amount: 1000,
currency: "RWF",
reference: "order_123"
})
});val request = Request.Builder()
.url("$baseUrl/api/v1/pay/payments")
.addHeader("X-Api-Key", apiKey)
.addHeader("Idempotency-Key", uniqueRequestKey)
.post(jsonBody)
.build()REQUESTSERVER-SIDE
Send the payment creation request with server-held credentials and a unique idempotency key.
- API key
- Idempotency key
- Payment request body
RESULTTEST / SANDBOX
The current integration returns the payment key and a hosted checkout URL used to continue the customer journey.
- Payment key
- Hosted checkout URL
The request shown above is an integration example. The current repository uses sk_test_ credentials. Keep secrets on your server and treat this as a test/sandbox surface unless your environment explicitly indicates otherwise.
Complete the journey
01
Create
Send the payment request with a unique idempotency key.
02
Checkout
Send the customer to the hosted checkout URL returned by the API.
03
Confirm
Confirm the resulting payment from your server-side integration.
04
Listen
Process payment and cancellation webhook events.
NEXT
Webhooks