---
title: "Retrieve Refund"
source_url: https://docs.rapyd.net/en/retrieve-refund.html
lang: en
---

# Retrieve Refund

Retrieve the details of a `refund` object.

> **Note:**
>
> - The code samples include successful requests (200) and bad requests (400).
>
>   - For error messages that appear due to bad requests (400), see:
>
>     - [General Errors](https://docs.rapyd.net/en/general-errors.md "General Errors")
>     - [Refund Errors](https://docs.rapyd.net/en/refund-errors.md "Refund Errors")
>   - For information about unauthorized request (401) and other authentication errors, see [Troubleshooting Authentication and Authorization Errors](https://docs.rapyd.net/en/troubleshooting-authentication-and-authorization-errors.md "Troubleshooting Authentication and Authorization Errors").

### Parameters

### Request Path Parameters

- - refund
  - ID of the refund you want to retrieve. String starting with **refund_**.

### Request Header Parameters

- - access_key
  - Unique access key provided by Rapyd for each authorized user.

    See [Developers](https://docs.rapyd.net/en/developers.md "Developers").
- - Content-Type
  - Indicates that the data appears in JSON format. Set to **application/json**.
- - salt
  - Random string. Recommended length: 8-16 characters.
- - signature
  - Signature calculated for each request individually.

    See [Request Signatures](https://docs.rapyd.net/en/request-signatures.md "Request Signatures").
- - timestamp
  - Timestamp for the request, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time") (seconds).

### Response Parameters

- - amount
  - Amount of the refund, in units defined by `currency` in the original payment.
- - created_at
  - Time of creation of this refund, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - currency
  - The currency of the amount received by the original payment source. Three-letter ISO 4217 code.
- - ewallets
  - Array of objects that define the allocation of the refund to multiple wallets.

    - - ewallet
      - ID of the wallet, a string starting with **ewallet_**.
    - - amount
      - The amount refunded to this wallet. Relevant when `percentage` is not set.
    - - percentage
      - The percentage of this payment refunded to this wallet. Relevant when `amount` is not set.
- - failure_code
  - Indicates the reason that the refund failed. See [Card Network Errors](https://docs.rapyd.net/en/card-network-errors.md "Card Network Errors").
- - failure_reason
  - Indicates the reason that the refund failed. One of the following:

    - **lost_or_stolen_card**
    - **expired_or_canceled_card**
    - **unknown**
    - Empty string
- - fixed_side
  - Indicates which side of the transaction the FX rate is fixed for. Relevant for refunds with foreign exchange. One of the following values:

    - **buy**
    - **sell**
- - fx_rate
  - Exchange rate for the transaction.

    - When `fixed_side` is **buy**, `fx_rate` is the buy rate.
    - When `fixed_side` is **sell**, `fx_rate` is the sell rate.

    Decimal number as string. Relevant to refunds with foreign exchange.
- - id
  - ID of the `refund` object. String starting with **refund_**.
- - merchant_reference_id
  - Identifier defined by the client for reference purposes. Limit: 45 characters.
- - merchant_debited_amount
  - Amount debited from the merchant. Relevant to refunds with foreign exchange.
- - merchant_debited_currency
  - Indicates the currency that is debited from the merchant. Three-letter ISO 4217 code. Relevant to refunds with foreign exchange.
- - merchant_ewallet
  - As a Payment Facilitator (PayFac), you can create a card payment and direct the funds that the sub-merchant collects to your client wallet.

    Relevant to a [PayFac](https://docs.rapyd.net/en/rapyd-payfac-integration-guide.md "Rapyd PayFac Integration Guide").
- - metadata
  - A JSON object defined by the client. See [Metadata](https://docs.rapyd.net/en/metadata.md "Metadata").
- - payment
  - ID of the `payment` object that the refund is credited against. String starting with **payment_**.
- - payment_created_at
  - Time that the original payment was created, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").
- - payment_method_type
  - The original payment method type. Use [List Payment Methods by Country](https://docs.rapyd.net/en/list-payment-methods-by-country.md "List Payment Methods by Country") for a list of supported types for a country.
- - proportional_refund
  - Indicates whether the refund was returned in proportion to the amounts received by the wallets in the payment. Relevant to a refund for a payment split among multiple wallets.
- - reason
  - Description of the reason for the refund, provided by the merchant.
- - receipt_number
  - Number of the receipt for the refund, provided by the merchant.
- - status
  - Indicates the status of the refund operation. One of the following values:

    - **Canceled** - The merchant canceled the refund.
    - **Completed** - The refund was complete.
    - **Error** - The refund failed since the payment object on which the refund is based is not in **closed** status.
    - **Rejected** - The refund was rejected by the specific payment processor for this payment.
    - **Pending** - The request created a refund object on the Rapyd platform, but the refund is not yet complete. For example, the refund is for a payment method that requires a customer action, such as cash, bank redirect or bank transfer.
- - updated_at
  - Time that this refund was last updated, in [Unix time](https://docs.rapyd.net/en/glossary.md#UUID-945d98cf-adae-e1cf-2606-c7fae8b4a7e1_unix_time "Unix time").

### Code Samples

- - .NET

    - ```csharp
      using System;

      namespace RapydApiRequestSample
      {
          class Program
          {
              static void Main(string[] args)
              {
                  try
                  {
                      string refund = "refund_f988b426b60820c5ec9d9f218a9d105b";

                      string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/refunds/{refund}");

                      Console.WriteLine(result);
                  }
                  catch (Exception e)
                  {
                      Console.WriteLine("Error completing request: " + e.Message);
                  }
              }
          }
      }
      ```
- - JavaScript

    - ```javascript
      const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest;

      async function main() {
        try {
          const result = await makeRequest('GET', '/v1/refunds/refund_85638a7e05557459c9e3ba971c03bf16');

          console.log(result);
        } catch (error) {
          console.error('Error completing request', error);
        }
      }
      ```
- - PHP

    - ```php
      <?php
      $path = $_SERVER['DOCUMENT_ROOT'];
      $path .= "/<path-to-your-utility-file>/utilities.php";
      include($path);

      try {
          $object = make_request('get', '/v1/refunds/refund_eda6643c5bb56a6d9a5be9dc9963d79f');
          var_dump($object);
      } catch(Exception $e) {
          echo "Error: $e";
      }
      ?>
      ```
- - Python

    - ```python
      from pprint import pprint

      from utilities import make_request

      refund = "refund_126f3f657f7014a4f21f0cb2e47e7cdc"
      response = make_request(method='get',
                              path=f'/v1/refunds/{refund}')

      pprint(response)
      ```

- /v1/refunds/:refund

- Retrieve Refund
- ```curl
  curl -X get 'https://sandboxapi.rapyd.net/v1/refunds/refund_a09a2e16352f56a27f5937f87d0b8705' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here'
  ```
- ```json
  {
      "status": {
          "error_code": "",
          "status": "SUCCESS",
          "message": "",
          "response_code": "",
          "operation_id": "bee6a49e-2caa-4d74-95a7-3e3c38750d03"
      },
      "data": {
          "id": "refund_a09a2e16352f56a27f5937f87d0b8705",
          "amount": 7.5,
          "payment": "payment_2174a4518e108f39cba6e367f40a40a6",
          "currency": "USD",
          "failure_reason": "",
          "metadata": {
              "merchant_defined": "Apr 5 2021"
          },
          "reason": "Refund for CK SB",
          "status": "Pending",
          "receipt_number": 0,
          "created_at": 1608567423,
          "updated_at": 1719182140,
          "merchant_ewallet": null,
          "merchant_reference_id": "CA1234567",
          "payment_created_at": 1608567298,
          "payment_method_type": "us_visa_card",
          "ewallets": [
              {
                  "ewallet": "ewallet_5b440aed9dbcb74a34f2893b9839670b",
                  "amount": 5
              },
              {
                  "ewallet": "ewallet_f06ee6298f5f7671a7f21aaf66711554",
                  "amount": 2.5
              }
          ],
          "proportional_refund": false,
          "merchant_debited_amount": null,
          "merchant_debited_currency": null,
          "fx_rate": null,
          "fixed_side": null
      }
  }
  ```

- Bad Request - Refund not found
- ```curl
  curl -X get 'https://sandboxapi.rapyd.net/v1/refunds/refund_a09a2e16352f56a27f5937f87d0b8704' \
  -H 'access_key: your-access-key-here' \
  -H 'Content-Type: application/json' \
  -H 'salt: your-random-string-here' \
  -H 'signature: your-calculated-signature-here' \
  -H 'timestamp: your-unix-timestamp-here'
  ```
- ```json
  {
      "status": {
          "error_code": "INVALID_REFUND",
          "status": "ERROR",
          "message": "The request attempted an operation that requires a refund, but the refund was not found. The request was rejected. Corrective action: Use the ID of a valid refund.",
          "response_code": "INVALID_REFUND",
          "operation_id": "1584ea39-8c85-4705-8077-8ce567f0bee5"
      }
  }
  ```
