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

# Fund and withdraw Investors

> Move capital through the PAMM-controlled endpoints and reconcile the actual MT5 result.

## Deposit capital

`POST /api/v1/investor/deposit` is the only external capital entry point in the PAMM workflow. Send `login`, a positive `amount`, optional `currency`, and a CRM reference in `comment` as query parameters.

```bash theme={null}
curl -X POST \
  "https://pamm-api.example.com/api/v1/investor/deposit?login=146600&amount=1000&currency=USD&comment=CRM-DEP-8451" \
  -H "Authorization: Bearer YOUR_CRM_API_KEY"
```

Record `deal_id`, `amount`, and the CRM reference. The Investor credit is synchronous, while its operating reflection in the Master may be asynchronous.

## Withdraw capital

Every withdrawal must use `POST /api/v1/investor/withdraw`. The API crystallizes pending performance fees before determining the amount that can be withdrawn.

```bash theme={null}
curl -X POST \
  "https://pamm-api.example.com/api/v1/investor/withdraw?login=146600&amount=1000&currency=USD&comment=CRM-WD-1208" \
  -H "Authorization: Bearer YOUR_CRM_API_KEY"
```

Reconcile these fields from the response:

| Field                         | Meaning                                            |
| ----------------------------- | -------------------------------------------------- |
| `requested_amount`            | Amount requested by the CRM.                       |
| `effective_withdraw`          | Amount actually withdrawn after fee processing.    |
| `perf_fee_pending_at_request` | Pending fee observed before the withdrawal.        |
| `available_after_perf_fee`    | Capital remaining available after fee reservation. |
| `mt5_deal_id`                 | MT5 operation identifier used for reconciliation.  |

`effective_withdraw` can be lower than `requested_amount`, or zero when no balance remains after the pending fee.

<Warning>
  A direct MT5 withdrawal bypasses fee crystallization. The fee agent could later attempt collection and leave the Investor with debt or a negative balance.
</Warning>

Open Master positions can block the operation. If the HTTP result is uncertain, reconcile the balance and operation identifier before deciding whether to repeat the request.

<CardGroup cols={2}>
  <Card title="Previous: Investors" icon="arrow-left" href="/guides/investors">
    Return to account provisioning and readiness.
  </Card>

  <Card title="Next: Subscriptions" icon="arrow-right" href="/guides/subscriptions">
    Assign and unassign Investors safely.
  </Card>
</CardGroup>
