The Refund Object
Attributes
| Parameter | Type | Description |
|---|---|---|
id | string | The unique identifier for the refund. |
transaction_id | string | The unique identifier of the transaction being refunded. |
amount.amount | string | The total amount of the refund. |
amount.currency | string | The currency of the refund amount. |
currency | string | The currency in which the refund was processed. |
amount_in_mad.amount | string | The refund amount in Moroccan Dirham (MAD). |
amount_in_mad.currency | string | The currency of the amount in MAD, typically "MAD". |
status | integer | Numeric status code of the refund. |
status_text | string | Textual representation of the refund status. |
reason | integer | Numeric code representing the reason for the refund. |
reason_text | string | Textual description of the reason for the refund. |
created_at | integer | Timestamp of when the refund was created. |
Request
Endpoint: https://api.youcanpay.com/refunds/{refund_id}Method: GET
bash
$ curl --location -g --request GET 'https://api.youcanpay.com/refunds/83cd9f6d-481a-49c4-9cc1-954c065e6063' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer YOUR_TOKEN_eyJpc3...'Response
json
{
"data": {
"object": "refunds",
"id": "83cd9f6d-481a-49c4-9cc1-954c065e6063",
"transaction_id": "10e7691c-14a2-4936-833b-ec154c817ce9",
"amount": {
"amount": "6000",
"currency": "MAD"
},
"currency": "MAD",
"amount_in_mad": {
"amount": "6000",
"currency": "MAD"
},
"status": 1,
"status_text": "succeeded",
"reason": 1,
"reason_text": "duplicate",
"created_at": 1706534112
}
}