Skip to content

The Refund Object

Required scope: view-refunds

Attributes

ParameterTypeDescription
objectstringAlways v2.refund.
idstringThe unique identifier for the refund.
transaction_idstringThe unique identifier of the transaction being refunded.
amountobject|nullThe refunded amount, as a money object.
statusstringOne of pending, succeeded, canceled, failed.
is_processedbooleanWhether the refund has been processed by the provider.
reasonstringOne of duplicate, fraudulent, requested-by-customer.
notestring|nullNote provided when creating the refund.
processed_atstring|nullWhen 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"
}