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

**id** `string` *required*

The token ID to buy

**investmentAmount** `number` *required*

The amount to invest

**currency** `string` *required*

The currency code (e.g., `NGN`, `USD`)

**redirectUrl** `string`

URL to redirect after payment completion. Required when `paymentMethod` is `card`. Not needed for `bank_transfer`.

**paymentMethod** `string`

Preferred payment method. Supported values: `card`, `bank_transfer`. When `bank_transfer` is used, virtual account details are returned instead of a payment link.

**customer** `object` *required*

Object containing customer details (`name` and `email`).

**meta** `object`

Object containing additional information like `orderId`.

```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": "…"
    }
}
```

```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
    }
}
```

## After the payment

The payer comes back to your `redirectUrl` with the outcome appended as query parameters:

```
?status=successful&tx_ref=GETXN_FI_WFMSVRKW2X6CUJ&transaction_id=10459445
?status=cancelled&tx_ref=GETXN_FI_KGBW0Y3O2W2GNN
```

That `status` travels through the browser, so treat it as a hint. Take the `tx_ref` and call
[`GET api/transactions/{reference}`](https://getequity.io/docs/api-reference/endpoint/Transactions/get-transaction) for the
real outcome, and to know whether the wallet has been credited yet.

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


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