Cancel Payout
Cancel a payout.
The payout can be canceled unless its status is confirmation or completed.
This method triggers the Payout Canceled Webhook. This webhook contains the same information as the response.
payout
ID of the payout. String starting with payout_.
.NET
using System; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string payout = "payout_83a845966bdde5e999b2ac94b1faf949"; string result = RapydApiRequestSample.Utilities.MakeRequest("DELETE", $"/v1/payouts/{payout}"); 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( 'DELETE', '/v1/payouts/payout_83a845966bdde5e999b2ac94b1faf949' ); 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('delete', '/v1/payouts/payout_83a845966bdde5e999b2ac94b1faf949'); var_dump($object); } catch(Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request payout = 'payout_83a845966bdde5e999b2ac94b1faf949' results = make_request(method='delete', path=f'/v1/payouts/{payout}') pprint(results)
/v1/payouts/:payout
Cancel Payout
curl -X delete https://sandboxapi.rapyd.net/v1/payouts/payout_83a845966bdde5e999b2ac94b1faf949 -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": "d2ac6cd2-39a9-4325-9061-04162c35917a" }, "data": { "id": "payout_83a845966bdde5e999b2ac94b1faf949", "payout_type": "bank", "payout_method_type": "us_general_bank", "amount": 110, "payout_currency": "USD", "sender_amount": 110, "sender_currency": "USD", "status": "Canceled", "sender_country": "US", "sender": { "id": "sender_ea47488bac2889ea12ee53e80c062ea7", "country": "US", "entity_type": "individual", "address": "123 First Street", "name": "John Doe", "date_of_birth": "22/02/1980", "postcode": "12345", "city": "Anytown", "state": "NY", "account_number": "123456789", "currency": "USD", "identification_type": "License No", "identification_value": "123456789", "purpose_code": "ABCDEFGHI", "beneficiary_relationship": "client", "source_of_income": "salary" }, "beneficiary_country": "US", "beneficiary": { "id": "beneficiary_bf31d0f23f86cf452774363da039b4ee", "country": "US", "entity_type": "individual", "address": "456 Second Street", "name": "Jane Doe", "postcode": "10101", "city": "Anytown", "state": "NY", "account_number": "BG96611020345678", "currency": "USD", "email": "janedoe@rapyd.net", "identification_type": "SSC", "identification_value": "123456789", "bank_name": "US General Bank", "bic_swift": "BUINBGSF", "ach_code": "123456789" }, "fx_rate": 1, "instructions": { "name": "instructions", "steps": [ { "step1": "The funds will be transferred to the provided account details of the beneficiary ." } ] }, "instructions_value": {}, "ewallets": [ { "ewallet_id": "ewallet_090e1ef18c3aa754fd43cce9ee454858", "amount": 110, "percent": 100 } ], "metadata": { "merchant_defined": true }, "description": "Payout - Bank Transfer: Beneficiary/Sender IDs", "created_at": 1600845753, "payout_fees": null, "expiration": null, "merchant_reference_id": "GHY-0YU-HUJ-POI", "paid_at": null, "identifier_type": null, "identifier_value": null, "error": null, "paid_amount": 0 } }