> ## 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 Buy

> Initiates a fund-and-buy transaction for an api client. This creates a payment (card or bank transfer) that funds the wallet and buys a token in a single flow.

<ParamField path="id" type="string" required>
  The token ID to buy
</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>

<ParamField body="customer" type="object" required>
  Object containing customer details (`name` and `email`).
</ParamField>

<ParamField body="meta" type="object">
  Object containing additional information like `orderId`.
</ParamField>

<RequestExample>
  ```json Card Payment theme={null}
  {
      "investmentAmount": 100000,
      "currency": "NGN",
      "redirectUrl": "https://google.com",
      "paymentMethod": "card",
      "customer": {
          "name": "Jude Dike",
          "email": "dikejude49@gmail.com"
      },
      "meta": {
          "orderId": "…"
      }
  }
  ```

  ```json Bank Transfer theme={null}
  {
      "investmentAmount": 100000,
      "currency": "NGN",
      "paymentMethod": "bank_transfer",
      "customer": {
          "name": "Jude Dike",
          "email": "dikejude49@gmail.com"
      },
      "meta": {
          "orderId": "…"
      }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Card Payment theme={null}
  {
      "status": "success",
      "message": "Payment initiated successfully. Complete payment to buy tokens.",
      "data": {
          "paymentLink": "https://checkout-v2.dev-flutterwave.com/v3/hosted/pay/926e0cc3e67ebbd9fb57",
          "reference": "GETXN_FI_WFMSVRKW2X6CUJ",
          "investmentAmount": 100000,
          "currency": "NGN",
          "token": {
              "_id": "683ef69f70457700022e091b",
              "symbol": "FDNE",
              "name": "FCMB Debt Note",
              "price": 10000
          },
          "tokensToCredit": 10,
          "creditAmount": 100500,
          "fees": {
              "getequity": 500,
              "getequityPercent": 0.5,
              "flutterwave": 1407,
              "total": 1907
          },
          "totalCharge": 101907
      }
  }
  ```

  ```json Bank Transfer theme={null}
  {
      "status": "success",
      "message": "Payment initiated successfully. Complete payment to buy tokens.",
      "data": {
          "paymentMethod": "bank_transfer",
          "reference": "GETXN_FI_GRKXXJ40NUH39P_PMCKDU_1",
          "email": "wilpat45677@yopmail.com",
          "virtualAccount": {
              "bankName": "Mock Bank",
              "accountNumber": "0067100155",
              "amount": "101907.00",
              "note": "Mock note",
              "expiresAt": "2026-07-21 11:56:16 PM"
          },
          "amountToPay": 101907,
          "investmentAmount": 100000,
          "currency": "NGN",
          "token": {
              "_id": "683ef69f70457700022e091b",
              "symbol": "FDNE",
              "name": "FCMB Debt Note",
              "price": 10000
          },
          "tokensToCredit": 10,
          "creditAmount": 100500,
          "fees": {
              "getequity": 500,
              "getequityPercent": 0.5,
              "flutterwave": 1407,
              "total": 1907
          },
          "totalCharge": 101907
      }
  }
  ```
</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                          |
