> ## 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:
        - bearer: []
components:
  schemas:
    CheckLimitRequest:
      properties:
        customerRef:
          minLength: 1
          type: string
        meterName:
          type: string
        productRef:
          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 mils (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
        meterName:
          description: The meter name to use when tracking usage events
          example: requests
          type: string
        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
          example: 997
          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 mils
          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:
          type: string
        billingModel:
          type: string
        creditsPerUnit:
          description: Credits per usage unit (usage-based plans)
          type: number
        currency:
          type: string
        freeUnits:
          type: number
        name:
          type: string
        price:
          description: Price in smallest currency unit (e.g. cents)
          type: number
        reference:
          type: string
        requiresPayment:
          type: boolean
        type:
          type: string
      required:
        - reference
        - type
        - price
        - currency
        - requiresPayment
      type: object
    LimitProductBriefDto:
      properties:
        name:
          type: string
        reference:
          type: string
      required:
        - reference
      type: object

````