Skip to content

The Refund Object

Required scope (OAuth only): 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.
created_atstring|nullDate and time the refund was created.

Includes

Pass ?include=transaction to embed the related Transaction object under a transaction key. Supported on both the details and list endpoints.

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' \
  -u 'YOUR_PRIVATE_KEY:'

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,
  "created_at": "2024-01-29 15:15:12"
}