Skip to main content

Documentation

Retrieve Refund

Retrieve the details of a refund object.

    • refund

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

Code Samples
    • .NET

      • 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

      • 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
        $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

      • 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 -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'
    
  • {
        "status": {
            "error_code": "",
            "status": "SUCCESS",
            "message": "",
            "response_code": "",
            "operation_id": "e7ca97ea-ab7f-4de5-8b64-0dbd8f2af4ea"
        },
        "data": {
            "id": "refund_a09a2e16352f56a27f5937f87d0b8705",
            "amount": 7.5,
            "payment": "payment_2174a4518e108f39cba6e367f40a40a6",
            "currency": "USD",
            "failure_reason": "",
            "metadata": {
                "merchant_defined": "updated"
            },
            "reason": "Refund for CK SB",
            "status": "Completed",
            "receipt_number": 0,
            "created_at": 1608567423,
            "updated_at": 1608568249,
            "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
        }
    }