Create Beneficiary Tokenization Page
Create a customer-facing page for creating a beneficiary token.
This method creates a URL for a page where the customer enters details required for payouts to the beneficiary’s bank account. All available payout methods for the beneficiary’s country are listed.
Note
If
beneficiary_country
is not specified, the customer specifies the country on the beneficiary tokenization page. As a best practice, Rapyd recommends always filling this field in and not leaving it to the customer.For an individual beneficiary, if
first_name
andlast_name
are not specified, the customer provides this information on the beneficiary tokenization page.When the customer provides all required information, a beneficiary object is created and Rapyd sends a webhook to the client with the ID of the beneficiary object.
Code Samples
.NET
using System; using System.Text.Json; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { var requestObj = new { category = "bank", beneficiary_entity_type = "individual", merchant_reference_id = "b-100456", cancel_url = "http://example.com/cancel", complete_url = "http://example.com/complete", sender_country = "US", beneficiary_optional_fields = new { identification_type = "international_passport", identification_value = "123456789" }, string payout_method_types_exclude = new string[] { "us_bank" }; sender_currency = "USD", payout_currency = "EUR", sender_entity_type = "company" }; string request = JsonSerializer.Serialize(requestObj); string result = RapydApiRequestSample.Utilities.MakeRequest("POST", "/v1/hosted/disburse/beneficiary", request); 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 = { category: 'bank', beneficiary_entity_type: 'individual', merchant_reference_id: 'b-100456', cancel_url: 'http://example.com/cancel', complete_url: 'http://example.com/complete', sender_country: 'US', beneficiary_optional_fields: { identification_type: 'international_passport', identification_value: '123456789' }, payout_method_types_exclude: ['us_bank'], sender_currency: 'USD', payout_currency: 'EUR', sender_entity_type: 'company' }; const result = await makeRequest('POST', '/v1/hosted/disburse/beneficiary', 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); $body = [ "category" => "bank", "beneficiary_entity_type" => "individual", "merchant_reference_id" => "b-100456", "cancel_url" => "http://example.com/cancel", "complete_url" => "http://example.com/complete", "sender_country" => "US", "beneficiary_optional_fields" => array( "identification_type" => "international_passport", "identification_value" => "123456789" ), "payout_method_types_exclude" => [ "us_bank" ], "sender_currency" => "USD", "payout_currency" => "EUR", "sender_entity_type" => "company" ]; try { $object = make_request('post', '/v1/hosted/disburse/beneficiary', $body); var_dump($object); } catch(Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request request_body = { "category": "bank", "beneficiary_entity_type": "individual", "merchant_reference_id": "b-100456", "cancel_url": "http://example.com/cancel", "complete_url": "http://example.com/complete", "sender_country": "US", "beneficiary_optional_fields": { "identification_type": "international_passport", "identification_value": "123456789" }, "payout_method_types_exclude": [ "us_bank" ], "sender_currency": "USD", "payout_currency": "EUR", "sender_entity_type": "company" } results = make_request(method='post', path='/v1/hosted/disburse/beneficiary', body=request_body) pprint(results)
/v1/hosted/disburse/beneficiary
Category=Bank, Beneficiary=Individual
curl -X post https://sandboxapi.rapyd.net/v1/hosted/disburse/beneficiary -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' -d '{ "category": "bank", "beneficiary_entity_type": "individual", "merchant_reference_id": "bank_individual", "cancel_url": "http://example.com/cancel", "complete_url": "http://example.com/complete", "sender_country": "US", "beneficiary_optional_fields": { "identification_type": "international_passport", "identification_value": "123456789" }, "payout_method_types_exclude": [ "us_bank" ], "sender_currency": "USD", "payout_currency": "EUR", "sender_entity_type": "company" } '
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "54ffea3a-b679-4c59-9b04-11abb7ca76f5" }, "data": { "status": "NEW", "cancel_url": "http://example.com/cancel", "complete_url": "http://example.com/complete", "language": null, "merchant_color": "323fff", "merchant_logo": null, "merchant_website": "https://rapyd.net", "merchant_customer_support": {}, "merchant_alias": "Rapyd", "page_expiration": 1632057053, "redirect_url": "https://sandboxhosted.rapyd.net/disburse/beneficiary?token=hp_ben_a1d10a8377d468e72385d85840756010", "id": "hp_ben_a1d10a8377d468e72385d85840756010", "category": "bank", "sender_entity_type": "company", "sender_country": "US", "merchant_reference_id": "bank_individual", "beneficiary_entity_type": "individual", "beneficiary_country": null, "beneficiary_currency": "EUR", "sender_currency": "USD", "beneficiary_id": null, "payout_method_type": null, "beneficiary_validated": false, "timestamp": 1630847453, "beneficiary_optional_fields": { "last_name": null, "first_name": null, "company_name": null, "identification_type": "international_passport", "identification_value": "123456789" }, "payout_method_types_include": null, "payout_method_types_exclude": [ "us_bank" ], "expiration": 1632057053 } }
Category=Bank, Beneficiary=Company
curl -X post https://sandboxapi.rapyd.net/v1/hosted/disburse/beneficiary -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' -d '{ "category": "bank", "beneficiary_entity_type": "company", "merchant_reference_id": "bank_company", "cancel_url": "http://example.com/cancel", "complete_url": "http://example.com/complete", "sender_country": "SG", "beneficiary_country": "DE", "beneficiary_optional_fields": { "last_name": "", "first_name": "", "company_name": "Four Star Limousine Service", "identification_type": "company_registered_number", "identification_value": "123456789" }, "sender_entity_type": "company" } '
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "32f32243-86b1-4344-bba5-c42d9b50c8c6" }, "data": { "status": "NEW", "cancel_url": "http://example.com/cancel", "complete_url": "http://example.com/complete", "language": null, "merchant_color": "323fff", "merchant_logo": null, "merchant_website": "https://rapyd.net", "merchant_customer_support": {}, "merchant_alias": "Rapyd", "page_expiration": 1632057248, "redirect_url": "https://sandboxhosted.rapyd.net/disburse/beneficiary?token=hp_ben_811969d30bf3422d04a51b3b5294ff94", "id": "hp_ben_811969d30bf3422d04a51b3b5294ff94", "category": "bank", "sender_entity_type": "company", "sender_country": "SG", "merchant_reference_id": "bank_company", "beneficiary_entity_type": "company", "beneficiary_country": "DE", "beneficiary_currency": "EUR", "sender_currency": "SGD", "beneficiary_id": null, "payout_method_type": null, "beneficiary_validated": false, "timestamp": 1630847648, "beneficiary_optional_fields": { "last_name": null, "first_name": null, "company_name": "Four Star Limousine Service", "identification_type": "company_registered_number", "identification_value": "123456789" }, "payout_method_types_include": null, "payout_method_types_exclude": null, "expiration": 1632057248 } }
Category=Card, Beneficiary=Individual
curl -X post https://sandboxapi.rapyd.net/v1/hosted/disburse/beneficiary -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' -d '{ "category": "card", "beneficiary_entity_type": "individual", "merchant_reference_id": "johndoe", "cancel_url": "http://example.com/cancel", "complete_url": "http://example.com/complete", "sender_country": "US", "beneficiary_optional_fields": { "first_name": "John", "last_name": "Doe", "identification_type": "international_passport", "identification_value": "123456789" }, "payout_method_types_exclude": [ "us_general_bank" ], "sender_currency": "USD", "payout_currency": "USD", "sender_entity_type": "company" } '
{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "1590e6c0-4b1c-4283-8b76-4575c199742c" }, "data": { "status": "NEW", "cancel_url": "http://example.com/cancel", "complete_url": "http://example.com/complete", "language": null, "merchant_color": "323fff", "merchant_logo": null, "merchant_website": "https://rapyd.net", "merchant_customer_support": {}, "merchant_alias": "Rapyd", "page_expiration": 1632057390, "redirect_url": "https://sandboxhosted.rapyd.net/disburse/beneficiary?token=hp_ben_199da3f4be276c224931fef5653c2dc8", "id": "hp_ben_199da3f4be276c224931fef5653c2dc8", "category": "card", "sender_entity_type": "company", "sender_country": "US", "merchant_reference_id": "johndoe", "beneficiary_entity_type": "individual", "beneficiary_country": null, "beneficiary_currency": "USD", "sender_currency": "USD", "beneficiary_id": null, "payout_method_type": null, "beneficiary_validated": false, "timestamp": 1630847790, "beneficiary_optional_fields": { "last_name": "Doe", "first_name": "John", "company_name": null, "identification_type": "international_passport", "identification_value": "123456789" }, "payout_method_types_include": null, "payout_method_types_exclude": [ "us_general_bank" ], "expiration": 1632057390 } }