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

# Update a usage entry

> Updates an existing usage entry by its unique `transaction_id`. You can update the `value` and/or `properties` fields. At least one field must be provided to update. Returns a 404 error if the transaction_id is not found.



## OpenAPI

````yaml https://api.salesbricks.com/api/v2/openapi.yaml patch /usage/
openapi: 3.0.3
info:
  title: Salesbricks REST API
  version: 2.0.0
  description: API reference for external integrations
servers:
  - url: https://api.salesbricks.com/api/v2
    description: Production
  - url: https://api.staging.salesbricks.com/api/v2
    description: Staging
security:
  - ApiKeyAuth: []
tags:
  - name: Subscriptions
    description: >-
      Operations related to subscription management, including creation,
      updates, and retrieving subscription details. Subscriptions can be
      upgraded to add / remove add-ons by using the POST
      /subscriptions/{subscription_id}/upgrade endpoint and can be recasted for
      replacing the current agreement using the POST
      /subscriptions/{subscription_id}/recast endpoint
  - name: Customers
    description: >-
      Operations related to customer management, including creation, updates,
      and managing customer person objects.
  - name: Invoices
    description: Operations related to subscription's invoicing details.
  - name: Plans
    description: >-
      Operations related to listing and getting plan details including bricks in
      the plan.
  - name: Payment Methods
    description: Operations related to subscription's payment method.
paths:
  /usage/:
    patch:
      tags:
        - Usage
      summary: Update a usage entry
      description: >-
        Updates an existing usage entry by its unique `transaction_id`. You can
        update the `value` and/or `properties` fields. At least one field must
        be provided to update. Returns a 404 error if the transaction_id is not
        found.
      operationId: updateUsageEntry
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedUsageEntryPatch'
            examples:
              UpdateUsageEntryRequest:
                value:
                  transaction_id: tx-12345-abc
                  value: 200
                  properties:
                    region: us-west-2
                    tier: enterprise
                summary: Update Usage Entry Request
              UpdateValueOnly:
                value:
                  transaction_id: tx-12345-abc
                  value: 250
                summary: Update Value Only
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedUsageEntryPatch'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedUsageEntryPatch'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseMessage'
              examples:
                SuccessResponse:
                  value:
                    message: Usage entry updated successfully.
                  summary: Success Response
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                BadRequestResponse:
                  value:
                    error:
                      code: ERR_BAD_REQUEST
                      message: >-
                        Bad request — the input payload is malformed, missing
                        required fields, or contains invalid data.
                  summary: Bad Request Response
          description: ''
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                NotFoundResponse:
                  value:
                    error:
                      code: ERR_NOT_FOUND
                      message: >-
                        Not found — the resource you are looking for does not
                        exist.
                  summary: Not Found Response
          description: ''
components:
  schemas:
    PatchedUsageEntryPatch:
      type: object
      description: Request serializer for updating an existing usage entry.
      properties:
        transaction_id:
          type: string
          description: The unique identifier of the usage entry to update.
        value:
          type: string
          format: decimal
          pattern: ^-?\d{0,14}(?:\.\d{0,6})?$
          description: The new usage value.
        properties:
          nullable: true
          description: Updated JSON object with additional properties.
    ResponseMessage:
      type: object
      description: |-
        Common response message serializer that includes a message
        from the result of an API operation.
      properties:
        message:
          type: string
          description: Success message from the result of the previous API operation.
      required:
        - message
    ErrorResponse:
      type: object
      description: >-
        Standardizes API error responses with a consistent structure containing
        error code and message.
      properties:
        error:
          $ref: '#/components/schemas/Error'
      required:
        - error
    Error:
      type: object
      description: >-
        Represents individual error details with a standardized code and
        descriptive message.
      properties:
        code:
          enum:
            - ERR_NOT_FOUND
            - ERR_BAD_REQUEST
            - ERR_SERVER_ERROR
          type: string
          x-spec-enum-id: dc5a5d6feae1b697
          description: >-
            Error code indicating the type of error: NOT_FOUND for missing
            resources, BAD_REQUEST for invalid input, SERVER_ERROR for internal
            server issues


            * `ERR_NOT_FOUND` - ERR_NOT_FOUND

            * `ERR_BAD_REQUEST` - ERR_BAD_REQUEST

            * `ERR_SERVER_ERROR` - ERR_SERVER_ERROR
        message:
          type: string
        error_id:
          type: string
          format: uuid
          description: >-
            Correlation handle for SERVER_ERROR responses — quote this when
            contacting support; it joins to the structured server log line for
            the failure. Not present on 4xx responses.
      required:
        - code
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-SALESBRICKS-KEY
      description: API key for authentication

````

## Related topics

- [Update a usage entry](/api-reference/usage/patch.md)
- [Delete a usage entry](/api-reference/usage/delete.md)
- [Submit a usage entry](/api-reference/usage/post.md)
