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

# List usage records

> A subscription's usage records and how much of this period's cap is left. Requires the READ_CHARGES scope.

Lists the usage recorded on a subscription, newest first, with the current period's balance and what is left of the cap.


## OpenAPI

````yaml apps-api/specs/billing.json GET /app-billing/subscriptions/{id}/usage
openapi: 3.1.0
info:
  title: 'Salesive Apps API: Billing'
  version: 1.0.0
  description: >-
    Charge the merchant a store is installed for, once or on a schedule. Every
    endpoint authenticates with an installed-app access token (prefix `app_`).
    Creating a charge or subscription never moves money: the store owner
    approves it in the dashboard first. Salesive keeps 5% of every payment and
    credits the rest to your payout store's wallet.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /app-billing/subscriptions/{id}/usage:
    get:
      tags:
        - Subscriptions
      summary: List usage records
      description: >-
        The subscription's usage records, newest first, with where the current
        period stands. Requires `READ_CHARGES`. Authenticate with
        `Authorization: Bearer app_<token>`. The store is bound to the token
        server-side, never send a shop id.
      operationId: listUsageRecords
      parameters:
        - $ref: '#/components/parameters/SubscriptionId'
        - name: page
          in: query
          schema:
            type: integer
            default: 1
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
            maximum: 100
      responses:
        '200':
          description: Usage records.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          usage:
                            oneOf:
                              - $ref: '#/components/schemas/Usage'
                              - type: 'null'
                          items:
                            type: array
                            items:
                              $ref: '#/components/schemas/UsageRecord'
                          total:
                            type: integer
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    SubscriptionId:
      name: id
      in: path
      required: true
      description: The subscription id.
      schema:
        type: string
  schemas:
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
    Usage:
      type: object
      description: >-
        The usage terms of a capped subscription and where the current period
        stands.
      properties:
        cappedAmount:
          type: number
          description: >-
            The most usage that can be billed in one period, in the subscription
            currency. The merchant approved it and it can never be passed.
        terms:
          type: string
          description: The usage terms the merchant approved, for example `$0.05 per SMS`.
        periodStart:
          type:
            - string
            - 'null'
          format: date-time
          description: Start of the usage period that records count against now.
        balance:
          type: number
          description: Usage recorded in this period.
        remaining:
          type: number
          description: '`cappedAmount` minus `balance`.'
    UsageRecord:
      type: object
      properties:
        id:
          type: string
        subscriptionId:
          type: string
        description:
          type: string
        amount:
          type: number
        currency:
          type: string
          enum:
            - USD
            - NGN
        periodStart:
          type: string
          format: date-time
        billed:
          type: boolean
          description: True once a charge has billed it.
        chargeId:
          type:
            - string
            - 'null'
          description: The charge that billed it.
        idempotencyKey:
          type: string
        test:
          type: boolean
        createdAt:
          type: string
          format: date-time
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
    NotFound:
      description: >-
        The resource does not exist or does not belong to the installation's
        store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 404
            success: false
            message: Resource not found
            data: null
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side, never send a shop id.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.