Bank Account Transfer Method
Once you've completed steps 1 and 2 from the How to Payout to a Beneficiary with Full API Solution guide, the next step is to set up a transfer method and initiate the transfer. If the beneficiary has chosen to provide their bank account details, follow the steps outlined below to ensure a smooth payout process.
API Endpoints Used
This guide will demonstrate step-by-step instructions using the API integration method. In this guide, you will use the following API endpoints:
Step 3: Create Transfer Method
To manage how funds are transferred to beneficiaries, you need to create a transfer method. To add a bank account transfer method, use the Add Bank Account endpoint. This lets you specify the beneficiary's bank account details, ensuring funds are correctly directed to their bank account. Below, you will find an example request to add a bank account:
curl --request POST \
--url "https://merchantapi.testewallet.com/api/v1/transfer/beneficiary/<beneficiaryToken_from_step_2>/bankaccount" \
--header 'Authorization: Bearer <YOUR_API_TOKEN>' \
--header 'X-MerchantId: <YOUR_MERCHANT_ID>' \
--header 'accept: application/json' \
--header 'content-type: application/*+json' \
--data '{
"beneficiaryToken": "<beneficiaryToken_from_step_2>",
"accountHolderName": "John Doe",
"accountNumber": "123456789",
"bankName": "Bank of the World",
"routingNumber": "987654321",
"countryCode": "US",
"currencyCode": "USD"
}'
{
"isSuccess": true,
"message": "Bank account added successfully",
"statusCode": 200,
"logIdentifier": "def456ghi789",
"token": "bankAcc123Token",
"dateCreated": "2024-07-20T10:00:00.000Z",
"dateUpdated": "2024-07-20T10:00:00.000Z"
}
Step 4: Create Transfer
With the new beneficiaries created in the system, you can now pay them. This is done by transferring funds to them. The Create Transfer endpoint will be used to make the transfer from you to your beneficiary by linking the transfer with the beneficiaryToken
created on Step 2. Below, you will find an example request to create a new transfer:
curl --request POST \
--url "https://merchantapi.testewallet.com/api/v1/transfer/create" \
--header 'Authorization: Bearer <YOUR_API_TOKEN>' \
--header 'X-MerchantId: <YOUR_MERCHANT_ID>' \
--header "accept: application/json" \
--header "Content-Type: application/json" \
--data '{
"merchantTransactionId": "TX123456",
"beneficiaryToken": "<beneficiaryToken_from_step_2>",
"autoApprove": true,
"comments": "Payment for services",
"dateExpire": "2024-12-31T23:59:59.999Z",
"sourceAmount": 100.00,
"sourceCurrency": "USD",
"destinationAmount": 95.00,
"destinationCurrency": "EUR",
"destinationType": 1
}'
{
"isSuccess": true,
"message": "Transfer created successfully",
"statusCode": 200,
"logIdentifier": "abc123def456",
"token": "trans789token",
"dateCreated": "2024-07-09T16:17:00.548Z",
"dateUpdated": "2024-07-09T16:17:00.548Z",
"statusId": 1,
"fxRate": 1.05,
"customerFee": 2.50,
"merchantFee": 1.00
}
Updated 2 months ago