Skip to content

Refunds

Refund a completed payment by sending the payment_intent_id and the amount to return. TurnStay routes the refund to the original payment provider automatically.

Terminal window
curl -X POST "https://staging.turnstay.com/api/v1/refund" \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"payment_intent_id": 12345,
"billing_amount": 100000,
"reason": "Guest cancelled booking",
"idempotency_key": "550e8400-e29b-41d4-a716-446655440000"
}'
FieldTypeRequiredDescription
payment_intent_idintegerYesThe payment intent to refund.
billing_amountintegerYesAmount to refund in billing currency (minor units).
reasonstringYesWhy the refund is being issued.
idempotency_keystringNoClient-generated unique key to prevent duplicate refund submissions.

A refund moves through these states:

StatusMeaning
INITIALIZEDRefund created, processing started.
PENDINGWaiting for customer bank details (bank deposit refunds only).
APPLIEDProvider confirmed the refund is processed (card refunds).
COMPLETEDRefund finalized and recorded in ledger.
FAILEDProcessing error — check the error field.

Card refunds follow the standard path: INITIALIZED → APPLIED → COMPLETED. The refund goes back to the original card automatically.

Bank deposit refunds require the customer to submit their bank details. The flow is:

  1. Refund is created with status INITIALIZED.
  2. Customer receives a link to submit their bank account details.
  3. Status moves to PENDING while bank details are collected and verified.
  4. Once the payout is disbursed and confirmed, the refund is COMPLETED.

Before creating a new refund, check if one already exists for the payment intent:

Terminal window
curl -X POST "https://staging.turnstay.com/api/v1/refund/check-existing" \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"payment_intent_id": 12345
}'

Use the idempotency_key field to safely retry refund requests. If you send the same key twice, TurnStay returns the existing refund instead of creating a duplicate.