Installments
On this page
Let customers pay by credit card in installments: list the counts their card allows, show them and send the chosen one.
1. List the options for a card
Call the preview as soon as you know the first 6 to 8 digits of the card, the BIN. It accepts your publishable key, so your checkout page can call it while the customer types. Your server can call it with a secret key.
{
"bin": "435508",
"amount": 100000,
"currency": "try"
}
curl -X POST https://api.pf.organizer.tr/v1/installment_plans/preview \
-H "Authorization: Bearer pk_sandbox_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"bin": "435508", "amount": 100000, "currency": "try"}'
If you tokenized the card, send "payment_method": "pm_…" instead of bin. If the card goes through your server, send the BIN. The preview never takes a full card number.
{
"object": "installment_preview",
"card": {
"brand": "visa",
"card_type": "credit",
"program": "axess",
"programs": ["axess"],
"issuer_bank_code": "0046",
"domestic": true
},
"installment_surcharge_mode": "customer_pays",
"plans": [
{"count": 1, "amount": 100000, "surcharge": 0, "amount_charged": 100000, "per_installment": 100000, "first_installment": 100000},
{"count": 3, "amount": 100000, "surcharge": 3500, "amount_charged": 103500, "per_installment": 34500, "first_installment": 34500},
{"count": 6, "amount": 100000, "surcharge": 6900, "amount_charged": 106900, "per_installment": 17816, "first_installment": 17820}
]
}
plans lists exactly the counts this card can use with your account, so show them as they are. Count 1 is a single payment. Debit, prepaid and foreign cards get only count 1.
2. Show the options
Each plan has what the customer needs to see. Amounts are integers in minor units.
| Field | Show it as |
|---|---|
count |
Number of installments. |
amount_charged |
Total the card is charged. |
per_installment |
Monthly installment. |
first_installment |
First installment. It takes the rounding remainder, so it can be a few kuruş higher than the others. |
surcharge |
Extra cost for this count. 0 when you absorb it. |
installment_surcharge_mode says who pays for installments:
merchant_absorbs: the customer pays your price in parts, andsurchargeis0.customer_pays: the customer pays the surcharge, soamount_chargedisamountplussurcharge.
For example, show the 3-installment plan above as "3 installments of ₺345.00, ₺1,035.00 in total".
3. Pay with the chosen count
Send the count in payment_method_options.card.installments.count. Keep amount at your price, the plan's amount. We add any surcharge.
The field accepts 1 to 36. Any other value returns 400 parameter_invalid. The counts a card can really use depend on the bank, the card program and your account. In the sandbox the maximum is 12. A count in range that the preview did not list returns 402 installments_not_available.
{
"amount": 100000,
"currency": "try",
"confirm": true,
"payment_method": "pm_01J9ZQA2B4C6D8E1F3G5H7J9K2",
"payment_method_data": {
"billing_details": {
"name": "Ayşe Yılmaz",
"address": {"line1": "Caferağa Mah. Moda Cad. No:12", "city": "Kadıköy", "country": "TR"}
}
},
"payment_method_options": {"card": {"installments": {"count": 3}}},
"return_url": "https://modakitabevi.com.tr/odeme/sonuc"
}
The payment then shows installments: 3, amount: 100000, surcharge: 3500 and amount_charged: 103500.
Limits by business category and product
Some goods can be sold only in a single payment or in a few installments, whatever the card allows. Investment gold is an example. We apply these limits for you:
- By your business category (MCC). The preview lists no count above the limit.
- By item category, when the payment has
line_items. One restricted item limits the whole basket. The category is the item'sprice_data.product_data.category, or the category of your catalog product. Case and spacing do not matter.
The preview knows the card and the amount, but not the basket. If you sell restricted items, send line_items with their categories, and offer a single payment for a basket that holds one. A count above the limit returns 402 installments_not_available. The message names the category and the limit.
Refunds of installment payments
Refunds are based on your price, amount, as for any payment. When you refund in full, the customer also gets the surcharge back. The refund's amount_returned_to_card shows what went back to the card once the refund has succeeded. See refunds.
Good practice
- Call the preview again when the amount or the card changes. The options depend on both.
- The preview assumes the payment can use 3D Secure. With
three_d_secure: none, fewer banks qualify, and a count the preview listed can return402 installments_not_available. Leave 3D Secure on for installments. - Offer only the counts of the latest preview. Any other count returns
402 installments_not_available. - In the sandbox, use the installment test cards.
In the API reference
Next: Send the chosen plan when you create the payment, as Card payments and 3D Secure shows, then receive the result with Webhooks.