Skip to content

The Refund Object

Attributes

ParameterTypeDescription
idstringThe unique identifier for the refund.
transaction_idstringThe unique identifier of the transaction being refunded.
amount.amountstringThe total amount of the refund.
amount.currencystringThe currency of the refund amount.
currencystringThe currency in which the refund was processed.
amount_in_mad.amountstringThe refund amount in Moroccan Dirham (MAD).
amount_in_mad.currencystringThe currency of the amount in MAD, typically "MAD".
statusintegerNumeric status code of the refund.
status_textstringTextual representation of the refund status.
reasonintegerNumeric code representing the reason for the refund.
reason_textstringTextual description of the reason for the refund.
created_atintegerTimestamp 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
  }
}