Step 5: Fund the Transfer

Learn to transfer funds using Wise Payouts API.

In this lesson, we’ll learn how to transfer funds and use simulation endpoints.

Transfer funds

Press + to interact
Fund transfer
Fund transfer

This is the final step of the payouts process. After executing this call, our account will be debited with the amount we transferred, and the status of the receiver’s account will also change. The following endpoint is used to make this happen:

{baseURL}/v3/profiles/{profileID}/transfers/{transferID}/payments

Request parameters

The code below takes only one parameter:

Parameter Name

Format

Category

Description

type

String

Required

Shows that multicurrency account will be debited by this transfer. Its value is BALANCE.

Press + to interact
Please provide values for the following:
API_KEY
Not Specified...
PROFILE_ID
Not Specified...
TRANSFER_ID
Not Specified...
// Importing libraries here
const fetch = require('node-fetch');
// Define API key here
const API_KEY = 'Bearer {{API_KEY}}';
// Define endpoint URL here
const endpointUrl = 'https://api.sandbox.transferwise.tech/v3/profiles/{{PROFILE_ID}}/transfers/{{TRANSFER_ID}}/payments';
// Define Header Parameters here
const headerParameters = {
authorization: API_KEY,
'Content-Type': 'application/json',
};
// Define Body Parameters here
const bodyParameters = "{ \n \"type\":\"BALANCE\"\n}";
// Setting API call options
const options = {
method: 'POST',
headers: headerParameters,
body: bodyParameters,
};
// Function to make API call
async function transferFund() {
try {
const response = await fetch(endpointUrl, options);
// Printing response
printResponse(response);
} catch (error) {
// Printing error message
printError(response);
}
}
// Calling function to make API call
transferFund();

Let’s have a look at the highlighted lines in the code shown above:

  • Line 8: We define the URL for
...