Refunds
Every refund goes to the customer’s Stack balance, whatever they paid with, and arrives instantly. They can spend it at any Stack merchant, including you. The money comes out of your Stack balance.
Refund from your server
Section titled “Refund from your server”// Full refundawait stack.refunds.create({ paymentIntent: 'pi_...' }, { idempotencyKey: `refund_${orderId}` });
// Partial refund: ₦1,000await stack.refunds.create({ paymentIntent: 'pi_...', amount: 100_000 });It returns the refund:
{ "id": "…", "payment_intent": "pi_...", "amount": "100000", "status": "succeeded", "created_at": "…" }Or from the dashboard: Transactions, then Refund on the payment. That refunds it in full.
- Only succeeded payments can be refunded.
- Several partial refunds are fine, up to the payment’s amount in total. Asking for more
than what’s left is refused with
400 invalid_request. - Your balance must cover it. If your Stack balance is lower than the refund, it’s
refused with
409 insufficient_balance, and nothing moves. Nothing is queued or retried: try again once your balance covers it. - Idempotent. The same
idempotencyKeyreturns the same refund, never a second one. - Fees aren’t returned. The customer gets the full amount back, and the fees on the original payment stay paid.
Refunding to the original card or bank account is coming soon.