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

# mintToken

> Issue tokens directly to investors, optionally whitelisting them in the same call.

Prepares unsigned transactions for minting tokens to specified users. Use `POST /prepare-transactions` with `method=mintToken`.

Minting increases the token's current `totalSupply` and the recipient's balance. It does not change the configured maximum supply.

## Recipient Requirements

* Every entry in `userToMint` needs a valid `investorEmail` and a positive whole-token `amount`.
* `investorEmail` must be different from the token's `tokenizerEmail`. Issuer and investor are separate email identities, even when they use the same wallet for sandbox testing. A collision returns `investorEmail cannot be the tokenizer email (index N)`, where `N` is the position in `userToMint`.
* Use the exact symbol from a successfully confirmed `newTokenization`. A symbol that does not resolve on the supplied chain returns `No company found with this token symbol`.
* `needWhitelist` only determines whether the recipient is whitelisted with the mint. It does not change the identity requirement. It defaults to `true` unless explicitly set to `false`.
* `needKyc` on a `userToMint` entry works the same way it does on [`whitelist`](https://docs.brickken.com/api-reference/endpoint/prepare-whitelist), and `false` is accepted in Sandbox only.

> [!TIP]
>
> **Testing in Sandbox?** Pass `needKyc: false` and skip identity verification entirely. The KYC flow
> is a Sumsub verification with document upload, not something you need to prove your integration
> works, and every test investor you create without it is one less manual step in your loop.
>
> Rehearse the real KYC flow once before you go live, since `needKyc: false` is rejected in
> production with `needKyc=false is only available in the sandbox environment`.

> [!NOTE]
>
> This method is an issuance-to-investors flow. It cannot mint to the tokenizer's own identity, so
> there is no supported payload for minting into a company treasury.

## Response shape

`transactions` is an array, as it is for every other prepare method. Iterate it rather than assuming
a single entry: when a recipient still needs whitelisting, the response carries **two** transactions.

When no recipient needs whitelisting:

```json theme={null}
{
  "transactions": [ { "…unsigned mint transaction…" } ],
  "info": { "…" },
  "txId": "0x…"
}
```

When at least one recipient still needs whitelisting, the whitelist transaction comes first and
`txId` carries the matching identifiers in the same order:

```json theme={null}
{
  "transactions": [
    { "…unsigned whitelist transaction…" },
    { "…unsigned mint transaction…" }
  ],
  "info": { "…" },
  "txId": ["0x…", "0x…"]
}
```

> [!WARNING]
>
> Sign and send **all of them, in order**, and wait for each to succeed before the next. The
> transactions carry sequential nonces, so broadcasting only the mint leaves it on a nonce that will
> never be used: it never mines, and the tokens never exist. A later `burnToken` or balance read then
> correctly reports no balance, which looks like an indexing lag but is not one.

## Credits

Two independent counters can block a mint:

* **API-key mint credits**, consumed once per mint operation at send time. Exhausting them returns `Out of credits for minting`.
* **License mint-recipient credits**, counted per distinct recipient. Exhausting them returns `Mint credit limit exceeded`.

A recipient email that has never been invited also consumes an **invitation credit**; exhausting those returns `Invitation credit limit exceeded`. When more than one counter is exhausted the message lists them, for example `Insufficient license credits: mint, invitation`.

None of these have a public reset endpoint. Contact [support@brickken.com](mailto:support@brickken.com) to review an account's balances.

> [!NOTE]
>
> The first mint to a new recipient sends both a new-shareholder invitation and a token-received
> notification. Later mints to the same recipient send only the token-received notification.

## Next step

Preparing does not touch the chain. The response gives you `txId` and an array of unsigned `transactions` — you still have to sign and submit them.

**1. Sign every returned transaction**

Sign each entry locally with the wallet that sends the transaction — `signerAddress`, or `investorAddress` for `newInvest` and `claimTokens`. It must be whitelisted by Brickken, and it needs native gas on the target chain.

**2. Submit the signed payloads**

`POST` them to [`/send-transactions`](https://docs.brickken.com/api-reference/endpoint/send) as `{ txId, signedTransactions }` and Brickken broadcasts for you.

If you would rather broadcast yourself, prepare with `executionMode: "client-broadcast"` and confirm afterwards with `{ txId, txHash }` instead.

**3. Poll until it confirms**

Call [`GET /get-transaction-status`](https://docs.brickken.com/api-reference/endpoint/get-transaction-status) with the `txId`. A `pending` status means it is broadcast but not yet mined — do not resubmit.

Full walkthrough: [Tokenize an asset and run an STO](https://docs.brickken.com/api-reference/guides/tokenize-and-run-an-sto.md).


## OpenAPI

````yaml api-reference/prepare/mintToken.json POST /prepare-transactions
openapi: 3.1.0
info:
  title: Brickken API V2 - prepare mintToken
  description: >-
    Method-scoped view of `POST /prepare-transactions` for `method=mintToken`.
    The full endpoint, with every supported method and the common request body
    parameters, is documented in `api-reference/openapi.json`.
  version: 2.0.0
servers:
  - url: https://api.sandbox.brickken.com
    description: Sandbox Environment
  - url: https://api.brickken.com
    description: Production Environment
security: []
paths:
  /prepare-transactions:
    post:
      summary: Prepare a token mint
      description: >-
        Prepares the unsigned transactions that mint tokens to one or more
        investors.
      operationId: prepare_mintToken
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - method
                - chainId
                - signerAddress
                - tokenSymbol
                - userToMint
              properties:
                method:
                  type: string
                  example: mintToken
                  enum:
                    - mintToken
                  description: >-
                    Required. Operation to prepare. Must be `mintToken` for this
                    endpoint.
                  default: mintToken
                chainId:
                  type: string
                  description: >-
                    Required. Blockchain network identifier. Hex format is
                    recommended, for example Sepolia `aa36a7`.
                  example: aa36a7
                signerAddress:
                  type: string
                  description: >-
                    Required. Tokenizer wallet that signs the mint transaction,
                    and the whitelist transaction when recipients still need
                    whitelisting.
                  example: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                tokenSymbol:
                  type: string
                  description: >-
                    Required. Symbol of the token to mint. Its `chainId` must
                    match the one in this request.
                  example: EXMPL
                userToMint:
                  type: array
                  minItems: 1
                  description: Required. Users to mint tokens to.
                  items:
                    type: object
                    required:
                      - investorEmail
                      - amount
                    properties:
                      investorEmail:
                        type: string
                        description: >-
                          Required. Recipient investor email. It must differ
                          from the token's tokenizerEmail.
                        example: investor@example.com
                        format: email
                      amount:
                        type: string
                        description: Required. Positive whole-token amount to mint.
                        example: '100'
                      investorAddress:
                        type: string
                        description: >-
                          Optional. Recipient wallet address. If omitted, the
                          API attempts to create or resolve a DFNS wallet.
                        example: '0x1111111111111111111111111111111111111111'
                        pattern: ^0x[a-fA-F0-9]{40}$
                      needWhitelist:
                        type: boolean
                        description: >-
                          Optional. Whether the recipient should be whitelisted
                          before minting. Defaults to true unless explicitly
                          false.
                        example: true
                      name:
                        type: string
                        description: >-
                          Optional. Investor first name used when creating a new
                          investor record.
                        example: John
                      surname:
                        type: string
                        description: >-
                          Optional. Investor surname used when creating a new
                          investor record.
                        example: Doe
                  example:
                    - investorEmail: investor@example.com
                      investorAddress: '0x1111111111111111111111111111111111111111'
                      amount: '100'
                      needWhitelist: true
              example:
                method: mintToken
                chainId: aa36a7
                signerAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
                tokenSymbol: EXMPL
                userToMint:
                  - investorEmail: investor@example.com
                    investorAddress: '0x1111111111111111111111111111111111111111'
                    amount: '100'
                    needWhitelist: true
            example:
              method: mintToken
              chainId: aa36a7
              signerAddress: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e'
              tokenSymbol: EXMPL
              userToMint:
                - investorEmail: investor@example.com
                  investorAddress: '0x1111111111111111111111111111111111111111'
                  amount: '100'
                  needWhitelist: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  transactions:
                    type: array
                    description: >-
                      Unsigned transactions ready for signing, in the order they
                      must be broadcast. Contains two entries when a recipient
                      still needs whitelisting: the whitelist transaction first,
                      then the mint.
                    items:
                      type: object
                      properties:
                        from:
                          type: string
                          description: Sender address
                          example: '0x1234567890abcdef1234567890abcdef12345678'
                        to:
                          type: string
                          description: Recipient address
                          example: '0xabcdef1234567890abcdef1234567890abcdef12'
                        value:
                          type: string
                          description: Transaction value in hex
                          example: '0x00'
                        nonce:
                          type: integer
                          description: Transaction nonce
                          example: 3792
                        chainId:
                          type: integer
                          description: Blockchain network chain ID
                          example: 11155111
                        data:
                          type: string
                          description: Transaction data payload
                          example: >-
                            0xd362e8a70000000000000000000000000000000000000000000000000000000000000040...
                        type:
                          type: integer
                          description: Transaction type (EIP-1559)
                          example: 2
                        maxPriorityFeePerGas:
                          type: string
                          description: Maximum priority fee per gas
                          example: '1150000'
                        maxFeePerGas:
                          type: string
                          description: Maximum fee per gas
                          example: '1156037'
                        gasLimit:
                          type: string
                          description: Gas limit in hex
                          example: '0xccef'
                  info:
                    type: object
                    description: Metadata about the operation
                    properties:
                      tokenizerEmail:
                        type: string
                        description: Email of the tokenizer
                        example: tokenizer@example.com
                      tokenSymbol:
                        type: string
                        description: Symbol of the token
                        example: EXMPL
                      investorEmail:
                        type: string
                        description: Email of the investor (when applicable)
                        example: investor@example.com
                  txId:
                    description: >-
                      Identifier for this prepared transaction, required by
                      /send-transactions. When `transactions` holds more than
                      one entry this is an array of identifiers in the same
                      order. This is NOT a blockchain transaction hash.
                    oneOf:
                      - type: string
                      - type: array
                        items:
                          type: string
                    example: >-
                      0x46adea7bdf49c576a760102e0d6bc9ecd650b3998588cd3d7f576a7973426aad
                required:
                  - transactions
                  - txId
      security:
        - apiKeyAuth: []
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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