Confirm Payout with FX
Confirm the exchange rate of a payout that involves foreign exchange.
Relevant when the payout was created with confirm_automatically
set to false (default). To confirm creation of the payout with the FX rate included in the response to Create Payout, you must run this method within a short time. The exact amount of time varies from payout method to payout method.
This method triggers the Payout Created 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_a8f528fc070c62ae6ea2025d3fb6d041"; string result = RapydApiRequestSample.Utilities.MakeRequest("POST", $"/v1/payouts/confirm/{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 body = {}; const result = await makeRequest( 'POST', '/v1/payouts/confirm/payout_a8f528fc070c62ae6ea2025d3fb6d041', body ); 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('post', '/v1/payouts/confirm/payout_a8f528fc070c62ae6ea2025d3fb6d041'); var_dump($object); } catch(Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request payout = 'payout_a8f528fc070c62ae6ea2025d3fb6d041' results = make_request(method='post', path=f'/v1/payouts/confirm/{payout}') pprint(results)
/v1/payouts/confirm/:payout
Confirm Payout with FX
curl -X post https://sandboxapi.rapyd.net/v1/payouts/confirm/payout_a6f557970faa9bf75ef34b69c991da57 -H 'access_key: your-access-key-here' -H 'Content-Type: application/json' -H 'idempotency: your-idempotency-parameter-here' -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": "7b23e8c6-220e-4900-9553-350b996ce410" }, "data": { "id": "payout_a6f557970faa9bf75ef34b69c991da57", "payout_type": "bank", "payout_method_type": "mx_abc_capital_bank", "amount": 2000, "payout_currency": "MXN", "sender_amount": 102.45, "sender_currency": "USD", "status": "Created", "sender_country": "US", "sender": { "id": "sender_94e84ba869e20da70be5b0c0027c889d", "country": "US", "entity_type": "company", "address": "address 2", "name": "Rapyd", "postcode": "3333", "city": "Amsterdam", "phone_number": "19019044444", "company_name": "Rapyd", "currency": "USD", "identification_value": "unc_num_123333", "province": "Amsterdam", "occupation": "Ridesharing" }, "beneficiary_country": "MX", "beneficiary": { "id": "beneficiary_d75798c2168f04a552542880ba772966", "last_name": "Doe", "first_name": "Jane", "country": "MX", "entity_type": "individual", "name": "Jane Doe", "currency": "MXN", "bank_name": "Jane Doe", "category": "bank" }, "fx_rate": 19.522119, "instructions": { "name": "instructions", "steps": [ { "step1": "The funds will be transferred to the provided account details of the beneficiary ." } ] }, "ewallets": [ { "ewallet_id": "ewallet_4f1757749b8858160274e6db49f78ff3", "amount": 102.45, "percent": 100 } ], "metadata": { "merchant_defined": true }, "description": "FX with confirmation", "created_at": 1607941192, "payout_fees": null, "expiration": null, "merchant_reference_id": "", "paid_at": null, "identifier_type": null, "identifier_value": null, "error": null, "paid_amount": 0, "statement_descriptor": "RIDE MX payout monthly" } }