Search⌘ K
AI Features

Step 5: Fund the Transfer

Explore how to fund a money transfer using the Wise Payouts API. Understand critical steps such as initiating a fund transfer, handling account balances, observing transaction statuses, and using sandbox simulation endpoints. This lesson guides you through managing fund transfers and testing payment states effectively in a developer environment.

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

Transfer funds

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.

Javascript (babel-node)
// 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:
...