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

# Update Token Prices API

> Recompute fiat values for Breezing transactions with the automatic price update API, using historical market, custom, or on-chain token prices.



## OpenAPI

````yaml POST /transactions/update-price-auto
openapi: 3.1.0
info:
  title: Breezing Public API
  version: 1.0.0
  description: >-
    Crypto accounting API for programmatic access and AI agents. Authenticate
    with an API key using the Authorization header: `Bearer brz_...`
servers:
  - url: https://api.breezing.io/v1
security:
  - BearerAuth: []
paths:
  /transactions/update-price-auto:
    post:
      tags:
        - Transactions
      summary: Update token prices automatically
      description: >-
        Recompute fiat amounts for a set of transactions by fetching historical
        prices, the API equivalent of the dashboard "Update Token Price"
        automatic mode. The selected transactions (and the paired leg of any
        exchange trade) are flagged for repricing and a background job fetches
        the price for each token at each transaction date from the chosen
        source, then backfills amountFiat (and feeFiat where the fee token
        matches).


        This is asynchronous: the response returns a taskId. Poll GET /tasks to
        monitor progress, then GET /transactions to see the updated fiat
        amounts. NGL is not recalculated automatically; call POST /ngl/calculate
        when ready.


        Returns 404 if any transaction is not found, 409 if any is locked or
        processing, and 409 TASK_IN_PROGRESS if an automatic price update is
        already running for this company (concurrent runs share one pricing
        queue and could corrupt computed prices). Duplicate IDs are deduplicated
        server-side.
      parameters:
        - schema:
            type: string
            description: >-
              Organization ID. Use GET /v1/companies to discover available
              org/company pairs.
            example: '1'
          required: true
          description: >-
            Organization ID. Use GET /v1/companies to discover available
            org/company pairs.
          name: orgId
          in: query
        - schema:
            type: string
            description: >-
              Company ID. Use GET /v1/companies to discover available companies
              and their access levels.
            example: '1'
          required: true
          description: >-
            Company ID. Use GET /v1/companies to discover available companies
            and their access levels.
          name: companyId
          in: query
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePriceAutoBody'
      responses:
        '200':
          description: Pricing job queued
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - true
                  data:
                    type: object
                    properties:
                      taskId:
                        type: integer
                        nullable: true
                        description: >-
                          Task id for the background pricing job. Poll GET
                          /tasks to monitor progress. May be null on rare timing
                          edges; fall back to GET /tasks and look for a
                          "calculateFiatAmount" operation.
                      status:
                        type: string
                        enum:
                          - queued
                        description: The pricing job was queued.
                    required:
                      - taskId
                      - status
                required:
                  - success
                  - data
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '403':
          description: >-
            API key has no access to this company, has read-only access where
            write was required, or the company subscription is inactive
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '404':
          description: One or more transactions were not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '409':
          description: >-
            One or more transactions are locked or processing, or an automatic
            price update is already running for this company
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    enum:
                      - false
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - success
                  - error
      security:
        - BearerAuth: []
components:
  schemas:
    UpdatePriceAutoBody:
      type: object
      properties:
        ids:
          type: array
          items:
            type: integer
          minItems: 1
          maxItems: 500
          description: >-
            Transaction IDs to reprice (max 500). For any transaction that is
            part of an exchange trade, the engine also reprices its paired leg.
            Duplicate IDs are deduplicated server-side.
        source:
          type: string
          default: ''
          description: >-
            Price source. "custom" uses the custom prices saved in Breezing.
            "on-chain" uses on-chain vault/DEX pricing. Any other value, or
            omitting the field, uses the default market-price chain (CoinGecko,
            then CoinGecko DEX, then Bird Eye).
        currency:
          type: string
          description: >-
            3-letter fiat currency for the computed prices (e.g. "USD").
            Defaults to the company currency.
        walletId:
          type: integer
          minimum: 0
          exclusiveMinimum: true
          description: Optional wallet scope. Use GET /wallets to find IDs.
      required:
        - ids

````