The demand for borderless financial transactions keeps increasing as the global economy becomes increasingly interconnected. More companies are increasingly hiring internationally to access a wider pool of talent, extend runway or hire one or two exceptional talents. With this, Multi-currency wallets have proved to be indispensable, offering businesses a flexibility in managing cross-border transactions and currency conversions. In response to this need, Chimoney offers access to Multi-Currency Wallets for businesses and developers to integrate into their Financial workflows, Products and Solutions.
With Chimoney's Multi-Currency Wallets Businesses can fund, send and receive funds in various currencies i.e. USD, CAD, and NGN. Whether it's disbursing salaries to employees across different countries, settling invoices with international suppliers, or receiving payments from clients worldwide, these wallets provide users with the versatility they need to conduct transactions in their preferred currency.
The Chimoney Multi-Currency Wallets Infrastructure and API is specifically designed to facilitate the creation and management of multicurrency wallets, as well as seamless fund cross-currency global transfers between the wallets and other recipient channels, such as email and phone numbers.
In this article we’ll focus on only two endpoints:
We’ll implement a sample integration for an Organization with a remote team or community members distributed globally. The company needs a streamlined way to pay employees in their local currencies, ensuring timely, compliant and transparent transactions. Integrating Chimoney's multi-currency wallets offers the following benefits:
Before diving into the integration process, developers need to sign up for a Chimoney developer account and obtain their API keys, which we'll use to set the Authorization header in our API requests.
To make HTTPS requests to the Chimoney API, we'll use the axios library. Install it using npm or yarn:
npm install axios
Or use fetch
.
The /v0.2/multicurrency-wallets/create
endpoint allows you to create new multi-currency wallets for the employees and community members. Here's an example of a Node.js function that creates a wallet for an employee:
const axios = require('axios');
async function createWallet(userData) {
const url = 'https://api.chimoney.io/v0.2/multicurrency-wallets/create';
const apiKey = 'YOUR_API_KEY'; // Replace with your Chimoney API key
const data = {
name: "Jane Doe",
email: "jane.doe@company.org"
};
const headers = {
'Content-Type': 'application/json',
'x-api-key': `${apiKey}`,
};
try {
const response = await axios.post(url, data, { headers });
if (response.status === 200) {
console.log('Wallet created successfully!');
console.log('Wallet ID:', response.data.id);
return response.data.id;
} else {
console.error('Error creating wallet:', response.data.error);
throw new Error(response.data.error);
}
} catch (error) {
throw error;
}
}
This function takes user data (name, email, etc.) as input and returns the newly created wallet ID upon successful creation. Remember to replace YOUR_API_KEY
with your actual Chimoney API key.
The /v0.2/multicurrency-wallets/transfer
endpoint enables you to automate international payroll payments to employee wallets. Here's an example function for processing remote employee payments and payments to international community members:
async function processPayroll(employeeWalletId, amount, originCurrency, destinationCurrency) {
const url = 'https://api.chimoney.io/v0.2/multicurrency-wallets/transfer';
const headers = {
'Content-Type': 'application/json',
'x-api-key': `${apiKey}`,
};
const senderWalletId = 'YOUR_COMPANY_WALLET_ID'; // Replace with your organization's wallet ID
const data = {
amountToSend: amount,
originCurrency: originCurrency,
receiver: employeeWalletId, // Use the employee's wallet ID as the receiver
destinationCurrency: destinationCurrency,
};
try {
const response = await axios.post(url, data, { headers });
if (response.status === 200) {
console.log('Payroll payment successful!');
console.log('Transaction details:', response.data);
// Handle successful payment, e.g., update payroll records
} else {
console.error('Error processing payroll payment:', response.data.error);
// Handle payment error, e.g., log details, notify administrator
}
} catch (error) {
console.error('Error sending payroll transfer request:', error);
// Handle network errors or API issues
}
}
// Example usage (assuming you have employee dat)
const employeeData = {
name: 'Jane Doe',
email: 'jane.doe@company.org',
};
createEmployeeWallet(employeeData)
.then(employeeWalletId => {
processPayroll(employeeWalletId, 1000, 'USD', 'EUR'); // Pay €1000 equivalent in USD
})
.catch(error => {
console.error('An error occurred:', error);
});
The function sends payroll payments from the organization's wallet to employee wallets. It constructs a request to Chimoney's API endpoint /v0.2/multicurrency-wallets/transfer
, including necessary headers and data. Upon successful payment, transaction details are logged, otherwise, error messages are logged for failed transactions. You can adjust the sender's wallet ID (senderWalletId) to the specific organization's wallet ID.
The employee or community member is notified and they can cash out their Payment to their Bank Account, Wallet, or other local options.
In conclusion, integrating Chimoney's Global Multi-Currency Wallets offers businesses and developers a seamless solution for global financial transactions and the flexibility needed to thrive in today's interconnected world.