Refunds
On this page
Refund a payment in full, in part or by line item, and follow the refund until it is done.
Refund in full
curl -X POST https://api.pf.organizer.tr/v1/refunds \
-H "Authorization: Bearer sk_sandbox_YOUR_KEY" \
-H "Idempotency-Key: refund-SIP-2026-10423" \
-H "Content-Type: application/json" \
-d '{"payment_intent": "pi_01J9ZQ4V8K2M3N5P7R9T1W3Y5A"}'
Leave out amount to refund everything that is still refundable.
Refund in part
{
"payment_intent": "pi_01J9ZQ8C3D5F7H9K2M4P6R8T1V",
"amount": 2500,
"reason": "requested_by_customer",
"metadata": {"ticket": "SUP-4411"}
}
curl -X POST https://api.pf.organizer.tr/v1/refunds \
-H "Authorization: Bearer sk_sandbox_YOUR_KEY" \
-H "Idempotency-Key: refund-SIP-2026-10427-1" \
-H "Content-Type: application/json" \
-d '{"payment_intent": "pi_01J9ZQ8C3D5F7H9K2M4P6R8T1V", "amount": 2500}'
{
"id": "re_01J9ZQ7B2C4D6F8H1K3M5P7R9U",
"object": "refund",
"amount": 2500,
"amount_returned_to_card": 2500,
"fees": {"currency": "try", "pf_fee_refunded": 70, "fee_tax_refunded": 14, "fee_refunded": 84, "installment_surcharge_refunded": 0, "fee_retained_on_void": 0, "merchant_debit": 2416},
"currency": "try",
"payment_intent": "pi_01J9ZQ8C3D5F7H9K2M4P6R8T1V",
"status": "succeeded",
"method": "partial_void",
"scheduled_for": null,
"settlement_netting": null,
"reason": "requested_by_customer",
"failure_reason": null,
"metadata": {"ticket": "SUP-4411"},
"created": 1795183200
}
amountis in kuruş, like the payment'samount: your price without any installment surcharge.- You can refund several times until nothing is left. The payment's
amount_refundableshows what remains: what was captured, less what was refunded, less refunds still in progress, less any open or lost dispute. It is exactly the most a refund accepts. reasonis optional:duplicate,fraudulentorrequested_by_customer.- The sample is a refund on the day of the sale: the bank reduced the charge (
method: partial_void,status: succeeded). If the bank does not take partial cancellations, or its closing time has passed, you getmethod: refundinstead. That refund usually succeeds at once; with a bank that takes refunds only after its end-of-day closing it staysstatus: processingwith ascheduled_fortime until then. All of these are normal. See how the money goes back.
Refund specific items
If the payment was created with line_items, you can name the items a refund is for. Each entry of items names a line item of the payment by its li_… id. Read the ids with GET /v1/payment_intents/{id}/line_items.
{
"payment_intent": "pi_01J9ZQ4V8K2M3N5P7R9T1W3Y5A",
"items": [
{"line_item": "li_01J9ZQ4V8K2M3N5P7R9T1W3Y5B", "quantity": 1}
],
"reason": "requested_by_customer",
"metadata": {"order_id": "SIP-2026-10423"}
}
| Entry | Meaning |
|---|---|
{"line_item": …, "quantity": 2} |
Two units at their unit price. |
{"line_item": …, "quantity": 1, "amount": 1500} |
One unit, for less than its price. |
{"line_item": …, "amount": 500} |
Money back on the item without returning a unit, as a price reduction. |
{"line_item": …} |
Everything that is left of the item. |
- Without
amount, the refund is the sum of its items. A loweramountis spread over the items in proportion to their amounts. A higheramountis refused withamount_exceeds_items. - To refund more than the items, for example shipping, make a second refund without
items. - An item cannot be refunded for more units or more money than were sold. Refunds that wait for approval or are still at the bank count against what is left. A failed or canceled refund gives its units and amount back.
itemsis optional. A refund withoutitemscovers no line item. The exception is a refund of everything still refundable, which covers every item that is left.- The refund as a whole can never exceed the payment's
amount_refundable.
The refund lists the items it covers in items. The refund.* webhook events carry the same list.
{
"id": "re_01J9ZQ7B2C4D6F8H1K3M5P7R9T",
"object": "refund",
"amount": 6250,
"amount_returned_to_card": 6250,
"fees": {"currency": "try", "pf_fee_refunded": 175, "fee_tax_refunded": 35, "fee_refunded": 210, "installment_surcharge_refunded": 0, "fee_retained_on_void": 0, "merchant_debit": 6040},
"currency": "try",
"payment_intent": "pi_01J9ZQ4V8K2M3N5P7R9T1W3Y5A",
"status": "succeeded",
"method": "refund",
"scheduled_for": null,
"settlement_netting": {
"amount": 6250,
"settlement_item": "sti_01J9ZQ4V8K2M3N5P7R9T1W3Y5A",
"settlement_date": "2026-11-23",
"netting_item": "sti_01J9ZQ7B2C4D6F8H1K3M5P7R9V",
"status": "pending"
},
"reason": "requested_by_customer",
"failure_reason": null,
"metadata": {"order_id": "SIP-2026-10423"},
"created": 1795259100,
"items": [
{"line_item": "li_01J9ZQ4V8K2M3N5P7R9T1W3Y5B", "description": "Roman", "product": "prod_01J9ZQ4V8K2M3N5P7R9T1W3Y5A", "sku": "KTP-0042", "unit_amount": 6250, "quantity": 1, "amount": 6250}
]
}
Once a refund covers a line item, the line item shows what is left of it in refund_summary:
{
"id": "li_01J9ZQ4V8K2M3N5P7R9T1W3Y5B",
"object": "item",
"description": "Roman",
"product": "prod_01J9ZQ4V8K2M3N5P7R9T1W3Y5A",
"product_type": "physical",
"category": "Kitap",
"subcategory": "Edebiyat",
"sku": "KTP-0042",
"unit_amount": 6250,
"quantity": 2,
"amount_subtotal": 12500,
"amount_total": 12500,
"currency": "try",
"refund_summary": {
"quantity_refunded": 1,
"amount_refunded": 6250,
"quantity_pending": 0,
"amount_pending": 0,
"quantity_refundable": 1,
"amount_refundable": 6250
}
}
A line item without refund_summary has not been named by any refund. You can refund all of it.
How the money goes back
We choose how the money goes back, and method shows the choice. On the day of the sale we cancel the payment at the bank when we can. The customer then sees no charge at all.
method |
When | Effect |
|---|---|---|
void |
All of these hold: the refund is for the whole captured amount; nothing was refunded before (a failed or canceled refund does not count); it is the day of the sale, a business day, before the bank's end-of-day closing; the payment's settlement is not released yet; and the bank takes voids. | The sale is canceled and the customer sees no charge. The payment becomes canceled. Your balance is not charged. |
partial_void |
Not a void, but the day, closing time and settlement conditions of a void hold, and the bank takes partial cancellations. Any amount, also the rest after an earlier refund. |
The sale amount is reduced. Your balance is not charged. |
refund |
All other cases: after the bank's end-of-day closing of the sale's day, on another day, once the payment's settlement was released, or when the bank does not take a (partial) cancellation. | The money goes back to the card and is taken from your balance. |
external |
A refund made outside the API and recorded here. | For your information only. |
What the bank takes is a fact of the bank and terminal the payment went through, as it was when the payment was made. Most banks take a same-day cancellation of the whole amount, but not of a part. With such a bank, a same-day refund of part of the payment is a refund, taken from your balance (or netted from the payment's settlement), while a refund of the whole amount on the same day is a void. Both are normal; the customer gets the money back either way.
The method is decided when the refund is created. A refund that waits for approval is decided again when it is approved if it was going to be a void or partial_void: if the day has closed meanwhile, it becomes a refund. A refund that waited for approval stays a refund.
When the customer gets the money
- A void takes effect at once.
- A refund is sent to the bank at once and usually succeeds in the same call. If it does not, wait for
refund.succeeded. The money reaches the customer's card statement within a few business days, depending on the bank. - Some banks take a refund only after their end-of-day closing. We then accept the refund with
status: processingand setscheduled_for(unix time). We send the refund at that time, and it moves tosucceeded. You do not need to do anything.
Statuses and events
status |
Meaning |
|---|---|
pending_approval |
The refund waits for approval by your payment institution, because your account requires it or the refund is over a limit. Its amount is held meanwhile. Once approved, it moves to processing. If it is rejected, it becomes canceled and nothing is taken from your balance. |
processing |
Sent to the bank or scheduled. The result follows. |
succeeded |
Done. The money goes back to the customer. |
failed |
The refund did not go through. failure_reason says why. The amount can be refunded again. |
canceled |
Canceled before it was sent. |
amount_returned_to_card shows what went back to the card: amount plus the share of an installment surcharge that goes back. It is 0 until the refund has succeeded, so also while it waits for approval, while it is processing and when it failed or was canceled. Like fees, it counts only money that has already moved.
Update your order on refund.succeeded and refund.failed. You also receive refund.created and refund.updated.
List refunds with GET /v1/refunds?payment_intent=pi_…. You can also filter by status, method, created and amount.
Balance and fees
A refund is taken from your available balance. Depending on your agreement, part of it can come from the payment's own settlement that is not released yet. The refund then shows that part in settlement_netting, as in the sample of the refund by items above: amount is the part taken, settlement_date is when the payment's settlement is released, and status of the netting_item is pending until then. A void or partial void takes nothing, so settlement_netting is null in those samples.
If your available balance is too low, the call returns 402 insufficient_available_balance. Top up and try again. Voids need no balance.
Your agreement decides whether the commission is returned with a refund. A succeeded refund shows in fees what was returned or kept. The payment's fees.net_after_refunds shows what you keep.
Errors
Nothing is refunded when a call fails with one of these errors.
| Error | Meaning | What to do |
|---|---|---|
400 charge_not_refundable |
The payment is not succeeded, or nothing was captured. |
Read the payment. To release a hold that was never captured, cancel it instead. |
400 amount_exceeds_refundable |
More than amount_refundable was requested. That value already leaves out the amount of an open or lost dispute, which cannot be refunded. |
Read the payment's amount_refundable and send at most that. |
400 amount_exceeds_items |
amount is larger than the sum of the refund's items. |
Lower amount, or refund the rest in a second refund without items. |
400 refund_item_unknown |
An entry of items names a line item the payment does not have. |
Take the ids from GET /v1/payment_intents/{id}/line_items. |
400 refund_item_quantity_exceeds_remaining |
More units of a line item were requested than are left. | Send at most refund_summary.quantity_refundable units. |
400 refund_item_amount_exceeds_remaining |
An item amount is larger than the price of its units or than what is left of the item. |
Send at most refund_summary.amount_refundable. |
400 refund_item_duplicate |
items names the same line item twice. |
Name each line item once and add up its quantity. |
400 refund_item_nothing_left |
Nothing is left of the line item to refund. | Leave the line item out. |
400 partial_refund_not_supported |
The bank does not take partial refunds for this payment. | Refund the full amount. |
402 insufficient_available_balance |
Your available balance does not cover the refund. | Top up or wait for pending money to be released, then retry with a new Idempotency-Key. |
409 change_pending |
The refundable amount changed while the refund was being made. | Read the payment, then send the request again. |
In the API reference
Next: Read how a bank challenge works in Disputes, and where refunded money goes in Balance and payouts.