List Refunds
Retrieve a list of all refunds.
You can filter the list with query parameters.
Nota
A date range that exceeds 90 days, defined with both
starting_afterandending_before, returns ERROR_QUERY_DATE_RANGE_EXCEEDS_90_DAYS.
The code samples include successful requests (200), bad requests (400), and an unauthorized request (401). For a list of all error messages that appear due to bad requests, see Refund Errors and General Errors
ending_before
The ID of the refund created after the last refund you want to retrieve. String starting with refund_.
Date range: 1-90 days. Default: 90 days.
limit
The maximum number of refunds to return. Range: 1-100.
10
starting_after
The ID of the refund created before the first refund you want to retrieve. String starting with refund_.
Date range: 1-90 days. Default: 90 days.
Code Samples
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { int limit = 2; string result = RapydApiRequestSample.Utilities.MakeRequest("GET", $"/v1/refunds?limit={limit}"); 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?limit=2' ); 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?limit=2'); var_dump($object); } catch(Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request response = make_request(method='get', path=f'/v1/refunds?limit=2') pprint(response)
/v1/refunds
List Refunds
curl -X get 'https://sandboxapi.rapyd.net/v1/refunds?limit=2' \ -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": "1e5c1395-d2ce-44d7-a826-73820c01add7" }, "data": [ { "id": "refund_1b77a19d5983e89cdadf264b32dbc43a", "amount": 49.75, "payment": "payment_288508dafbe91086885383b6790a6c9d", "currency": "USD", "failure_reason": "", "metadata": {}, "reason": "returned merchandise", "status": "Completed", "receipt_number": 0, "created_at": 1763551380, "updated_at": 1763551380, "merchant_ewallet": null, "merchant_reference_id": "2025-11-19g", "payment_created_at": 1763551361, "payment_method_type": "fr_visa_card", "ewallets": [], "proportional_refund": true, "merchant_debited_amount": 49.56, "merchant_debited_currency": "EUR", "fx_rate": 1.0039151914, "fixed_side": "sell" }, { "id": "refund_eb2cb9cb3101636e1c1ba4c5c6c41864", "amount": 3705, "payment": "payment_3366b2e1ad6bb767713077c9d4cb136a", "currency": "COP", "failure_reason": "", "metadata": {}, "reason": "Uncredited discount", "status": "Completed", "receipt_number": 0, "created_at": 1763551080, "updated_at": 1763551080, "merchant_ewallet": null, "merchant_reference_id": "2025-11-19ee", "payment_created_at": 1763550901, "payment_method_type": "co_debit_visa_card", "ewallets": [], "proportional_refund": false, "merchant_debited_amount": null, "merchant_debited_currency": null, "fx_rate": null, "fixed_side": null } ] }
Bad Request - Invalid limit
curl -X get 'https://sandboxapi.rapyd.net/v1/refunds?limit=200' \ -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": "INVALID_LIMIT", "status": "ERROR", "message": "The request tried to retrieve a list of objects, but the 'limit' query parameter was not set to a valid value. The request was rejected. Corrective action: Set 'limit' to an integer between 1 and 100.", "response_code": "INVALID_LIMIT", "operation_id": "34be7511-3c54-4ba2-99e0-95987336b89d" } }
Unauthorized
curl -X get 'https://sandboxapi.rapyd.net/v1/refunds?limit=2' \ -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": "UNAUTHENTICATED_API_CALL", "status": "ERROR", "message": "The request was rejected due to an authentication issue. Corrective action: Check the status of your account in the 'Account Details' page of the Client Portal.", "response_code": "UNAUTHENTICATED_API_CALL", "operation_id": "034ff9bc-e27c-405b-8f8d-437becbc2358" } }