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

# Retrieve customer usage

> Message counts and charges for one billing period, broken down by day, category, region, number and template.

**Required scope:** `customers:write`



## OpenAPI

````yaml /api-reference/openapi.json get /v1/platform/customers/{customer}/usage
openapi: 3.1.0
info:
  title: LazyApp API
  version: v1
  description: >-
    One WhatsApp API for developers, SaaS platforms and businesses.


    Every endpoint is Bearer-authenticated with a LazyApp API key, returns JSON,
    and is scoped to the workspace and mode (`live` or `test`) the key belongs
    to.


    Live keys need the Pro plan. A live key on a workspace below Pro gets `402`
    with `code: plan_limit_reached` on every request. Test keys work on every
    plan, so you can build against the test number before you upgrade.


    LazyApp adds 0% to Meta's message rates. Meta bills each message to the
    business's own Meta payment method; your LazyApp plan is billed separately.
  contact:
    name: LazyApp support
    url: https://lazyapp.in
servers:
  - url: https://lazyapp.in
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Messages
    description: Send and schedule WhatsApp messages.
  - name: Contacts
    description: The people you message, and their identifiers.
  - name: Conversations
    description: Threads and their message history.
  - name: Calls
    description: WhatsApp call history for the workspace.
  - name: Templates
    description: Create, submit and sync message templates.
  - name: Media
    description: Upload, retrieve and delete media.
  - name: Broadcasts
    description: Template sends to many contacts at once.
  - name: Events
    description: Say what happened; LazyApp picks the template.
  - name: Flows
    description: WhatsApp Flows and their responses.
  - name: Webhooks
    description: Register endpoints and inspect deliveries.
  - name: Workflows
    description: Automations and their executions.
  - name: Verify
    description: One-time passcodes over WhatsApp.
  - name: Capabilities
    description: What each connected number supports.
  - name: Catalog
    description: Proxy Meta Commerce catalog products for a connection.
  - name: Platform
    description: Manage customers if you run a platform on LazyApp.
  - name: Meta-compatible proxy
    description: Drop-in endpoints for existing Cloud API integrations.
  - name: Connections
    description: >-
      Your WhatsApp numbers and the account behind them: health, limits,
      registration, display name, blue tick, QR codes, conversation starters,
      opt-in links, business profile and blocked users.
  - name: Billing
    description: >-
      Meta's message rates, which LazyApp passes on with 0% added, and the
      billing facts behind them.
  - name: Analytics
    description: Workspace messaging aggregates.
  - name: Groups
    description: WhatsApp group chats on a connection Meta has enabled.
  - name: Funding
    description: Local funding status and recorded WhatsApp charges.
  - name: Connections
    description: 'WhatsApp connections: block users, business profile, insights.'
  - name: Payments
    description: >-
      WhatsApp payments in India: ask for payment, follow it, update the order
      and refund.
