List Refunds
Retrieve a list of all refunds.
You can filter the list with query parameters.
ending_before
The ID of the refund created after the last refund you want to retrieve. String starting with refund_.
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_.
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": "27b233c6-01b2-4422-91e1-d742dbe145a3" }, "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": [], "proportional_refund": false, "merchant_debited_amount": null, "merchant_debited_currency": null, "fx_rate": null, "fixed_side": null }, { "id": "refund_3c4e0a1b6b8738b04fb1b6785e75aa48", "amount": 10, "payment": "payment_03410aab01ed7af34f30c2107bbd9bd5", "currency": "USD", "failure_reason": "", "metadata": { "merchant_defined": true }, "reason": "Uncredited discount", "status": "Completed", "receipt_number": 0, "created_at": 1608561483, "updated_at": 1608561483, "merchant_reference_id": "REFUND-08OCT", "payment_created_at": 1608561441, "payment_method_type": "us_visa_card", "ewallets": [], "proportional_refund": true, "merchant_debited_amount": null, "merchant_debited_currency": null, "fx_rate": null, "fixed_side": null } ] }