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

# End-to-end workflow

> Implement the recommended PAMM lifecycle for newly provisioned MT5 accounts.

Use this sequence for new accounts. Each financial step should have a unique CRM reference and a durable record before the request is sent.

## 1. Create the Master

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://pamm-api.example.com/api/v1/master/create" \
  -H "Authorization: Bearer YOUR_CRM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Laura",
    "last_name": "Gomez",
    "name": "Momentum Weekly",
    "username": "laura.gomez@example.com",
    "platform_group": "<MT5_MASTER_GROUP>",
    "leverage": "100",
    "min_deposit": "500",
    "default_perf_fee": "0.30",
    "strategy_name": "Momentum",
    "strategy": "Trend-following strategy"
  }'
```

Persist `id`, `mt5_login`, and `payment_account_login` as different identifiers. Do not fund the Master trading account directly.

`default_perf_fee="0.30"` configures a 30% default for later Investor assignments. Always send it explicitly; an omitted field can become zero on legacy deployments. See [every creation field](https://pamm-api.exuratech.com/reference/masters.md#create-a-new-master).

## 2. Create the Investor

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://pamm-api.example.com/api/v1/investor/create" \
  -H "Authorization: Bearer YOUR_CRM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "Carlos",
    "last_name": "Perez",
    "name": "Investor Demo",
    "username": "carlos.perez@example.com",
    "platform_group": "<MT5_INVESTOR_GROUP>",
    "leverage": "100"
  }'
```

The account starts without a balance and without a Master assignment.

## 3. Credit initial capital

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
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"
```

Store the returned `deal_id`. Deposit before assignment because assignment validates the Investor balance against the Master's `min_deposit`.

## 4. Assign the Investor

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl -X POST "https://pamm-api.example.com/api/v1/investor/assign" \
  -H "Authorization: Bearer YOUR_CRM_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "master_login": "146512",
    "investor_login": "146600",
    "perf_fee": {
      "rate": 0.30,
      "enabled": true
    }
  }'
```

`0.30` means 30%. An `ACTIVE` response confirms the relationship, but the initial balance reflection can still be processing.

Omitting `perf_fee`, sending null, or submitting `perf_fee.rate=0` inherits the Master's default; none alone makes the Investor fee-free. To disable collection at assignment, send `{"rate": 0, "enabled": false}`. Read [the assignment rules and deployment compatibility](https://pamm-api.exuratech.com/reference/subscriptions.md#assign-an-investor) and verify with `GET /api/v1/investor/146600/performance-fee`.

## 5. Confirm the operating state

Poll the subscription and relevant balances until the expected state is visible:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
curl "https://pamm-api.example.com/api/v1/info/subscriptions?investor_login=146600" \
  -H "Authorization: Bearer YOUR_CRM_API_KEY"
```

## 6. Operate and reconcile

* Send later credits through `/investor/deposit`.
* Send every Investor withdrawal through `/investor/withdraw`.
* End the relationship through `/subscriptions/unassign` and wait for `CANCELLED`.
* Reconcile fee credits and Investor-level payments through both performance fee listing endpoints.

> [card] [Previous: Authentication](https://pamm-api.exuratech.com/getting-started/authentication.md)
>
> Review access and secret handling.

> [card] [Next: Masters](https://pamm-api.exuratech.com/guides/masters.md)
>
> Choose between provisioning and migration registration.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.