curl --request POST \
--url https://hpay-api.host-sl.com/api/v1/transactions/wallet/mobile-money-deposit \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"wallet_id": "wall_789xyz...",
"amount": 1000
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
deposit = client.deposits.mobile_money(
wallet_id="wall_789xyz...",
amount=1000,
)
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.mobileMoney({
walletId: "wall_789xyz...",
amount: 1000,
});
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/mobile-money-deposit",
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' => 1000
]),
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;
}
{
"transaction_id": "trans_123abc...",
"payment_code": {
"status": "success",
"result": {
"id": "monime_code_123",
"code": "123456",
"amount": 1050,
"currency": "SLE",
"instructions": "Dial *123# and enter code 123456"
}
},
"transaction": {
"id": "trans_123abc...",
"wallet_id": "wall_789xyz...",
"amount": 1000,
"currency": "SLE",
"status": "pending",
"total_amount_paid": 10.5,
"monime_fee": 0.3,
"application_fee": 0.2
}
}
{
"detail": "Error creating payment code: Provider error message"
}
{
"detail": "Missing or invalid API keys"
}
{
"detail": "Transaction failed: Wallet is disabled"
}
{
"detail": "Wallet not found"
}
Transactions
Mobile Money Deposit
Initiate a wallet deposit using mobile money (Monime).
POST
/
api
/
v1
/
transactions
/
wallet
/
mobile-money-deposit
curl --request POST \
--url https://hpay-api.host-sl.com/api/v1/transactions/wallet/mobile-money-deposit \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"wallet_id": "wall_789xyz...",
"amount": 1000
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
deposit = client.deposits.mobile_money(
wallet_id="wall_789xyz...",
amount=1000,
)
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.mobileMoney({
walletId: "wall_789xyz...",
amount: 1000,
});
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/mobile-money-deposit",
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' => 1000
]),
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;
}
{
"transaction_id": "trans_123abc...",
"payment_code": {
"status": "success",
"result": {
"id": "monime_code_123",
"code": "123456",
"amount": 1050,
"currency": "SLE",
"instructions": "Dial *123# and enter code 123456"
}
},
"transaction": {
"id": "trans_123abc...",
"wallet_id": "wall_789xyz...",
"amount": 1000,
"currency": "SLE",
"status": "pending",
"total_amount_paid": 10.5,
"monime_fee": 0.3,
"application_fee": 0.2
}
}
{
"detail": "Error creating payment code: Provider error message"
}
{
"detail": "Missing or invalid API keys"
}
{
"detail": "Transaction failed: Wallet is disabled"
}
{
"detail": "Wallet not found"
}
This endpoint initiates a mobile money deposit to a user’s wallet via Monime. It generates a payment code that the user can use to complete the deposit through their mobile money provider (e.g., Orange Money, Africell Money).
Request Body
string
required
The unique identifier of the wallet to deposit funds into.
integer
required
The amount to deposit in SLE cents (e.g., 1000 for 10.00 SLE).
Response
string
The unique identifier for the transaction in HOST Pay.
object
The full response from the Monime service, including the generated payment code and instructions.
object
{
"transaction_id": "trans_123abc...",
"payment_code": {
"status": "success",
"result": {
"id": "monime_code_123",
"code": "123456",
"amount": 1050,
"currency": "SLE",
"instructions": "Dial *123# and enter code 123456"
}
},
"transaction": {
"id": "trans_123abc...",
"wallet_id": "wall_789xyz...",
"amount": 1000,
"currency": "SLE",
"status": "pending",
"total_amount_paid": 10.5,
"monime_fee": 0.3,
"application_fee": 0.2
}
}
{
"detail": "Error creating payment code: Provider error message"
}
{
"detail": "Missing or invalid API keys"
}
{
"detail": "Transaction failed: Wallet is disabled"
}
{
"detail": "Wallet not found"
}
curl --request POST \
--url https://hpay-api.host-sl.com/api/v1/transactions/wallet/mobile-money-deposit \
--header 'api-key: YOUR_API_KEY' \
--header 'secret-key: YOUR_SECRET_KEY' \
--header 'Content-Type: application/json' \
--data '{
"wallet_id": "wall_789xyz...",
"amount": 1000
}'
from hostpay import HostPay
client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")
deposit = client.deposits.mobile_money(
wallet_id="wall_789xyz...",
amount=1000,
)
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.mobileMoney({
walletId: "wall_789xyz...",
amount: 1000,
});
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/mobile-money-deposit",
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' => 1000
]),
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;
}