curl -X PATCH https://api.khaime.com/api/v1/installment-plans/812/cancel \
-H "X-API-Key: pk_sandbox_your_key"
Installments
Cancel Installment Plan
Stop collecting an installment plan.
PATCH
/
installment-plans
/
{plan_id}
/
cancel
curl -X PATCH https://api.khaime.com/api/v1/installment-plans/812/cancel \
-H "X-API-Key: pk_sandbox_your_key"
Cancel Installment Plan
Intro
Cancels a plan: no more installments are collected. Paid installments are untouched.Context
Unpaid installments becomecancelled, automatic collection stops, and installment_plan.cancelled is sent. To give money back for paid installments, refund them one by one with Refunds and installment: { plan_id, position }.
Hows
PATCH /installment-plans/{plan_id}/cancel
Response
The cancelled plan, in the same shape as Get Installment Plan:{
"status": true,
"message": "Installment plan cancelled",
"data": { "id": 812, "status": "cancelled", "installments": [ { "position": 1, "status": "paid" }, { "position": 2, "status": "cancelled" }, { "position": 3, "status": "cancelled" } ] }
}
Errors
| Status | error_code | Cause |
|---|---|---|
| 400 | INSTALLMENT_NOT_ALLOWED | The plan is already completed |
| 404 | INSTALLMENT_PLAN_NOT_FOUND | No such plan for your key |
curl -X PATCH https://api.khaime.com/api/v1/installment-plans/812/cancel \
-H "X-API-Key: pk_sandbox_your_key"
Whys
Cancelling and refunding are separate so a business can stop future charges without deciding, in the same call, how much of what was already paid to return.Why nots
- It isn’t reversible; start a new installment checkout if the customer wants to resume.
- It doesn’t revoke the customer’s access to the product.
