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

# Adjust balance for trading accounts

> Adjust account balances in bulk. Supports add, subtract, and set operations for one or multiple accounts.



## OpenAPI

````yaml /openapi.json patch /api/accounts/balance/
openapi: 3.0.3
info:
  title: TBBO API
  version: 1.0.0
  description: >
    Authentication uses short-lived session tokens (3 hours).


    Send the token with every request using the `Authorization` header:


    ```

    Authorization: Token <token>

    ```


    Example:


    ```

    Authorization: Token 123abc456def789

    ```


    To obtain a token, call `POST /auth/login/` with valid credentials. The
    response includes a `key` value. Use that value in the header above for
    subsequent API calls.


    How to find required IDs:


    - `challenge_id`: Prop Tech Configuration -> Challenges

    - `user_id`: Tickblaze Manager -> Users

    - `account_id`: Tickblaze Manager -> Accounts 
servers: []
security: []
tags:
  - name: withdrawals
    description: Withdrawal related endpoints
    x-displayName: Withdrawals
paths:
  /api/accounts/balance/:
    patch:
      tags:
        - Accounts
      summary: Adjust balance for trading accounts
      description: >-
        Adjust account balances in bulk. Supports add, subtract, and set
        operations for one or multiple accounts.
      operationId: api_accounts_balance_partial_update
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedAccountAdjustBalanceRequest'
            examples:
              AddBalance(Bulk):
                value:
                  account_ids:
                    - 1001
                    - 1002
                    - 1003
                  operation: add
                  amount: 5000
                summary: Add funds to multiple accounts
                description: >-
                  Adds the specified amount to the balance of each account.
                  Useful for profit sharing, bonuses, or balance corrections.
              SubtractBalance(Bulk):
                value:
                  account_ids:
                    - 1001
                    - 1002
                  operation: subtract
                  amount: 1500
                summary: Subtract funds from multiple accounts
                description: >-
                  Subtracts the specified amount from each account balance. Used
                  for fees, penalties, or balance corrections. Accounts cannot
                  end with a negative balance.
              SetBalance(Bulk):
                value:
                  account_ids:
                    - 1001
                    - 1002
                    - 1003
                  operation: set
                  amount: 25000
                summary: Set balance for multiple accounts
                description: >-
                  Sets the balance of all provided accounts to the exact same
                  value. Use this operation to set each provided account to the
                  same balance.
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedAccountAdjustBalanceRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedAccountAdjustBalanceRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OperationResponse'
              examples:
                SuccessResponse-Add:
                  value:
                    success: true
                    message: Account balances adjusted.
                    results:
                      - account_id: 1001
                        operation: add
                        amount: 5000
                        previous_balance: 50000
                        new_balance: 55000
                      - account_id: 1002
                        operation: add
                        amount: 5000
                        previous_balance: 30000
                        new_balance: 35000
                    summary:
                      updated: 2
                    duration_ms: 62
                  summary: Successful bulk balance addition
                  description: >-
                    Response when balances are successfully increased for
                    multiple accounts.
                SuccessResponse-Subtract:
                  value:
                    success: true
                    message: Account balances adjusted.
                    results:
                      - account_id: 1001
                        operation: subtract
                        amount: 5000
                        previous_balance: 50000
                        new_balance: 45000
                      - account_id: 1002
                        operation: subtract
                        amount: 5000
                        previous_balance: 30000
                        new_balance: 25000
                    summary:
                      updated: 2
                    duration_ms: 62
                  summary: Successful bulk balance subtraction
                  description: >-
                    Response when balances are successfully decreased for
                    multiple accounts.
                SuccessResponse-Set:
                  value:
                    success: true
                    message: Account balances adjusted.
                    results:
                      - account_id: 1001
                        operation: set
                        amount: 25000
                        previous_balance: 55000
                        new_balance: 25000
                      - account_id: 1002
                        operation: set
                        amount: 25000
                        previous_balance: 35000
                        new_balance: 25000
                    summary:
                      updated: 2
                    duration_ms: 55
                  summary: Successful bulk balance set
                  description: >-
                    Response when balances are set to a fixed value for multiple
                    accounts.
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    PatchedAccountAdjustBalanceRequest:
      type: object
      properties:
        account_ids:
          type: array
          items:
            type: integer
        operation:
          $ref: '#/components/schemas/OperationEnum'
        amount:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,2})?$
    OperationResponse:
      type: object
      description: >-
        Standard serializer for operation responses. A command or a task should
        return a response matching this format.

        Operation = a request to perform some action, e.g. sync, update, delete,
        create, etc.
      properties:
        success:
          type: boolean
          description: Indicates whether the operation completed successfully.
        results:
          type: array
          items: {}
          description: >-
            List containing the result items produced by the operation. The
            structure of each item depends on the executed operation.
        summary:
          type: object
          additionalProperties: {}
          description: >-
            Aggregated summary information about the operation results (e.g.
            counts of updated, created, failed or unchanged records).
        duration_ms:
          type: number
          format: double
          description: Execution time of the operation in milliseconds.
        message:
          type: string
          nullable: true
          description: Optional human-readable message describing the operation outcome.
      required:
        - duration_ms
        - results
        - success
        - summary
    OperationEnum:
      enum:
        - add
        - subtract
        - set
      type: string
      description: |-
        * `add` - Add
        * `subtract` - Subtract
        * `set` - Set
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````

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