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

# Invest

> Create a new fixed-term Smart investment by locking funds for a specified period via the V4 API.

<Note>
  These endpoints are available only for B2B partner services. Fill the form at [https://whitebit.com/institutional-services/b2b](https://whitebit.com/institutional-services/b2b) to request access.
</Note>


## OpenAPI

````yaml /openapi/private/main_api_v4.yaml POST /api/v4/main-account/smart/investment
openapi: 3.0.3
info:
  title: WhiteBIT Private HTTP API V4
  description: |
    WhiteBIT Private HTTP API V4 for Main balance changes.

    Base URL: https://whitebit.com

    All endpoints return time in Unix-time format.
    All endpoints return either a JSON object or array.
    For receiving responses from API calls please use http method POST.
  version: 4.0.0
  contact:
    name: WhiteBIT Support
    email: support@whitebit.com
    url: https://whitebit.com
servers:
  - url: https://whitebit.com
    description: WhiteBIT Global Server
  - url: https://whitebit.eu
    description: WhiteBIT EU Server
security:
  - ApiKeyAuth: []
    PayloadAuth: []
    SignatureAuth: []
tags:
  - name: Main Account
    description: Main account balance and operations
  - name: Deposit
    description: Cryptocurrency and fiat deposit operations
  - name: Withdraw
    description: Cryptocurrency and fiat withdrawal operations
  - name: Transfer
    description: Balance transfer operations
  - name: Codes
    description: WhiteBIT codes operations
  - name: Crypto Lending - Fixed
    description: Fixed crypto lending plans
  - name: Crypto Lending - Flex
    description: Flexible crypto lending plans
  - name: Fees
    description: Fee information
  - name: Sub-Account
    description: Sub-account management
  - name: Sub-Account API Keys
    description: Sub-account API key management
  - name: Mining Pool
    description: Mining pool operations
  - name: Credit Line
    description: Credit line information
  - name: JWT
    description: JWT token management
paths:
  /api/v4/main-account/smart/investment:
    post:
      tags:
        - Crypto Lending - Fixed
      summary: Invest
      description: >
        The endpoint creates a new investment to the specified [invest
        plan](/glossary#crypto-lending).


        <Warning>

        Rate limit: 1000 requests/10 sec.

        </Warning>


        <Note>

        The API does not cache the response.

        </Note>
      operationId: createFixedInvestment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - planId
                - amount
                - request
                - nonce
              properties:
                planId:
                  type: string
                  description: '[Invest plan](/glossary#crypto-lending) identifier'
                  example: 8e667b4a-0b71-4988-8af5-9474dbfaeb51
                amount:
                  type: string
                  description: Investment amount
                  example: '100'
                request:
                  type: string
                  description: Request signature
                  example: '{{request}}'
                nonce:
                  type: integer
                  description: Unique request identifier
                  example: 1594297865000
            example:
              planId: 8e667b4a-0b71-4988-8af5-9474dbfaeb51
              amount: '100'
              request: '{{request}}'
              nonce: 1594297865000
      responses:
        '201':
          description: Investment created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Investment identifier
              example:
                id: 0d7b66ff-1909-4938-ab7a-d16d9a64dcd5
        '400':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidPlanOrAmount:
                  summary: Invalid planId or amount
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      planId:
                        - The selected planId is invalid.
                      amount:
                        - The amount field must be a valid number
                amountTooSmall:
                  summary: Amount below minimum
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      amount:
                        - The amount must be at least 0.000001.
                amountExceedsAvailable:
                  summary: Amount exceeds plan availability
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      amount:
                        - >-
                          The amount you are trying to invest is bigger than the
                          amount left in this SMART plan. Please try investing a
                          smaller amount.
                planDisabled:
                  summary: Plan is disabled
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      planId:
                        - Plan is disabled
                planInactive:
                  summary: Plan is inactive
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      planId:
                        - Plan is inactive
                noCoinsLeft:
                  summary: No coins left in plan
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      planId:
                        - There are no coins left in the plan
                planPaused:
                  summary: Plan is paused
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      planId:
                        - Plan is paused
                specialOffer:
                  summary: Special-offer plan not available via API
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      planId:
                        - Special offers are not available via API
                invalidDecimal:
                  summary: Decimal precision exceeded
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      amount:
                        - Invalid decimal amount
        '422':
          description: >
            Inner validation failed


            Response error codes:

            - 1 - Investment already exists (when you don't have permissions to
            create multiple investments by plan)

            - 2 - Amount is less than min investment amount

            - 3 - Amount is greater than max investment amount

            - 4 - Not enough balance to create investment

            - 5 - No funds in plan to cover target interest amount
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInner'
              examples:
                investmentExists:
                  summary: Investment already exists
                  value:
                    code: 1
                    message: Inner validation failed
                    errors:
                      amount:
                        - The investment in this investment plan already exists
                amountTooLow:
                  summary: Amount below plan minimum
                  value:
                    code: 2
                    message: Inner validation failed
                    errors:
                      amount:
                        - Amount is less than min investment
                amountTooHigh:
                  summary: Amount exceeds plan maximum
                  value:
                    code: 3
                    message: Inner validation failed
                    errors:
                      amount:
                        - Amount is more than max investment
                insufficientBalance:
                  summary: Insufficient balance
                  value:
                    code: 4
                    message: Inner validation failed
                    errors:
                      amount:
                        - Available 9 < 10
                insufficientFunds:
                  summary: Insufficient funds for interest payment
                  value:
                    code: 5
                    message: Inner validation failed
                    errors:
                      amount:
                        - Not enough money to pay interest
components:
  schemas:
    Error:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
    ErrorInner:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-TXC-APIKEY
      description: The public WhiteBIT API key.
    PayloadAuth:
      type: apiKey
      in: header
      name: X-TXC-PAYLOAD
      description: Base64-encoded JSON request body.
    SignatureAuth:
      type: apiKey
      in: header
      name: X-TXC-SIGNATURE
      description: >-
        HMAC-SHA512 signature of the payload, hex-encoded. Computed as
        hex(HMAC-SHA512(payload, api_secret)).

````