Successful refund

Now that you have set up the necessary structure and security measures to ensure that any event you process is from Yoco, you can proceed to handle the successful refund event.

You can verify the refund status by checking the type field of the webhook event. A refund is considered successful if its type is set to refund.succeeded.

Event structure

ParameterTypeDescription
id
string
The unique identifier for the event.
type
string
The type of event, one of payment.succeeded, refund.succeeded or refund.failed.
payload
object
The payload consists of additional information related to the event, for example, the Payment or Refund object.

Sample events

{
"id": "evt_1EAwK8Mjy2DT38WIWntiZWxm",
"type": "refund.succeeded",
"createdDate": "2024-06-15T15:51:55.260284Z",
"payload": {
"id": "rfd_ZgjMZb2A8VpSAZBte6ku1w6E",
"type": "refund",
"createdDate": "2024-06-15T17:51:54.405141Z",
"amount": 900,
"currency": "ZAR",
"paymentId": "p_bx4bY9JA6r4UwAKFyAjHY2bE",
"status": "succeeded",
"mode": "live",
"metadata": {
"checkoutId": "ch_9LVKD8GnAj7f39DFbn4F16bE"
}
}
}