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

# Record usage



## OpenAPI

````yaml POST /api/v1/subscriptions/{subscription_id}/usage
openapi: 3.1.0
info:
  title: Paypulse
  description: Subscription billing platform with Nomba payment integration
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/subscriptions/{subscription_id}/usage:
    post:
      tags:
        - subscriptions
      summary: Report Usage
      operationId: report_usage_api_v1_subscriptions__subscription_id__usage_post
      parameters:
        - name: subscription_id
          in: path
          required: true
          schema:
            type: string
            title: Subscription Id
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UsageReportRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageReportResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UsageReportRequest:
      properties:
        quantity:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        idempotency_key:
          type: string
          maxLength: 255
          title: Idempotency Key
        timestamp:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Timestamp
      type: object
      required:
        - quantity
        - idempotency_key
      title: UsageReportRequest
    UsageReportResponse:
      properties:
        record:
          $ref: '#/components/schemas/UsageRecordResponse'
        created:
          type: boolean
          title: Created
      type: object
      required:
        - record
        - created
      title: UsageReportResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UsageRecordResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        subscription_id:
          type: string
          format: uuid
          title: Subscription Id
        quantity:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Quantity
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        idempotency_key:
          type: string
          title: Idempotency Key
        billed:
          type: boolean
          title: Billed
        billed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Billed At
        invoice_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Invoice Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        created_at:
          type: string
          format: date-time
          title: Created At
      type: object
      required:
        - id
        - subscription_id
        - quantity
        - description
        - idempotency_key
        - billed
        - billed_at
        - invoice_id
        - timestamp
        - created_at
      title: UsageRecordResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````