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

# Commit Lending Action

> Resolves a lending or settle action and applies its balance changes once the transaction is confirmed on-chain. Must be called after **every** [`/borrow/initiate`](/api-reference/lending/initiate) and [`/borrow/settle`](/api-reference/lending/settle) - success, failure, or expiry. Requires no signature, only the API key.

Not interchangeable with [`POST /commit`](/api-reference/commit), which resolves deposits, trades, and withdrawals. See [Commit Status](/guide/handling#commit-status).



## OpenAPI

````yaml POST /borrow/commit
openapi: 3.0.1
info:
  title: Vanish Core API
  description: API endpoints for the Vanish Core service.
  license:
    name: MIT
  version: 2.0.0
servers:
  - url: https://core-api-dev.vanish.trade
security:
  - ApiKeyAuth: []
paths:
  /borrow/commit:
    post:
      summary: Commit Lending Action
      description: >-
        Resolves a lending or settle action and applies its balance changes once
        the transaction is confirmed on-chain. Must be called after **every**
        [`/borrow/initiate`](/api-reference/lending/initiate) and
        [`/borrow/settle`](/api-reference/lending/settle) - success, failure, or
        expiry. Requires no signature, only the API key.


        Not interchangeable with [`POST /commit`](/api-reference/commit), which
        resolves deposits, trades, and withdrawals. See [Commit
        Status](/guide/handling#commit-status).
      requestBody:
        description: Details of the lending commit request.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BorrowCommitRequest'
        required: true
      responses:
        '200':
          description: Successful lending commit response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BorrowCommitResponse'
        '400':
          description: >-
            Bad request. The transaction signature format is invalid, no lending
            action exists for this `tx_id`, or a two-transaction Jito bundle is
            still inside its grace window - in the last case, commit the action
            again after a short delay.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BorrowError'
        '401':
          description: >-
            Unauthorized. The request is missing a valid API key or the
            signature is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BorrowError'
        '429':
          description: >-
            Rate limit exceeded. Contact the Vanish team to raise your team's
            requests-per-second cap.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BorrowError'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BorrowError'
components:
  schemas:
    BorrowCommitRequest:
      required:
        - tx_id
      type: object
      properties:
        tx_id:
          description: >-
            The transaction signature returned by /borrow/initiate or
            /borrow/settle
          type: string
    BorrowCommitResponse:
      required:
        - status
        - action_type
        - already_processed
        - vanish_fee
        - tx_fee
      type: object
      properties:
        status:
          description: >-
            The result of the commit operation to determine the state of the
            action and balance.

            A lending action is only reflected in the user's balance once the
            status is completed.
          enum:
            - pending
            - completed
            - failed
            - expired
          type: string
        action_type:
          description: >-
            The type of action that was committed. Indicates whether the
            operation was a borrow (opening a position) or a settle.
          enum:
            - borrow
            - settle
          type: string
        already_processed:
          description: >-
            Indicates whether the action had already reached a terminal status
            before this commit attempt.
          type: boolean
        balance_changes:
          type: array
          items:
            $ref: '#/components/schemas/BalanceChange'
          description: >-
            A list of net per-token balance changes that resulted from the
            committed action. Null while the action is still pending.
          nullable: true
        vanish_fee:
          description: >-
            The fee amount charged by Vanish, expressed in lamports. Currently
            always 0 for lending actions.
          type: integer
          format: int64
        tx_fee:
          description: The transaction fee amount, expressed in lamports.
          type: integer
          format: int64
        completed_at:
          description: >-
            Timestamp (ISO 8601 format) indicating when the action reached a
            terminal state; null while it is still pending.
          type: string
          nullable: true
    BorrowError:
      required:
        - error
      type: object
      properties:
        error:
          description: >-
            The error code or short description. Endpoint errors use the HTTP
            status text (for example '400 Bad Request'); errors raised by the
            API key middleware and the rate limiter carry the description here
            instead.
          type: string
        message:
          description: >-
            The specific reason for the failure. Null on a signature
            verification failure, and absent entirely on API key and rate limit
            errors - check for the presence of this field rather than assuming
            every error body has the same shape.
          type: string
          nullable: true
    BalanceChange:
      required:
        - token_address
        - change
      type: object
      properties:
        token_address:
          description: The token address
          type: string
        change:
          description: >-
            Amount of balance change in the smallest unit (e.g., lamports for
            SOL).
          type: string
          format: int64
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````