curl -X POST https://api.khaime.com/api/v1/installment-plans/812/installments/2/pay-link \
-H "X-API-Key: pk_sandbox_your_key"
Installments
Installment Pay Link
Let the customer pay an installment themselves.
POST
/
installment-plans
/
{plan_id}
/
installments
/
{position}
/
pay-link
curl -X POST https://api.khaime.com/api/v1/installment-plans/812/installments/2/pay-link \
-H "X-API-Key: pk_sandbox_your_key"
Installment Pay Link
Intro
Creates a payment for one installment that the plan’s customer completes in the browser — for when the saved card was declined, needs 3-D Secure, or the customer wants to pay early.Context
The response is the samepayment object as Installment Checkout, for the installment’s amount. When it’s paid, the installment is marked paid on the plan (installment.paid), exactly as if it had been charged.
Hows
POST /installment-plans/{plan_id}/installments/{position}/pay-link
integer
required
The installment plan.
integer
required
The installment to pay, from
1.string
stripe, paystack or flutterwave. Defaults to the gateway for the product’s currency.Response
{
"status": true,
"message": "Installment payment created",
"data": {
"installment_plan_id": 812,
"installment_position": 2,
"payment": {
"gateway": "paystack",
"client_secret": null,
"access_code": "0peioxfhpn",
"payment_url": "https://checkout.paystack.com/0peioxfhpn",
"reference": "khm_...",
"amount": 300000,
"currency": "NGN",
"checkout_url": "https://pay.khaime.com/checkout?data=eyJpbnRlbnRfaWQiOi...",
"installment": {
"plan_id": 812,
"position": 2,
"total_installments": 3,
"amount": 300000,
"total_amount": 1000000,
"currency": "NGN",
"schedule": [
{ "position": 1, "label": "Deposit", "amount": 400000, "status": "paid", "due_date": "2026-09-01T10:00:00.000Z", "due_in_months": null },
{ "position": 2, "label": "Second payment", "amount": 300000, "status": "due", "due_date": "2026-10-01T10:00:00.000Z", "due_in_months": 0 },
{ "position": 3, "label": "Final payment", "amount": 300000, "status": "upcoming", "due_date": "2026-11-01T10:00:00.000Z", "due_in_months": 1 }
]
}
}
}
}
checkout_url for Khaime’s hosted checkout, or confirm client_secret yourself (or redirect to payment_url), as at checkout.
Errors
| Status | error_code | Cause |
|---|---|---|
| 400 | INSTALLMENT_NOT_ALLOWED | The plan is completed, cancelled or defaulted |
| 404 | INSTALLMENT_PLAN_NOT_FOUND | No such plan for your key |
| 404 | INSTALLMENT_NOT_FOUND | No installment at that position |
| 409 | INSTALLMENT_ALREADY_PAID | Already paid |
curl -X POST https://api.khaime.com/api/v1/installment-plans/812/installments/2/pay-link \
-H "X-API-Key: pk_sandbox_your_key"
Whys
Off-session charges fail when a bank insists on authenticating the customer. A pay link puts the customer back in the flow so the bank can challenge them, without starting a new plan.Why nots
- Creating a pay link doesn’t email the customer; send it through your own channel.
