The Refund Object
Required scope: view-refunds
Attributes
| Parameter | Type | Description |
|---|---|---|
object | string | Always v2.refund. |
id | string | The unique identifier for the refund. |
transaction_id | string | The unique identifier of the transaction being refunded. |
amount | object|null | The refunded amount, as a money object. |
status | string | One of pending, succeeded, canceled, failed. |
is_processed | boolean | Whether the refund has been processed by the provider. |
reason | string | One of duplicate, fraudulent, requested-by-customer. |
note | string|null | Note provided when creating the refund. |
processed_at | string|null | When the refund was created. |
Includes
Pass ?include=transaction on the details endpoint below to embed the related Transaction object under a transaction key. Not supported on the list endpoint.
Request
Endpoint: https://youcanpay.com/api/v2/refunds/{refund_id}Method: GET
bash
$ curl --location -g --request GET 'https://youcanpay.com/api/v2/refunds/83cd9f6d-481a-49c4-9cc1-954c065e6063' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'Response
json
{
"object": "v2.refund",
"id": "83cd9f6d-481a-49c4-9cc1-954c065e6063",
"transaction_id": "10e7691c-14a2-4936-833b-ec154c817ce9",
"amount": {
"amount": "60.00",
"currency": "MAD",
"localized": "MAD 60.00"
},
"status": "succeeded",
"is_processed": true,
"reason": "duplicate",
"note": null,
"processed_at": "2024-01-29 15:15:12"
}