API referenceRefunds
Refund a payment
Omit `amount` for a full refund of what is left.
POST
Omit amount for a full refund of what is left.
bearerAuthheader
AuthorizationBearer <token>A secret key, sk_test_… or sk_live_….
Idempotency-Key?stringMakes a retry safe: the same key and body within 24 hours does not repeat the request.
application/json- body
payment*stringThe payment to refund.
Length
1 <= lengthamount?integerAmount in minor units. Defaults to the whole refundable amount.
reason?|Your reason, kept on the refund.
Success.
application/json- response
id*stringobject*stringlivemode*booleanpayment*stringamount*integerAmount in minor units.
currency*stringThree-letter ISO 4217 code, uppercase.
status*stringValue in
"pending""succeeded""failed"reason*string|nullfailure_reason*string|nullcreated*integerUnix timestamp in seconds.
curl -X POST 'https://runepay.co/api/v1/refunds' \ -H 'Authorization: Bearer sk_test_...' \ -H 'Content-Type: application/json' \ -d '{ "payment": "pay_01KA4Y0Z9V3T6N8Q2W5E7R1T3Y", "amount": 500, "reason": "requested_by_customer"}'Example Response
{ "id": "re_01KA5B2C4D6E8F0G2H4J6K8M0N", "object": "refund", "livemode": false, "payment": "pay_01KA4Y0Z9V3T6N8Q2W5E7R1T3Y", "amount": 500, "currency": "USD", "status": "succeeded", "reason": "requested_by_customer", "failure_reason": null, "created": 1767312000}