# Payment-Refund details

**GET** `/payment/{payment_reference}/refunds`

Base URL: `https://api.triple-a.io/api/v2`

Get the details of the refund, including current status via payment reference.

## Authorization

- bearer_auth (http, bearer)

## Path parameters

- `payment_reference` (string, required)
  Unique payment reference number given by the Payment Request

## Responses

### 200

Success

- `refund_currency` (string)
  The local currency equivalent of the refund. This should be a
  [3-character ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
  currency code. Please ignore if the refund is in cryptocurrency.
- `refund_amount` (number<float>)
  The local currency amount to be refunded. Please ignore if the refund is in cryptocurrency.
- `remain_amount` (number<float>)
  The remaining local currency amount of the payment after being refunded. Please ignore if the refund is in cryptocurrency.
- `refund_crypto_currency` (string)
  Cryptocurrency that will be paid out. Please ignore if the refund is in local currency.
- `refund_crypto_amount` (number<float>)
  The cryptocurrency amount to be refunded. Please ignore if the refund is in local currency.
- `remain_crypto_amount` (number<float>)
  The remaining cryptocurrency amount of the payment after being refunded. Please ignore if the refund is in local currency.
- `refunds` (object[])
  - `payout_reference` (string)
    Unique payout reference number
  - `type` ("withdraw" | "refund")
    The type of payout:

    1. `refund` - A partial or complete refund of a prior successful
    payment.

    2. `withdraw` - A settlement of the merchant's accumulated USD
    balance in cryptocurrency.
  - `local_currency` (string)
    The local currency equivalent of the payout. This should be a
    [3-character ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
    currency code. Please ignore if the payout is in cryptocurrency.
  - `local_amount` (number<float>)
    The local currency amount to be paid out. Please ignore if the
    payout is in cryptocurrency.
  - `crypto_currency` (string)
    Cryptocurrency that will be paid out. Please ignore if the payout
    is in local currency.
  - `crypto_amount` (number<float>)
    Amount of cryptocurrency to be paid out if the settlement is in
    cryptocurrency.
  - `display_crypto_currency` (string)
    Cryptocurrency that will displayed. Please ignore if the payout
    is in local currency.
  - `network_fee_crypto_amount` (number<float>)
    Amount of cryptocurrency representing the network fee. This is denominated in `crypto_currency`.
  - `net_crypto_amount` (number<float>)
    Amount of cryptocurrency after deduction of the `network_fee_crypto_amount`.
  - `exchange_rate` (number<float>)
    The exchange rate that will be used to exchange local currency to
    cryptocurrency or vice-versa.
  - `crypto_address` (string)
    Address that recipient will receive the payout at.
  - `status` ("new" | "confirm" | "done" | "cancel")
    The current status of the payout:

    1. `new` - The payout has just been created, but the recipient has not
    entered in their receiving crypto address and the exchange rate has
    not been fixed.

    2. `confirm` - The recipient has confirmed their receiving crypto
    address and the exchange rate has been fixed.

    3. `done` - The crypto payout has been broadcast to the blockchain.

    4. `cancel` - The crypto payout has been cancelled.
  - `status_date` (string<date-time>)
    Date and time the status was updated
  - `merchant_name` (string)
    Name of the merchant
  - `remarks` (string)
    Remarks for the payout
  - `account_type` ("local")
    Account type the funds are drawn from: `local` - Funds are drawn
    from a local currency account
  - `convert_type` ("local-local" | "local-crypto")
    Type of conversion the funds underwent:

    1. `local-local` - Funds are drawn from a local currency account
    and paid out as local currency.

    2. `local-crypto` - Funds are drawn from a local currency account
    and paid out as cryptocurrency.
  - `order_id` (string)
    Your system unique order id. You will get this in the notification webhook data, if you insert your unique order_id in the request body during the payout/settlement creation.

Example:

```json
{
  "refund_currency": "USD",
  "refund_amount": 6,
  "remain_amount": 0,
  "refund_crypto_currency": "testBTC",
  "refund_crypto_amount": 0,
  "remain_crypto_amount": 0,
  "refunds": [
    {
      "payout_reference": "DNU-645266-PYT",
      "type": "refund",
      "local_currency": "USD",
      "local_amount": "1",
      "crypto_currency": "testBTC",
      "crypto_amount": "0.00005168",
      "display_crypto_currency": "testBTC",
      "network_fee_crypto_amount": "0",
      "net_crypto_amount": "0.00005168",
      "exchange_rate": "19349.85",
      "crypto_address": "1NcAyv8YVCnQGCrDb4kiUm1jj6GLyowxER",
      "status": "cancel",
      "status_date": "2022-06-18T10:50:34.741Z",
      "merchant_name": "A to Z Toys and Games",
      "remarks": "Refund for a water pistol",
      "account_type": "local",
      "convert_type": "local-crypto",
      "order_id": "your_order_id"
    }
  ]
}
```

### 401

Not authorized

- `message` (string)

Example:

```json
{
  "message": "some_error_message"
}
```

### 403

No permission to view details of this refund

- `message` (string)

Example:

```json
{
  "message": "some_error_message"
}
```

### 404

Refund not found

- `message` (string)

Example:

```json
{
  "message": "some_error_message"
}
```