> ## Documentation Index
> Fetch the complete documentation index at: https://getequity.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fund and Invest

> Initiates a fund-and-invest transaction for a member. This creates a payment link that the member can use to fund their wallet and invest in a token in a single flow.

<ParamField path="id" type="string" required>
  The member's user ID
</ParamField>

<ParamField path="tokenId" type="string" required>
  The token ID to invest in
</ParamField>

<ParamField body="investmentAmount" type="number" required>
  The amount to invest
</ParamField>

<ParamField body="currency" type="string" required>
  The currency code (e.g., `NGN`, `USD`)
</ParamField>

<ParamField body="redirectUrl" type="string">
  URL to redirect after payment completion. Required when `paymentMethod` is `card`. Not needed for `bank_transfer`.
</ParamField>

<ParamField body="paymentMethod" type="string">
  Preferred payment method. Supported values: `card`, `bank_transfer`. When `bank_transfer` is used, virtual account details are returned instead of a payment link.
</ParamField>

<RequestExample>
  ```json Card Payment theme={null}
  {
      "investmentAmount": 100000,
      "currency": "NGN",
      "redirectUrl": "https://app.getequity.io/callback",
      "paymentMethod": "card"
  }
  ```

  ```json Bank Transfer theme={null}
  {
      "investmentAmount": 100000,
      "currency": "NGN",
      "paymentMethod": "bank_transfer"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Card Payment theme={null}
  {
      "status": "success",
      "message": "Payment initiated successfully. Complete payment to invest.",
      "data": {
          "paymentLink": "https://checkout-v2.dev-flutterwave.com/v3/hosted/pay/550b3feb5a259d265c29",
          "reference": "GETXN_FI_LW6PEBET78XW72",
          "investmentAmount": 100000,
          "currency": "NGN",
          "token": {
              "_id": "682b2f367732900002613bfc",
              "symbol": "OPAS2",
              "name": "Ojaja Pan African LTD Series 2 Commercial Paper",
              "price": 10000
          },
          "tokensToCredit": 10,
          "fees": {
              "getequity": 2000,
              "getequityPercent": 2,
              "flutterwave": 1428,
              "total": 3428
          },
          "totalCharge": 103428
      }
  }
  ```

  ```json Bank Transfer theme={null}
  {
      "status": "success",
      "message": "Payment initiated successfully. Complete payment to invest.",
      "data": {
          "paymentMethod": "bank_transfer",
          "reference": "GETXN_FI_SJ74KB44TGXUAB",
          "virtualAccount": {
              "bankName": "Wema Bank",
              "accountNumber": "TRP1420081"
          },
          "amountToPay": 103428,
          "investmentAmount": 100000,
          "currency": "NGN",
          "token": {
              "_id": "683ef69f70457700022e091b",
              "symbol": "FDNE",
              "name": "FCMB Debt Note",
              "price": 10000
          },
          "tokensToCredit": 10,
          "fees": {
              "getequity": 2000,
              "getequityPercent": 2,
              "flutterwave": 1428,
              "total": 3428
          },
          "totalCharge": 103428
      }
  }
  ```
</ResponseExample>

## Error Codes

| Code                         | HTTP Status | Description                              |
| ---------------------------- | ----------- | ---------------------------------------- |
| TOKEN\_ACCESS\_DENIED\_ERROR | 403         | User doesn't have access to this token   |
| DEAL\_ACCESS\_DENIED\_ERROR  | 403         | User doesn't have access to this deal    |
| TOKEN\_CLOSED\_ERROR         | 400         | Token is closed for investment           |
| TOKEN\_EXITED\_ERROR         | 400         | Token has exited                         |
| AMOUNT\_TOO\_LOW\_ERROR      | 400         | Investment amount is below minimum       |
| BELOW\_MIN\_TRADE\_ERROR     | 400         | Amount below minimum trade limit         |
| ABOVE\_MAX\_TRADE\_ERROR     | 400         | Amount above maximum trade limit         |
| INVALID\_AMOUNT\_ERROR       | 400         | Invalid investment amount                |
| PAYMENT\_INITIATION\_ERROR   | 502         | Failed to initiate payment with provider |
| TOKEN\_NOT\_FOUND\_ERROR     | 404         | Token not found                          |
