> ## Documentation Index
> Fetch the complete documentation index at: https://doc.hpay.host-sl.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Mobile Money Cashout

> Withdraw funds from a wallet to a mobile money account (Monime).

This endpoint allows users to withdraw funds from their wallet directly to a mobile money account (Orange Money or Africell Money) in Sierra Leone.

### Request Body

<ParamField body="wallet_id" type="string" required>
  The unique identifier of the wallet to withdraw funds from.
</ParamField>

<ParamField body="amount" type="number" required>
  The amount to withdraw in **SLE** (e.g., 50.50 for 50.50 SLE).
</ParamField>

<ParamField body="phone_number" type="string" required>
  The recipient's mobile money phone number in E.164 format (e.g., `+23278XXXXXX`).
</ParamField>

<ParamField body="provider" type="string">
  The mobile money provider code:

  * `m17`: Orange Money (default)
  * `m18`: Africell Money
</ParamField>

<ParamField body="currency" type="string">
  The currency code. Currently, only **"SLE"** is supported for mobile money cashouts.
</ParamField>

### Response

<ResponseField name="id" type="string">
  The unique identifier for the transaction.
</ResponseField>

<ResponseField name="wallet_id" type="string">
  The ID of the wallet the funds were withdrawn from.
</ResponseField>

<ResponseField name="amount" type="number">
  The net amount being sent to the mobile money account.
</ResponseField>

<ResponseField name="currency" type="string">
  The currency code ("SLE").
</ResponseField>

<ResponseField name="status" type="string">
  The current status of the transaction (e.g., "pending", "completed", "failed").
</ResponseField>

<ResponseField name="monime_fee" type="number">
  The fee charged by Monime for the cashout.
</ResponseField>

<ResponseField name="application_fee" type="number">
  The platform fee collected for this withdrawal.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "trans_123abc...",
    "wallet_id": "wall_789xyz...",
    "amount": 50.0,
    "currency": "SLE",
    "transaction_type": "withdrawal",
    "payment_method": "mobile_money",
    "status": "pending",
    "monime_fee": 1.5,
    "application_fee": 1.0,
    "description": "Wallet withdrawal to +23278XXXXXX",
    "created_at": "2025-01-16T10:10:00Z"
  }
  ```

  ```json 400 theme={null}
  {
    "detail": "Insufficient funds for withdrawal and fees"
  }
  ```

  ```json 401 theme={null}
  {
    "detail": "Missing or invalid API keys"
  }
  ```

  ```json 403 theme={null}
  {
    "detail": "Transaction failed: Wallet is disabled"
  }
  ```

  ```json 404 theme={null}
  {
    "detail": "Wallet not found"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://hpay-api.host-sl.com/api/v1/transactions/wallet/mobile-money-cashout/ \
    --header 'api-key: YOUR_API_KEY' \
    --header 'secret-key: YOUR_SECRET_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "wallet_id": "wall_789xyz...",
      "amount": 50.00,
      "phone_number": "+23278XXXXXX",
      "provider": "m17"
    }'
  ```

  ```python Python theme={null}
  from hostpay import HostPay

  client = HostPay(api_key="YOUR_API_KEY", secret_key="YOUR_SECRET_KEY")

  payout = client.payouts.mobile_money(
      wallet_id="wall_789xyz...",
      amount=50.00,
      phone_number="+23278XXXXXX",
      provider="m17",  # m17 = Orange Money, m18 = Africell Money
  )
  print(payout["id"], payout["status"])
  ```

  ```typescript TypeScript theme={null}
  import { HostPay } from "@hostpay/sdk";

  const client = new HostPay({ apiKey: "YOUR_API_KEY", secretKey: "YOUR_SECRET_KEY" });

  const payout = await client.payouts.mobileMoney({
    walletId: "wall_789xyz...",
    amount: 50.0,
    phoneNumber: "+23278XXXXXX",
    provider: "m17", // m17 = Orange Money, m18 = Africell Money
  });
  console.log(payout.id, payout.status);
  ```

  ```php PHP theme={null}
  <?php

  $curl = curl_init();

  curl_setopt_array($curl, [
    CURLOPT_URL => "https://hpay-api.host-sl.com/api/v1/transactions/wallet/mobile-money-cashout/",
    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' => 50,
      'phone_number' => '+23278XXXXXX',
      'provider' => 'm17'
    ]),
    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;
  }
  ```
</RequestExample>