paths:
  /v1/platform/customers/{customer}/usage:
    get:
      tags:
        - Platform
      summary: Retrieve customer usage
      description: >-
        Message counts and charges for one billing period, broken down by day,
        category, region, number and template.


        **Required scope:** `customers:write`
      parameters:
        - name: customer
          in: path
          required: true
          description: Customer public id, e.g. `cus_...`.
          schema:
            type: string
        - name: period
          in: query
          description: Billing period, `YYYY-MM`. Defaults to the current month.
          schema:
            type: string
      responses:
        '200':
          description: Usage.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PlatformCustomerUsage'
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          $ref: '#/components/responses/PlanLimitReached'
        '403':
          description: >-
            The key lacks the required scope, or is restricted from this phone
            number.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PlatformCustomerUsage:
      type: object
      description: >-
        Usage for one customer and one billing period, in this key's mode.
        LazyApp adds 0% to Meta's rates, so charges are non-zero only for sends
        LazyApp pays Meta for.
      properties:
        totals:
          type: object
          properties:
            messages:
              type: integer
            freeMessages:
              type: integer
            paidMessages:
              type: integer
            metaCharges:
              type: string
              description: >-
                Meta's rate for these sends, whoever Meta bills. Decimal string
                with six places, in `totals.currency`.
            providerCost:
              type: string
              description: Decimal string with six places, in `totals.currency`.
            lazyappCharge:
              type: string
              description: >-
                Charged through LazyApp: Meta's rate for sends LazyApp pays Meta
                for, `0` for sends Meta bills to the business directly. Decimal
                string with six places, in `totals.currency`.
            tax:
              type: string
              description: Decimal string with six places, in `totals.currency`.
            paymentFee:
              type: string
              description: Decimal string with six places, in `totals.currency`.
            totalCharge:
              type: string
              description: >-
                What these sends were charged through LazyApp. Decimal string
                with six places, in `totals.currency`.
            currency:
              type: string
            averageCostPerMessage:
              type: string
              description: >-
                `totalCharge` divided by `messages`. Decimal string with six
                places, in `totals.currency`.
        previousTotals:
          type: object
          nullable: true
          description: The same totals for the month before, plus its `period`.
          properties:
            messages:
              type: integer
            freeMessages:
              type: integer
            paidMessages:
              type: integer
            metaCharges:
              type: string
              description: >-
                Meta's rate for these sends, whoever Meta bills. Decimal string
                with six places, in `totals.currency`.
            providerCost:
              type: string
              description: Decimal string with six places, in `totals.currency`.
            lazyappCharge:
              type: string
              description: >-
                Charged through LazyApp: Meta's rate for sends LazyApp pays Meta
                for, `0` for sends Meta bills to the business directly. Decimal
                string with six places, in `totals.currency`.
            tax:
              type: string
              description: Decimal string with six places, in `totals.currency`.
            paymentFee:
              type: string
              description: Decimal string with six places, in `totals.currency`.
            totalCharge:
              type: string
              description: >-
                What these sends were charged through LazyApp. Decimal string
                with six places, in `totals.currency`.
            currency:
              type: string
            averageCostPerMessage:
              type: string
              description: >-
                `totalCharge` divided by `messages`. Decimal string with six
                places, in `totals.currency`.
            period:
              type: string
        comparison:
          type: object
          nullable: true
          properties:
            messagesDelta:
              type: integer
            totalChargeDelta:
              type: string
            messagesDeltaPct:
              type: number
              nullable: true
            totalChargeDeltaPct:
              type: number
              nullable: true
        costStack:
          type: array
          description: What `totals.totalCharge` is made of.
          items:
            type: object
            properties:
              key:
                type: string
                enum:
                  - lazyapp
                  - tax
                  - payment_fee
              label:
                type: string
              amount:
                type: string
              sharePct:
                type: number
        daily:
          type: array
          items:
            type: object
            properties:
              day:
                type: string
                description: e.g. `Oct 3`.
              messages:
                type: integer
              paidMessages:
                type: integer
              freeMessages:
                type: integer
              metaCharges:
                type: string
              lazyappCharge:
                type: string
              totalCharge:
                type: string
        byCategory:
          type: array
          items:
            type: object
            properties:
              category:
                type: string
              messages:
                type: integer
              metaCharges:
                type: string
              lazyappCharge:
                type: string
              totalCharge:
                type: string
              sharePct:
                type: number
        byRegion:
          type: array
          items:
            type: object
            properties:
              region:
                type: string
              messages:
                type: integer
              totalCharge:
                type: string
              sharePct:
                type: number
        byPhoneNumber:
          type: array
          items:
            type: object
            properties:
              phoneNumber:
                type: string
                nullable: true
              messages:
                type: integer
              totalCharge:
                type: string
              sharePct:
                type: number
        byTemplate:
          type: array
          description: Top 15 templates by charge.
          items:
            type: object
            properties:
              templateName:
                type: string
              messages:
                type: integer
              totalCharge:
                type: string
        freeVsPaid:
          type: object
          properties:
            paidMessages:
              type: integer
            freeMessages:
              type: integer
            paidSharePct:
              type: number
            freeSharePct:
              type: number
        spending_limit_cents:
          type: integer
          nullable: true
        wallet_balance_cents:
          type: integer
          description: >-
            Prepaid balance in minor units, used when `billing_mode` is
            `prepaid`. It is debited only for sends LazyApp pays Meta for, at
            Meta's rate. Sends on numbers where Meta bills the business directly
            cost nothing here.
        billing_mode:
          type: string
          enum:
            - inherit
            - prepaid
            - postpaid
    Error:
      type: object
      properties:
        message:
          type: string
          description: Human-readable description of what went wrong.
        code:
          type: string
          description: >-
            Stable machine-readable reason, when the failure is one a client can
            branch on.
      required:
        - message
  responses:
    PlanLimitReached:
      description: >-
        The workspace's plan does not allow this. A live key on a workspace
        below Pro gets this on every request, because the live API is a Pro
        feature. Upgrade in **Billing** to use live keys. Test keys are never
        limited, on any plan.


        `code` is always `plan_limit_reached`. Show `message` to the person: it
        names the plan to move to.


        Other plan limits use the same code in the console, but the API reports
        them differently today: a broadcast larger than the month's remaining
        Live broadcast sends is refused with `422` and the reason in `message`,
        and connecting a number beyond the plan's number capacity fails
        validation (`422`) on `phone_number_id`.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: >-
                  A sentence you can show to the person. Says which plan to move
                  to.
              code:
                type: string
                enum:
                  - plan_limit_reached
            required:
              - message
              - code
          example:
            message: >-
              The API is on the Pro plan. Upgrade in Billing to use live keys.
              Test keys keep working.
            code: plan_limit_reached
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Your API key, e.g. `sk_live_...` or `sk_test_...`.

````

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