Skip to content

Refunds & Void

You can refund all or part of a successful payment. Refund and void use the same endpoint; the system chooses the method (void vs. refund), you do not.

POST /v1/payments/{paymentCode}/refunds
Authorization: Bearer ptk_live_…
Content-Type: application/json

Request body:

{
"amount": 40000,
"partnerRefundCode": "REF-2026-8841-1"
}
FieldRequiredDescription
amountNoAmount to refund (kuruş). If omitted, the entire remaining balance is refunded.
partnerRefundCodeYesA unique refund code generated on your side (idempotency).

Response (201 Created):

{
"refundId": "ref_5Tg8p",
"method": "void",
"status": "approved"
}
FieldDescription
refundIdThe refund’s identifier; used in the status query.
methodThe method the system chose: void (cancel) or credit (refund). Returned transparently.
statusapproved or pending (result not yet final).

Whether a refund request becomes a void (cancel) or a credit (refund) is decided by Paytalya based on the timing of the sale. The partner cannot make this choice; it only sees the outcome transparently in the method field. The rule is:

Sale timingRequested amountMethodResult
Same dayFull (entire remaining balance)voidThe transaction is cancelled before it reaches the bank’s books.
Same dayPartial(none)Not yet possible → refund_not_yet_available. Retry after day-end, processed as credit.
A past dayFull or partialcreditThe refund is processed.

In practice: a same-day partial refund returns refund_not_yet_available; retrying after day-end processes it as a credit. A same-day full refund becomes a void immediately.

An approved refund updates the payment’s status:

Method and scopeNew payment status
void (same-day full cancel)voided
credit partial (cumulative refunds < sale)partially_refunded
credit full, or cumulative refunds = salerefunded

The status changes only when the refund is approved (status: "approved"); a pending refund does not change the payment status yet.

A refund returning status: "pending" is not yet final; its status is updated once the result is resolved (approved or declined). Do not treat an inconclusive refund as failed on your own; the system resolves the authoritative outcome. Learn the final status via GET /v1/payments/{paymentCode}/refunds/{refundId}.

While a pending refund exists for a payment, a new refund request is rejected with refund_in_progress (single-flight rule); wait until the previous refund is finalized.

GET /v1/payments/{paymentCode}/refunds/{refundId}
Authorization: Bearer ptk_live_…

Response (200 OK):

{
"refundId": "ref_5Tg8p",
"method": "void",
"status": "approved",
"amount": 40000,
"procReturnCode": "00",
"authCode": "123456",
"errMsg": null,
"bankReference": "240615091203",
"createdAt": "2026-06-15T09:12:00Z",
"updatedAt": "2026-06-15T09:12:03Z"
}
FieldDescription
refundIdThe refund’s identifier.
methodThe method the system chose (void / credit).
statusRefund status (pending / approved / declined).
amountRefund amount (kuruş).
procReturnCodeBank result code for this refund (if any; otherwise null).
authCodeBank authorization code for this refund (if any; otherwise null).
errMsgBank error message for this refund (if any; otherwise null).
bankReferenceBank reference for this refund (if any; otherwise null).
createdAt / updatedAtTimestamps (UTC).

Use this endpoint to learn a refund’s final outcome; track the resolution of a pending refund here. You can also see the payment’s current refund breakdown (total/remaining) via GET /v1/payments.

CodeReason
payment_not_refundableThe payment is not in a refundable state.
refund_amount_exceeds_remainingThe requested amount exceeds the remaining refundable balance.
refund_not_yet_availableSame-day partial refund; available after day-end.
refund_in_progressA pending refund already exists for this payment.

Full list: Error Codes.