latestOpenAPI 3.1.02026-08-10466368560.6 KB

2b2bab8b9017

admin

Refund Payment

Issue a Stripe refund for a payment.

After refund:

  • For subscription payments: cancel subscription and downgrade user to free tier
  • For credit pack payments: deduct the corresponding credits from user

Security:

  • Uses FOR UPDATE lock to prevent race conditions
  • Only allows full refund of remaining credits (no partial refunds)
  • Aborts if Stripe subscription cancellation fails
post/admin/payments/{payment_id}/refund

Path parameters

payment_idstring uuid required

Request body

amount_centsinteger nullable

Optional refund amount in cents (defaults to full).

reasonstring nullable

Refund reason for audit/logging.

Response

Successful Response

idstring uuid required
user_idstring uuid required
subscription_idstring uuid nullable required
payment_idstring uuid nullable required
stripe_refund_idstring required
amount_centsinteger required
currencystring required
statusstring required
reasonstring nullable required
receipt_urlstring nullable required
created_atstring date-time required