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

# Check usage limits for a customer and product

> Checks whether a customer has an active purchase for a product and is within their usage limits. Returns a checkout URL if payment is required.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/sdk/limits
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/limits:
    post:
      tags:
        - Limits
      summary: Check usage limits for a customer and product
      description: >-
        Checks whether a customer has an active purchase for a product and is
        within their usage limits. Returns a checkout URL if payment is
        required.
      operationId: LimitsSdkController_checkLimits
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckLimitRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LimitResponse'
          description: Limit check result
        '400':
          description: Missing customerRef or productRef
        '404':
          description: Customer or product not found
      security:
        - SecretKey: []
components:
  schemas:
    CheckLimitRequest:
      properties:
        customerRef:
          maxLength: 20
          minLength: 1
          type: string
        includeCheckoutSession:
          type: boolean
        meterName:
          type: string
        productRef:
          maxLength: 20
          minLength: 1
          type: string
        usageType:
          type: string
      required:
        - customerRef
        - productRef
      type: object
    LimitResponse:
      properties:
        activationRequired:
          description: >-
            True when the customer must activate a priced default plan before
            usage is allowed
          type: boolean
        balance:
          allOf:
            - $ref: '#/components/schemas/LimitBalanceDto'
          description: Prepaid usage balance context when the default plan is usage-based
        checkoutSessionId:
          description: Checkout session ID if payment is required
          example: e3f1c2d4b6a89f001122334455667788
          type: string
        checkoutUrl:
          description: Checkout URL if payment is required
          example: >-
            https://solvapay.com/customer/checkout?id=e3f1c2d4b6a89f001122334455667788
          type: string
        confirmationUrl:
          description: >-
            Customer portal confirmation URL when activation is required
            (fallback when not starting checkout)
          type: string
        creditBalance:
          description: >-
            Credit balance in credits (100 credits = 1 minor currency unit), for
            pre-paid usage-based plans
          type: number
        creditsPerUnit:
          description: Credits per usage unit (for pre-paid usage-based plans)
          type: number
        currency:
          description: ISO 4217 currency code for credit fields
          type: string
        limit:
          description: >-
            The effective finite cap for this meter. Present only when the
            backend measured a finite cap.
          type: number
        meterName:
          description: The meter name to use when tracking usage events
          example: requests
          type: string
        needsTopUp:
          description: >-
            Access is blocked pending an auto-recharge top-up of the prepaid
            balance — `onExceed: top_up`.
          type: boolean
        needsUpgrade:
          description: >-
            Access is blocked pending a plan switch to the limit's target
            pricing — `onExceed: auto_upgrade`.
          type: boolean
        overage:
          description: >-
            Access is granted and usage beyond the included cap accrues an
            overage charge — `onExceed: charge`.
          type: boolean
        plans:
          description: Active plans on the product available for activation or checkout
          items:
            $ref: '#/components/schemas/LimitPlanItemDto'
          type: array
        product:
          allOf:
            - $ref: '#/components/schemas/LimitProductBriefDto'
          description: Product the limit check applies to
        remaining:
          description: >-
            Remaining usage units before hitting the limit. `-1` means unlimited
            (no finite cap).
          example: 997
          type: number
        throttled:
          description: >-
            Access is granted but the caller should degrade/throttle service —
            the limit was exceeded with `onExceed: throttle`.
          type: boolean
        upgraded:
          description: >-
            The customer was auto-upgraded to the target pricing to restore
            access — `onExceed: auto_upgrade` succeeded.
          type: boolean
        used:
          description: >-
            Consumed usage units this period. Present only when the backend
            measured a finite cap.
          type: number
        withinLimits:
          description: Whether the customer is within their usage limits
          example: true
          type: boolean
      required:
        - withinLimits
        - remaining
      type: object
    LimitBalanceDto:
      properties:
        creditBalance:
          description: Credit balance in credits (100 credits = 1 minor currency unit)
          type: number
        creditsPerUnit:
          description: Credits per usage unit
          type: number
        currency:
          type: string
        remainingUnits:
          description: Estimated whole units remaining from prepaid credit balance
          type: number
      required:
        - creditBalance
        - creditsPerUnit
        - currency
      type: object
    LimitPlanItemDto:
      properties:
        billingCycle:
          description: Derived billing cycle
          type: string
        creditsPerUnit:
          description: Per-unit charge in minor units (usage-based plans)
          type: number
        currency:
          type: string
        freeUnits:
          description: Derived included units for the metered allowance
          type: number
        name:
          type: string
        options:
          description: Composable pricing options for this plan
          items:
            additionalProperties: true
            type: object
          type: array
        price:
          description: Headline price in smallest currency unit (e.g. cents)
          type: number
        reference:
          type: string
        requiresPayment:
          type: boolean
        type:
          description: Derived plan type
          type: string
      required:
        - reference
        - type
        - price
        - currency
        - requiresPayment
      type: object
    LimitProductBriefDto:
      properties:
        name:
          type: string
        reference:
          type: string
      required:
        - reference
      type: object
  securitySchemes:
    SecretKey:
      bearerFormat: JWT
      description: >-
        Provider secret API key (sk_live_… / sk_test_…) supplied as a Bearer
        token.
      scheme: bearer
      type: http

````