curl --request POST \
--url https://hpay-api.host-sl.com/api/v1/transactions/wallet/card-deposit/create \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"wallet_id": "wall_789xyz...",
"amount": 100.00
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
deposit = client.deposits.card(
wallet_id="wall_789xyz...",
amount=100.00,
)
print(deposit["transaction_id"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const deposit = await client.deposits.card({
walletId: "wall_789xyz...",
amount: 100.0,
});
console.log(deposit.transaction_id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/transactions/wallet/card-deposit/create",
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([
'wallet_id' => 'wall_789xyz...',
'amount' => 100
]),
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_789xyz...",
"amount": 95.0,
"currency": "USD",
"transaction_type": "deposit",
"payment_method": "card",
"status": "pending",
"total_amount_paid": 100.0,
"stripe_fee": 3.0,
"application_fee": 2.0,
"created_at": "2025-01-16T10:00:00Z"
}
{
"detail": "Invalid deposit amount"
}
{
"detail": "Missing or invalid API keys"
}
{
"detail": "Transaction failed: Wallet is disabled"
}
{
"detail": "Wallet not found"
}
{
"detail": "Rate limit exceeded. Please try again later."
}
Transactions
Create Card Deposit
Create a card deposit payment intent for a specific wallet.
POST
/
api
/
v1
/
transactions
/
wallet
/
card-deposit
/
create
curl --request POST \
--url https://hpay-api.host-sl.com/api/v1/transactions/wallet/card-deposit/create \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"wallet_id": "wall_789xyz...",
"amount": 100.00
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
deposit = client.deposits.card(
wallet_id="wall_789xyz...",
amount=100.00,
)
print(deposit["transaction_id"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const deposit = await client.deposits.card({
walletId: "wall_789xyz...",
amount: 100.0,
});
console.log(deposit.transaction_id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/transactions/wallet/card-deposit/create",
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([
'wallet_id' => 'wall_789xyz...',
'amount' => 100
]),
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_789xyz...",
"amount": 95.0,
"currency": "USD",
"transaction_type": "deposit",
"payment_method": "card",
"status": "pending",
"total_amount_paid": 100.0,
"stripe_fee": 3.0,
"application_fee": 2.0,
"created_at": "2025-01-16T10:00:00Z"
}
{
"detail": "Invalid deposit amount"
}
{
"detail": "Missing or invalid API keys"
}
{
"detail": "Transaction failed: Wallet is disabled"
}
{
"detail": "Wallet not found"
}
{
"detail": "Rate limit exceeded. Please try again later."
}
This endpoint initiates a card deposit to a user’s wallet. It creates a Stripe PaymentIntent that the client must confirm to complete the deposit.
Request Body
string
required
The unique identifier of the wallet to deposit funds into.
number
required
The amount to deposit in the wallet’s base currency (e.g., 100.00 for $100.00 USD).
string
Optional Stripe PaymentMethod ID (
pm_...) to reuse from fee estimation. If provided, the user won’t need to enter card details again.Response
string
The unique identifier for the transaction.
string
The ID of the wallet receiving the deposit.
number
The net amount to be credited to the wallet.
string
The currency code (e.g., “USD”).
string
The current status of the transaction (e.g., “pending”, “completed”, “failed”).
number
The total amount paid by the user, including all platform and provider fees.
number
The fee charged by Stripe for processing the payment.
number
The platform fee collected by your application.
{
"id": "trans_123abc...",
"wallet_id": "wall_789xyz...",
"amount": 95.0,
"currency": "USD",
"transaction_type": "deposit",
"payment_method": "card",
"status": "pending",
"total_amount_paid": 100.0,
"stripe_fee": 3.0,
"application_fee": 2.0,
"created_at": "2025-01-16T10:00:00Z"
}
{
"detail": "Invalid deposit amount"
}
{
"detail": "Missing or invalid API keys"
}
{
"detail": "Transaction failed: Wallet is disabled"
}
{
"detail": "Wallet not found"
}
{
"detail": "Rate limit exceeded. Please try again later."
}
curl --request POST \
--url https://hpay-api.host-sl.com/api/v1/transactions/wallet/card-deposit/create \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"wallet_id": "wall_789xyz...",
"amount": 100.00
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
deposit = client.deposits.card(
wallet_id="wall_789xyz...",
amount=100.00,
)
print(deposit["transaction_id"])
import { HostPay } from "@hostpay/sdk";
const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });
const deposit = await client.deposits.card({
walletId: "wall_789xyz...",
amount: 100.0,
});
console.log(deposit.transaction_id);
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/transactions/wallet/card-deposit/create",
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([
'wallet_id' => 'wall_789xyz...',
'amount' => 100
]),
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;
}