curl --request POST \
--url https://hpay-api.host-sl.com/api/v1/transactions/wallet/transfer/ \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"sender_wallet_id": "wall_sender_123...",
"recipient_identifier": "recipient_username",
"amount": 50.00
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
transfer = client.transfers.create(
sender_wallet_id="wall_sender_123...",
recipient_identifier="recipient_username",
amount=50.00,
)
print(transfer["id"], transfer["status"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const transfer = await client.transfers.create({
senderWalletId: "wall_sender_123...",
recipientIdentifier: "recipient_username",
amount: 50.0,
});
console.log(transfer.id, transfer.status);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/transactions/wallet/transfer/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sender_wallet_id' => 'wall_sender_123...',
'recipient_identifier' => 'recipient_username',
'amount' => 50
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: YOUR_API_KEY",
"secret-key: YOUR_SECRET_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
"id": "trans_123abc...",
"wallet_id": "wall_sender_123...",
"recipient_wallet_id": "wall_recipient_789...",
"amount": 50.0,
"currency": "USD",
"transaction_type": "transfer",
"payment_method": "wallet",
"status": "completed",
"application_fee": 1.0,
"description": "Payment for services",
"created_at": "2025-01-16T10:05:00Z"
}
{
"detail": "Insufficient funds. Required: $51.00 (including $1.00 application fee), Available: $45.00"
}
{
"detail": "Missing or invalid API keys"
}
{
"detail": "Transaction failed: Recipient account is disabled"
}
{
"detail": "Recipient not found"
}
Transactions
Wallet Transfer
Transfer funds from one wallet to another within the same application.
POST
/
api
/
v1
/
transactions
/
wallet
/
transfer
/
curl --request POST \
--url https://hpay-api.host-sl.com/api/v1/transactions/wallet/transfer/ \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"sender_wallet_id": "wall_sender_123...",
"recipient_identifier": "recipient_username",
"amount": 50.00
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
transfer = client.transfers.create(
sender_wallet_id="wall_sender_123...",
recipient_identifier="recipient_username",
amount=50.00,
)
print(transfer["id"], transfer["status"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const transfer = await client.transfers.create({
senderWalletId: "wall_sender_123...",
recipientIdentifier: "recipient_username",
amount: 50.0,
});
console.log(transfer.id, transfer.status);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/transactions/wallet/transfer/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sender_wallet_id' => 'wall_sender_123...',
'recipient_identifier' => 'recipient_username',
'amount' => 50
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: YOUR_API_KEY",
"secret-key: YOUR_SECRET_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
"id": "trans_123abc...",
"wallet_id": "wall_sender_123...",
"recipient_wallet_id": "wall_recipient_789...",
"amount": 50.0,
"currency": "USD",
"transaction_type": "transfer",
"payment_method": "wallet",
"status": "completed",
"application_fee": 1.0,
"description": "Payment for services",
"created_at": "2025-01-16T10:05:00Z"
}
{
"detail": "Insufficient funds. Required: $51.00 (including $1.00 application fee), Available: $45.00"
}
{
"detail": "Missing or invalid API keys"
}
{
"detail": "Transaction failed: Recipient account is disabled"
}
{
"detail": "Recipient not found"
}
This endpoint allows for instant transfers of funds between two wallets within your application. You can identify the recipient using their username, phone number, or email address.
Request Body
string
required
The unique identifier of the wallet sending the funds.
string
required
The identifier of the recipient user (username, phone number, or email).
number
required
The amount to transfer in the application’s base currency.
string
An optional description for the transfer (default: “Wallet transfer”).
Response
string
The unique identifier for the transaction.
string
The ID of the sender’s wallet.
string
The ID of the recipient’s wallet.
number
The net amount transferred to the recipient.
string
The currency code (e.g., “USD”).
string
The current status of the transaction (e.g., “completed”).
number
The platform fee collected from the sender for this transfer.
{
"id": "trans_123abc...",
"wallet_id": "wall_sender_123...",
"recipient_wallet_id": "wall_recipient_789...",
"amount": 50.0,
"currency": "USD",
"transaction_type": "transfer",
"payment_method": "wallet",
"status": "completed",
"application_fee": 1.0,
"description": "Payment for services",
"created_at": "2025-01-16T10:05:00Z"
}
{
"detail": "Insufficient funds. Required: $51.00 (including $1.00 application fee), Available: $45.00"
}
{
"detail": "Missing or invalid API keys"
}
{
"detail": "Transaction failed: Recipient account is disabled"
}
{
"detail": "Recipient not found"
}
curl --request POST \
--url https://hpay-api.host-sl.com/api/v1/transactions/wallet/transfer/ \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"sender_wallet_id": "wall_sender_123...",
"recipient_identifier": "recipient_username",
"amount": 50.00
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
transfer = client.transfers.create(
sender_wallet_id="wall_sender_123...",
recipient_identifier="recipient_username",
amount=50.00,
)
print(transfer["id"], transfer["status"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const transfer = await client.transfers.create({
senderWalletId: "wall_sender_123...",
recipientIdentifier: "recipient_username",
amount: 50.0,
});
console.log(transfer.id, transfer.status);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/transactions/wallet/transfer/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'sender_wallet_id' => 'wall_sender_123...',
'recipient_identifier' => 'recipient_username',
'amount' => 50
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api-key: YOUR_API_KEY",
"secret-key: YOUR_SECRET_KEY"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}