Palbase Payments · API
/payments/refundsCreate refund
Issues a full or partial refund to the original card (automatically choosing iyzico cancel vs refund) or instantly to the customer's wallet (destination: "wallet"). Requires Idempotency-Key. A payment with marketplace splits is given back through its splits (POST /payments/splits/{split_id}/refund), not here: its splits cover all of it, and this refund answers 409 refund_exceeds_remaining. Asked again under the same Idempotency-Key, for the same amount and destination, it answers the refund it wrote. An invoice paid in parts (at Stripe's dashboard, or on its page where the account lets it be) is one payment of several charges, and a refund is of one of them: one larger than any has left answers 409 refund_spans_payments, which says how much can be refunded at once. What Stripe took beyond an invoice (several of its payments completed) it credits to the payer's Stripe balance: a refund of that charge gives it back to the card and leaves the credit, which is taken back at Stripe. A refund its provider failed answers 409 refund_failed: nothing is written, and the same Idempotency-Key asks again. One the provider has taken and not finished yet is answered with status: "pending" and counted as given — against what is left of the payment, and with the wallet's share of it. A provider is not asked twice for the same money. A refund the provider did not answer — in time, or so it could be read — answers 502 provider_unavailable and may have been made: until it is known, every refund of the payment answers 409 refund_pending. On Stripe the same Idempotency-Key, sent again within a day, asks again and is the same refund (Stripe answers a key with what it answered the first time, a failure of its own too); otherwise say what the provider did with POST /payments/intents/{intent_id}/pending-refund. A card top-up refunded to its card takes its money back out of the wallet first: only the person's own money left of it — not a hold, a debt, or what was given (a reward, an adjustment, a transfer) — and at most the top-up less what was refunded of it; more answers 409 topup_spent with refundable, what can be. A refund the provider refuses, or that is said not to have been made, gives the money back to the wallet. A top-up is not refunded to a wallet (422 topup_refund_to_wallet).
Called by your server, with the project's secret key.
Headers
Idempotency-Keystring · requiredUnique client-supplied idempotency key (1-255 chars) ensuring safe retries without duplicate charges, refunds, or ledger movements.Request body
amountinteger (int64) · optionalRefund amount in minor units (0 = full remaining refundable amount).destination"original" | "wallet" · optionalRefund destination: original card or instant wallet credit.intent_idstring · requiredSucceeded PaymentIntent UUID.reasonstring · optionalRefund reason.wallet_keystring · optionalTarget wallet key when destination is wallet.curl -X POST "https://<your-ref>.palbase.studio/payments/refunds" \
-H "apikey: $PALBASE_SECRET_KEY" \
-H "content-type: application/json" \
-d '{"intent_id":"string"}'Responses
201Refund created
defaultStandard Palbase JSON error envelope (`error` and `error_description`).
Operation CreateRefund of payments's contract.