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

# Close investment

> The endpoint closes active investment.

Early closure is allowed — the request either succeeds or returns one of the documented errors.

<Note>
With a sub-account's API key (`type: 2`), the Crypto Lending endpoints operate on that sub-account's own Main balance. Lending is not enabled on sub-accounts by default and is enabled per sub-account on request; see [YaaS integration](/guides/yaas-integration#prerequisites).
</Note>

<Warning>
Rate limit: 1000 requests/10 sec.
</Warning>

<Note>
The API does not cache the response.
</Note>


POST

Copy URL

Copy URL

> [!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.


## OpenAPI

````yaml openapi/private/main_api_v4.yaml POST /api/v4/main-account/smart/investment/close
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
  - url: https://whitebit.tr
    description: WhiteBIT TR Server
  - url: https://whitebit.ge
    description: WhiteBIT GE Server
security:
  - ApiKeyAuth: []
    PayloadAuth: []
    SignatureAuth: []
tags:
  - name: Main Account
    description: Main balance and related 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
  - name: Travel Rule
    description: Travel Rule compliance endpoints for deposits and withdrawals
paths:
  /api/v4/main-account/smart/investment/close:
    post:
      tags:
        - Crypto Lending - Fixed
      summary: Close investment
      description: >
        The endpoint closes active investment.


        Early closure is allowed — the request either succeeds or returns one of
        the documented errors.


        <Note>

        With a sub-account's API key (`type: 2`), the Crypto Lending endpoints
        operate on that sub-account's own Main balance. Lending is not enabled
        on sub-accounts by default and is enabled per sub-account on request;
        see [YaaS integration](/guides/yaas-integration#prerequisites).

        </Note>


        <Warning>

        Rate limit: 1000 requests/10 sec.

        </Warning>


        <Note>

        The API does not cache the response.

        </Note>
      operationId: closeFixedInvestment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - id
                - request
                - nonce
              properties:
                id:
                  type: string
                  description: Investment identifier
                  example: 0d7b66ff-1909-4938-ab7a-d16d9a64dcd5
                request:
                  type: string
                  description: Request signature
                  example: '{{request}}'
                nonce:
                  type: integer
                  description: Unique request identifier
                  example: 1594297865000
            example:
              id: 0d7b66ff-1909-4938-ab7a-d16d9a64dcd5
              request: '{{request}}'
              nonce: 1594297865000
      responses:
        '200':
          description: Investment closed successfully
          content:
            application/json:
              schema:
                type: object
              example: {}
        '400':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                investmentNotFound:
                  summary: Investment not found
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      id:
                        - Investment not found
                idRequired:
                  summary: Missing or invalid id
                  value:
                    code: 0
                    message: Validation failed
                    errors:
                      id:
                        - The id field is required.
        '403':
          description: >-
            Lending API access is not enabled on the account. Request access via
            the institutional services form
            (https://whitebit.com/institutional-services/b2b).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                code: 0
                message: >-
                  You don't have permission to use this endpoint. Please contact
                  support for more details
        '422':
          description: Inner validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                alreadyClosed:
                  summary: Investment already closed
                  value:
                    code: 0
                    message: Inner validation failed
                    errors:
                      error:
                        - Investment is already closed
components:
  schemas:
    Error:
      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)).

````

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