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

# Record a usage event

> Records a usage event into the Usage timeseries collection.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sdk/usages
openapi: 3.0.0
info:
  contact: {}
  description: The SolvaPay REST API specification
  title: SolvaPay REST API
  version: '1.0'
servers: []
security: []
tags: []
paths:
  /v1/sdk/usages:
    post:
      tags:
        - Usage
      summary: Record a usage event
      description: Records a usage event into the Usage timeseries collection.
      operationId: UsageSdkController_recordUsage
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUsageRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  reference:
                    example: usage_A1B2C3D4
                    type: string
                  success:
                    example: true
                    type: boolean
                type: object
          description: Usage recorded successfully
        '400':
          description: Validation failed
      security:
        - bearer: []
components:
  schemas:
    CreateUsageRequest:
      properties:
        actionType:
          default: api_call
          enum:
            - transaction
            - api_call
            - hour
            - email
            - storage
            - custom
          type: string
        customerRef:
          minLength: 1
          type: string
        description:
          type: string
        duration:
          exclusiveMinimum: false
          minimum: 0
          type: number
        errorMessage:
          type: string
        idempotencyKey:
          maxLength: 256
          type: string
        metadata:
          additionalProperties: true
          type: object
        outcome:
          default: success
          enum:
            - success
            - paywall
            - fail
          type: string
        productRef:
          type: string
        purchaseRef:
          type: string
        timestamp:
          format: date-time
          type: string
        units:
          default: 1
          exclusiveMaximum: false
          exclusiveMinimum: false
          maximum: 100000
          minimum: 0
          type: integer
      required:
        - customerRef
        - metadata
        - timestamp
      type: object

````