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

# Submit a usage entry

> Use this API to increment a final value counter for a customer.

<Info>
  To use this endpoint, ensure that you are using the `v2/usage` API endpoint:

  `https://api.salesbricks.com/api/v2/usage`
</Info>


## OpenAPI

````yaml POST /usage
openapi: 3.0.0
info:
  title: Salesbricks Usage Entry API
  description: >-
    Use this API to increment a final value counter, update an existing usage
    entry, or delete a usage entry for a customer.
  version: 1.0.0
servers:
  - url: https://api.salesbricks.com/api/v2
security:
  - salesbricksAuth: []
paths:
  /usage:
    post:
      summary: Create a new usage entry
      description: >-
        Set either a prorated gauge or increment a final value counter for a
        customer.
      operationId: createUsageEntry
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                transaction_id:
                  type: string
                  description: The unique identifier for this usage entry transaction.
                  example: '12345'
                subscription_id:
                  type: string
                  format: uuid
                  description: >-
                    The UUID of the Salesbricks subscription associated with the
                    customer.
                  example: 00000000-0000-0000-0000-000000000000
                brick_id:
                  type: string
                  format: uuid
                  description: The UUID of the associated Usage Brick.
                  example: 00000000-0000-0000-0000-000000000000
                value:
                  type: integer
                  description: The value to set for the Brick.
                  example: 1
                properties:
                  type: object
                  description: Additional properties for the usage entry.
                  example:
                    source: api
                    notes: This is a test entry
                    region: US
                time:
                  type: string
                  format: date-time
                  description: >-
                    The timestamp indicating when the operation occurs in ISO
                    8601 format.
                  example: '2024-09-16T10:15:30Z'
      responses:
        '201':
          description: Usage entry created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Usage entry submitted successfully.
        '400':
          description: Bad Request. Validation errors or missing fields.
        '404':
          description: Not Found. Usage entry does not exist.
components:
  securitySchemes:
    salesbricksAuth:
      type: apiKey
      in: header
      name: X-SALESBRICKS-KEY
      description: Use your Salesbricks API key to authenticate requests.

````