Refund API

Use a refund to return a payment to a customer.

Note: We do not currently support partial refunds. The original charge will therefore be fully refunded.

Request

https://online.yoco.com/v1/refunds/

Headers

ParameterTypeDescription
X-Auth-Secret-Key
string
The secret key for your account

Body

ParameterTypeDescription
chargeId
string
The charge id returned when you originally did the charge.
eg: ch_xpnGTFDSnlvksdnvkbkfvd
metadata
json
A set of key-value pairs that you can attach to a Refund object.

Example

curl https://online.yoco.com/v1/refunds/ \
-u sk_test_960bfde0VBrLlpK098e4ffeb53e1: \
-d chargeId=ch_xpnGtOMMObOw
# The colon on the u argument prevents curl from asking for a password

Response

HTTP: 200 OK
{
"id": "rfd_kaA15fAoB0JEwQHLXPUWBXhYwr",
"status": "successful",
"message": "Your refund has been processed",
"metadata": {}
}