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

# Get billing account

> One consolidated view of the organization's commercial account: plan and terms, effective pricing, intelligence usage, credit/prepay balance, agreements, child accounts, and the single next action (if any) needed to become or remain paid. Org-admin only; child-account requests resolve to the parent organization.



## OpenAPI

````yaml /v2/buyer-api-v2.yaml get /billing/account
openapi: 3.0.0
info:
  title: Scope3 Buyer API
  version: 2.0.0
  description: |-
    REST API for advertisers to manage advertisers, campaigns, and reporting.

    ## Authentication

    All endpoints require a Bearer token in the Authorization header:
    ```
    Authorization: Bearer your-api-key
    ```

    ## Base URL

    `https://api.interchange.io/api/v2/buyer`

    ## For AI Agents

    AI agents can use the MCP endpoint at `/mcp/v2/buyer` with three tools:
    - `initialize`: Start an MCP session
    - `api_call`: Make REST API calls
    - `ask_about_capability`: Learn about API features
servers:
  - url: https://api.interchange.io/api/v2/buyer
    description: Production server
security: []
tags:
  - name: Account
    description: Account management, service tokens, and preferences
  - name: Advertisers
    description: Manage advertisers
  - name: Product Discovery
    description: Discover and select products
  - name: Campaigns
    description: Manage advertising campaigns
  - name: Creatives
    description: Build, manage, and sync campaign creatives via AdCP Creative Protocol
  - name: Reporting
    description: Access performance metrics
  - name: Event Sources
    description: >-
      Manage event source configurations and log conversion/marketing events for
      attribution
  - name: Property Lists
    description: Validate property lists against AAO registry
  - name: Sales Agents
    description: View and connect sales agents
  - name: Measurement
    description: Measurement sources, records, context, and freshness
  - name: Syndication
    description: Syndicate resources to ADCP agents
  - name: Tasks
    description: Track async operation status
  - name: Planning Briefs
    description: >-
      Share prospective briefs with publishers and collect their
      fit/quote/clarify/decline/book responses (gated by the
      demand-supply-signals flag).
  - name: Buyer Billing
    description: >-
      Consolidated invoicing for buyers — invoices and pending invoice items
      issued by Scope3 across the buyer customer.
  - name: MCP
    description: Model Context Protocol endpoints for AI agents
paths:
  /billing/account:
    servers:
      - url: https://api.interchange.io/api/v2
        description: Production server
    get:
      tags:
        - Buyer Billing
      summary: Get billing account
      description: >-
        One consolidated view of the organization's commercial account: plan and
        terms, effective pricing, intelligence usage, credit/prepay balance,
        agreements, child accounts, and the single next action (if any) needed
        to become or remain paid. Org-admin only; child-account requests resolve
        to the parent organization.
      operationId: getBillingAccount
      responses:
        '200':
          description: Get billing account
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBillingAccountResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: ACCESS_DENIED (caller is not an org admin / eligible service token).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    GetBillingAccountResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/BillingAccountDocument'
      required:
        - data
      additionalProperties: false
    ErrorResponse:
      description: Standard error response
      type: object
      properties:
        data:
          type: string
          nullable: true
          enum:
            - null
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - data
        - error
      additionalProperties: false
    BillingAccountDocument:
      description: >-
        The consolidated commercial-account read model — GET
        /api/v2/billing/account.
      type: object
      properties:
        organization:
          $ref: '#/components/schemas/BillingOrganization'
        scope:
          $ref: '#/components/schemas/BillingScope'
        standing:
          $ref: '#/components/schemas/BillingStanding'
        plan:
          $ref: '#/components/schemas/BillingPlan'
        pricing:
          $ref: '#/components/schemas/BillingPricing'
        usage:
          $ref: '#/components/schemas/BillingUsage'
        payment:
          $ref: '#/components/schemas/BillingPayment'
        contracts:
          $ref: '#/components/schemas/BillingContracts'
        accounts:
          description: >-
            The org’s child accounts (billing dimension only), capped at 50
            entries — `totalAccounts` carries the uncapped count.
          type: array
          items:
            $ref: '#/components/schemas/BillingAccountChild'
        totalAccounts:
          description: >-
            Total number of child accounts in the org, regardless of the
            `accounts[]` cap.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        nextAction:
          $ref: '#/components/schemas/NextAction'
        permissions:
          $ref: '#/components/schemas/BillingPermissions'
      required:
        - organization
        - scope
        - standing
        - plan
        - pricing
        - usage
        - payment
        - contracts
        - accounts
        - totalAccounts
        - nextAction
        - permissions
      additionalProperties: false
    ApiError:
      description: Structured error object
      type: object
      properties:
        code:
          description: Machine-readable error code
          type: string
        message:
          description: Human-readable error message
          type: string
        field:
          description: Field path associated with the error
          type: string
        details:
          description: Additional error context
          type: object
          additionalProperties: {}
      required:
        - code
        - message
      additionalProperties: false
    BillingOrganization:
      type: object
      properties:
        customerId:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        name:
          type: string
        roles:
          description: >-
            The org's OWN customer role(s). Empty when unresolved. Today this is
            a single role (the core schema carries one `customerRole` per
            customer); the array shape is forward-compatible with a multi-role
            org. Does NOT include children's roles — see `capabilities` for the
            org-wide derivation.
          type: array
          items:
            type: string
            enum:
              - BUYER
              - SELLER
        capabilities:
          $ref: '#/components/schemas/BillingCapabilities'
        currency:
          description: >-
            The currency every money figure on this document is denominated in
            (the org’s ledger/standing currency).
          allOf:
            - $ref: '#/components/schemas/LedgerCurrency'
      required:
        - customerId
        - name
        - roles
        - capabilities
        - currency
      additionalProperties: false
    BillingScope:
      type: object
      properties:
        boundary:
          description: >-
            Whose money this document describes. Always `ORG` today — `ACCOUNT`
            appears once per-account `OWN` delegation ships (spec §10, open
            question).
          type: string
          enum:
            - ORG
            - ACCOUNT
        delegatedFrom:
          description: >-
            Set to the parent customerId when this document is a delegated
            child’s own boundary (`OWN`). Always null today — no delegation
            configuration exists yet.
          nullable: true
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
      required:
        - boundary
        - delegatedFrom
      additionalProperties: false
    BillingStanding:
      type: object
      properties:
        posture:
          description: >-
            `CREDIT` when the org has a Scope3-granted credit line
            (`creditLimitMinor` > 0); `PREPAY` otherwise (must fund a balance to
            spend).
          type: string
          enum:
            - PREPAY
            - CREDIT
        creditLimitMinor:
          description: Scope3-granted credit ceiling, minor units (0 = none).
          type: string
        currency:
          $ref: '#/components/schemas/LedgerCurrency'
        verificationLevel:
          type: string
          enum:
            - none
            - screened
            - kyb_verified
            - legacy_grandfathered
        holds:
          type: array
          items:
            $ref: '#/components/schemas/BillingHold'
      required:
        - posture
        - creditLimitMinor
        - currency
        - verificationLevel
        - holds
      additionalProperties: false
    BillingPlan:
      type: object
      properties:
        tosVersion:
          nullable: true
          type: string
        tosAcceptedAt:
          nullable: true
          type: string
        tosAcceptedByEmail:
          nullable: true
          type: string
        contractStatus:
          type: string
          enum:
            - active
            - no_contract
            - inherited_active
            - inherited_hidden
            - organization_contract_missing
        rateCardType:
          nullable: true
          type: string
          enum:
            - STANDARD
            - CUSTOM
            - INHERITED
        effectiveDate:
          nullable: true
          type: string
        endDate:
          nullable: true
          type: string
        autoRenewal:
          description: >-
            Not exposed by the composed contract-service.ts surface today
            (`ContractInfo` has no `autoRenewal` field) — always null pending
            that field surfacing one layer up from
            `agentic-contract-service.ts`.
          nullable: true
          type: boolean
        subscriptions:
          description: Empty until AI-2897 (account-subscriptions) lands.
          type: array
          items: {}
      required:
        - tosVersion
        - tosAcceptedAt
        - tosAcceptedByEmail
        - contractStatus
        - rateCardType
        - effectiveDate
        - endDate
        - autoRenewal
        - subscriptions
      additionalProperties: false
    BillingPricing:
      type: object
      properties:
        effective:
          $ref: '#/components/schemas/BillingRateCard'
        publicList:
          description: Null until AI-2964 (public pricing / price book) lands.
          nullable: true
          allOf:
            - $ref: '#/components/schemas/BillingRateCard'
        provenance:
          nullable: true
          type: string
          enum:
            - STANDARD
            - CUSTOM
            - INHERITED
      required:
        - effective
        - publicList
        - provenance
      additionalProperties: false
    BillingUsage:
      type: object
      properties:
        intelligence:
          $ref: '#/components/schemas/BillingIntelligenceUsage'
        creditBalance:
          $ref: '#/components/schemas/CreditBalanceSummary'
        orgPosition:
          $ref: '#/components/schemas/BillingOrgFinancialPosition'
        iuAccount:
          $ref: '#/components/schemas/BillingIuAccount'
      required:
        - intelligence
        - creditBalance
        - orgPosition
        - iuAccount
      additionalProperties: false
    BillingPayment:
      type: object
      properties:
        billingInfo:
          $ref: '#/components/schemas/BillingBillingInfo'
        paymentMethod:
          $ref: '#/components/schemas/BillingPaymentMethod'
        cardCollectionEnabled:
          description: >-
            Whether `buyer-card-collection` is on for this org (AI-3078,
            parent-inherited, fail-closed). The card door renders whenever this
            is true, independent of funding status or `nextAction` — a funded
            org still gets the "Add a card" option (spec
            docs/spec/payments/buyer-card-collection.md §12 ruling 8).
          type: boolean
        storefrontBilling:
          $ref: '#/components/schemas/BillingStorefrontBillingSummary'
        creditApplications:
          description: >-
            The org’s credit-application history. `reviewerNotes` is nulled for
            every principal except a Scope3 superadmin — reviewer notes are
            internal; the buyer-authored `justification` stays visible.
          type: array
          items:
            $ref: '#/components/schemas/CreditApplicationResponse'
        deposits:
          description: >-
            Recent prepay deposits, newest first, capped at 10 — projected from
            ledger DEPOSIT entries (spec §10 ruling 3; the funding rail shipped
            with AI-2959).
          type: array
          items:
            $ref: '#/components/schemas/BillingDeposit'
        invoices:
          description: Empty until an invoicing model exists.
          type: array
          items: {}
      required:
        - billingInfo
        - paymentMethod
        - cardCollectionEnabled
        - storefrontBilling
        - creditApplications
        - deposits
        - invoices
      additionalProperties: false
    BillingContracts:
      type: object
      properties:
        agreements:
          type: array
          items:
            $ref: '#/components/schemas/BillingAgreement'
        documents:
          description: >-
            Agreement documents. For a service-token caller the
            download/sharepoint/GCP links are nulled (document metadata stays) —
            retrieving contract files is a human-admin action.
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              title:
                type: string
              downloadUrl:
                nullable: true
                type: string
                format: uri
              sharepointLink:
                nullable: true
                type: string
                format: uri
              gcpLink:
                nullable: true
                type: string
                format: uri
            required:
              - id
              - title
              - downloadUrl
              - sharepointLink
              - gcpLink
            additionalProperties: false
        mediaRateCard:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/BillingRateCard'
      required:
        - agreements
        - documents
        - mediaRateCard
      additionalProperties: false
    BillingAccountChild:
      type: object
      properties:
        customerId:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        name:
          type: string
        company:
          nullable: true
          type: string
        delegation:
          description: >-
            Always `NONE` today — no delegation configuration exists yet (spec
            §10, open question 1).
          type: string
          enum:
            - NONE
            - VIEW
            - OWN
        periodFees:
          description: Null until AI-2897 (per-account fees) lands.
          nullable: true
          type: number
        intelligenceUsage:
          description: >-
            Intelligence cost (micro-USD) attributed to this child for the
            period. Null: no bulk per-child usage aggregation exists yet, and
            computing it per-child would be an N+1 over the org’s children.
          nullable: true
          type: number
      required:
        - customerId
        - name
        - company
        - delegation
        - periodFees
        - intelligenceUsage
      additionalProperties: false
    NextAction:
      description: >-
        The single most-important action needed to become or remain paid,
        derived server-side — never stored.
      type: object
      properties:
        type:
          type: string
          enum:
            - ACCEPT_TOS
            - ADD_BILLING_INFO
            - ADD_PAYMENT_METHOD
            - FUND_PREPAY
            - APPLY_FOR_CREDIT
            - RESOLVE_HOLD
            - UPDATE_PAYMENT_METHOD
            - NONE
        message:
          description: Human sentence describing the action, for direct display.
          type: string
        docsUrl:
          description: mintlify/v2 page explaining this action, when one exists.
          nullable: true
          type: string
        route:
          description: >-
            The REST method + path that resolves this action (e.g. "POST
            /api/v2/accept-tos"), when a self-serve route exists today AND is
            reachable by the caller. For APPLY_FOR_CREDIT the route is only
            emitted when the `customer-credit-prepay` flag is on for the
            customer (the credit-applications surface is gated by it); the enum
            value is returned either way.
          nullable: true
          type: string
        taskId:
          description: >-
            The MCP tool/Task name that resolves this action, when a bounded
            agent Task exists today (only `accept_tos` as of this writing — the
            rest are specified but deferred, spec §7).
          nullable: true
          type: string
      required:
        - type
        - message
        - docsUrl
        - route
        - taskId
      additionalProperties: false
    BillingPermissions:
      type: object
      properties:
        canAcceptTos:
          type: boolean
        canEditBillingInfo:
          type: boolean
        canApplyForCredit:
          type: boolean
      required:
        - canAcceptTos
        - canEditBillingInfo
        - canApplyForCredit
      additionalProperties: false
    BillingCapabilities:
      description: >-
        Capability derived from the org's own role UNION its children's roles.
        Always present — computed server-side so no consumer decides capability
        from `roles` alone. `roles` is left unchanged for existing consumers
        that specifically want the org's OWN role.
      type: object
      properties:
        seller:
          description: >-
            Whether the org has SELLER capability — its own `roles` OR at least
            one of its child accounts' roles (AI-3378). A parent org whose
            storefronts live only in child accounts (agency/reseller shape)
            still gets `true` here, unlike `roles` which only reflects the org's
            own customer row.
          type: boolean
        buyer:
          description: >-
            Whether the org has BUYER capability — its own `roles` OR at least
            one of its child accounts' roles (AI-3378).
          type: boolean
      required:
        - seller
        - buyer
      additionalProperties: false
    LedgerCurrency:
      description: >-
        ISO 4217 currency code supported by the ledger. Mirrors the
        ledger.iso_currency ENUM.
      type: string
      enum:
        - USD
        - EUR
        - GBP
        - JPY
        - CAD
        - AUD
        - CHF
        - CNY
        - INR
        - BRL
        - MXN
        - SGD
        - HKD
        - NZD
        - SEK
        - NOK
        - DKK
        - ZAR
        - KRW
        - PLN
    BillingHold:
      description: >-
        A payment hold blocking NEW paid actions (meter-first, block narrow —
        spec §5.4/§12 ruling 5). Never blocks read access, reporting, export,
        in-flight delivering media, or this Plan & Billing surface itself.
      type: object
      properties:
        id:
          type: string
        type:
          description: >-
            `PAYMENT_FAILED` (AI-3080, spec §5.4) is posted at day +10 of the
            card-dunning ladder when a failed charge could not be recovered on
            retry. `PAYMENT_DISPUTED` (a chargeback) is reserved — not created
            by this slice.
          type: string
          enum:
            - PAYMENT_FAILED
        reason:
          type: string
        createdAt:
          type: string
      required:
        - id
        - type
        - reason
        - createdAt
      additionalProperties: false
    BillingRateCard:
      type: object
      properties:
        type:
          nullable: true
          type: string
          enum:
            - STANDARD
            - CUSTOM
            - INHERITED
        rates:
          type: array
          items:
            type: object
            properties:
              customerRole:
                type: string
                enum:
                  - BUYER
                  - SELLER
              billingType:
                type: string
                enum:
                  - DECISIONED
                  - ROUTED
              pricingType:
                type: string
                enum:
                  - MARGIN
                  - UNIT
              feeRatePercent:
                nullable: true
                type: number
              unitPrice:
                nullable: true
                type: number
              unit:
                nullable: true
                type: string
                enum:
                  - CPM
                  - RECORD
                  - FLAT_RATE
              currency:
                nullable: true
                type: string
            required:
              - customerRole
              - billingType
              - pricingType
              - feeRatePercent
              - unitPrice
              - unit
              - currency
            additionalProperties: false
      required:
        - type
        - rates
      additionalProperties: false
    BillingIntelligenceUsage:
      type: object
      properties:
        periodStart:
          description: Start of the current usage period (ISO 8601 date).
          type: string
        byFeature:
          type: array
          items:
            type: object
            properties:
              bucket:
                type: string
              inputTokens:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              outputTokens:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              cacheCreationInputTokens:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              cacheReadInputTokens:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              costMicroUsd:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              costUsd:
                type: number
                minimum: 0
              callCount:
                type: integer
                minimum: 0
                maximum: 9007199254740991
            required:
              - bucket
              - inputTokens
              - outputTokens
              - cacheCreationInputTokens
              - cacheReadInputTokens
              - costMicroUsd
              - costUsd
              - callCount
            additionalProperties: false
        byDay:
          type: array
          items:
            type: object
            properties:
              bucket:
                type: string
              inputTokens:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              outputTokens:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              cacheCreationInputTokens:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              cacheReadInputTokens:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              costMicroUsd:
                type: integer
                minimum: 0
                maximum: 9007199254740991
              costUsd:
                type: number
                minimum: 0
              callCount:
                type: integer
                minimum: 0
                maximum: 9007199254740991
            required:
              - bucket
              - inputTokens
              - outputTokens
              - cacheCreationInputTokens
              - cacheReadInputTokens
              - costMicroUsd
              - costUsd
              - callCount
            additionalProperties: false
        totalCostMicroUsd:
          type: integer
          minimum: 0
          maximum: 9007199254740991
      required:
        - periodStart
        - byFeature
        - byDay
        - totalCostMicroUsd
      additionalProperties: false
    CreditBalanceSummary:
      description: >-
        A customer’s credit/prepay position: their ledger balance sheet plus the
        derived funded / owed / spendable figures, all in `currency` minor
        units.
      type: object
      properties:
        effectiveCustomerId:
          description: >-
            The credit-bearing customer the position is computed for (the
            caller, or its PARENT when the caller is a CHILD).
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        currency:
          description: >-
            ISO 4217 currency every minor-unit field on this response is
            denominated in (the customer’s standing currency).
          allOf:
            - $ref: '#/components/schemas/LedgerCurrency'
        creditLimitMinor:
          description: >-
            Scope3-granted credit ceiling in minor units (absolute, not
            monthly). `0` means the customer has no credit line (a null or zero
            `customer_standing.credit_limit`) — they must apply for credit or
            contact Scope3; only a positive value grants credit.
          example: '30000000'
          type: string
          pattern: ^-?\d+$
        fundedBalanceMinor:
          description: >-
            Prepaid funds Scope3 currently holds for the customer (the
            `buyer_funds` LIABILITY balance), in minor units. `0` when none.
          example: '10000000'
          type: string
          pattern: ^-?\d+$
        owedBalanceMinor:
          description: >-
            Amount the customer currently owes Scope3 on credit (the
            `buyer_accounts_receivable` ASSET balance), in minor units. `0` when
            none.
          example: '0'
          type: string
          pattern: ^-?\d+$
        netBalanceMinor:
          description: >-
            owed − funded, in minor units. Negative means the customer is net
            prepaid/in credit; positive means they have an outstanding balance.
          example: '-10000000'
          type: string
          pattern: ^-?\d+$
        spendableMinor:
          description: >-
            How much the customer can still spend: creditLimit + funded − owed,
            in minor units.
          example: '40000000'
          type: string
          pattern: ^-?\d+$
        accounts:
          description: >-
            Full per-account balance sheet for the customer (every financial
            account, by code). Empty when the customer has no ledger accounts
            yet.
          type: array
          items:
            $ref: '#/components/schemas/LedgerAccountBalance'
      required:
        - effectiveCustomerId
        - currency
        - creditLimitMinor
        - fundedBalanceMinor
        - owedBalanceMinor
        - netBalanceMinor
        - spendableMinor
        - accounts
      additionalProperties: false
    BillingOrgFinancialPosition:
      description: >-
        Org-wide rollup across the customer subtree (`getOrgFinancialPosition` —
        this read model is its first caller).
      type: object
      properties:
        orgRootCustomerId:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        customerCount:
          description: >-
            How many customers (org root + active children) the rollup spans.
            The ids themselves are not projected — they duplicate `accounts[]`.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        currency:
          $ref: '#/components/schemas/LedgerCurrency'
        fundedMinor:
          type: string
        committedMinor:
          type: string
        creditLimitMinor:
          nullable: true
          type: string
        availableMinor:
          type: string
        overLimit:
          type: boolean
      required:
        - orgRootCustomerId
        - customerCount
        - currency
        - fundedMinor
        - committedMinor
        - creditLimitMinor
        - availableMinor
        - overLimit
      additionalProperties: false
    BillingIuAccount:
      description: >-
        IU (Intelligence Unit) account snapshot (AI-3079 slice 2a) — one pool
        per org, storefront and buyer usage combined. Null unless
        `iu-account-experience` is on for this org. Display-only: nothing here
        drives a charge (AI-3079 slice 2b).
      nullable: true
      type: object
      properties:
        planKey:
          type: string
          enum:
            - metered
            - committed_1k
            - committed_3k
        commitmentMinor:
          description: >-
            Monthly commitment, minor units of `currency` (0 for the metered
            plan).
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        currency:
          description: >-
            Currency of commitmentMinor/perIuOverageMinor, frozen from the
            accepted Rate Card binding (AI-3079 multi-currency ruling,
            2026-07-19). USD for an unbound org.
          type: string
          enum:
            - USD
            - EUR
            - GBP
            - AUD
        perIuOverageMinor:
          description: >-
            Pay-as-you-go / overage rate in minor USD units. Uses the active
            accepted Rate Card binding snapshot when present; otherwise the
            unratified display default pending AI-3027.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        rolloverPolicy:
          description: >-
            Accepted rollover terms for included IUs, or null when this plan
            does not roll over. Binding-backed values come from the immutable
            acceptance snapshot.
          nullable: true
          type: object
          properties:
            capBasisPoints:
              type: integer
              minimum: 1
              maximum: 10000
            expiresAfterBillingPeriods:
              type: integer
              maximum: 9007199254740991
              minimum: 1
          required:
            - capBasisPoints
            - expiresAfterBillingPeriods
          additionalProperties: false
        cycle:
          description: Calendar-month cycle key, e.g. '2026-07'.
          type: string
        cycleStart:
          type: string
        cycleEnd:
          type: string
        usedIus:
          description: >-
            Rated, customer-bearer-only IU usage this cycle. Rated against the
            bound Rate Card activity terms when ratingTerms.source is "binding";
            otherwise the UNRATIFIED default weights in iu-rating-config.ts.
          type: number
        buckets:
          type: object
          properties:
            free:
              $ref: '#/components/schemas/IuBucketBalance'
            rollover:
              $ref: '#/components/schemas/IuBucketBalance'
            included:
              $ref: '#/components/schemas/IuBucketBalance'
            overage:
              $ref: '#/components/schemas/IuOverageStatus'
          required:
            - free
            - rollover
            - included
            - overage
          additionalProperties: false
        forecast:
          type: object
          properties:
            projectedIusThisCycle:
              description: Linear run-rate projection of total IUs by cycle end.
              type: number
            projectedOverageMinor:
              type: integer
              minimum: -9007199254740991
              maximum: 9007199254740991
          required:
            - projectedIusThisCycle
            - projectedOverageMinor
          additionalProperties: false
        ratingTerms:
          $ref: '#/components/schemas/BillingIuAccountRatingTerms'
      required:
        - planKey
        - commitmentMinor
        - currency
        - perIuOverageMinor
        - rolloverPolicy
        - cycle
        - cycleStart
        - cycleEnd
        - usedIus
        - buckets
        - forecast
        - ratingTerms
      additionalProperties: false
    BillingBillingInfo:
      type: object
      properties:
        contactName:
          description: Billing contact / payer name
          nullable: true
          type: string
        email:
          description: Email addresses invoices are sent to
          type: array
          items:
            type: string
        ccEmails:
          description: Email addresses CC’d on invoices
          type: array
          items:
            type: string
        phone:
          description: Billing phone number
          nullable: true
          type: string
        address:
          description: Billing street address, line 1
          nullable: true
          type: string
        address2:
          description: Billing street address, line 2
          nullable: true
          type: string
        city:
          description: Billing city
          nullable: true
          type: string
        region:
          description: Billing state/province/region
          nullable: true
          type: string
        postalCode:
          description: Billing postal/ZIP code
          nullable: true
          type: string
        countryAlpha2:
          description: Billing country (ISO 3166-1 alpha-2)
          nullable: true
          type: string
        taxId:
          description: Tax/VAT identifier shown on invoices
          nullable: true
          type: string
        visibility:
          description: >-
            `redacted` for an org-scoped service-token caller: payment-detail
            fields (`redactedFields`) are elided — scalar fields are nulled,
            array fields (`email`, `ccEmails`) are emptied to `[]` — so an agent
            can tell "not allowed" from "empty".
          type: string
          enum:
            - visible
            - redacted
        redactedFields:
          type: array
          items:
            type: string
      required:
        - contactName
        - email
        - ccEmails
        - phone
        - address
        - address2
        - city
        - region
        - postalCode
        - countryAlpha2
        - taxId
        - visibility
        - redactedFields
      additionalProperties: false
    BillingPaymentMethod:
      description: >-
        The org’s active card-rail payment method (AI-3078). Null until one is
        added — never a PAN, never a PSP token.
      nullable: true
      type: object
      properties:
        kind:
          type: string
          enum:
            - CARD
        brand:
          nullable: true
          type: string
        last4:
          nullable: true
          type: string
        expiresMonth:
          nullable: true
          type: integer
          minimum: 1
          maximum: 12
        expiresYear:
          nullable: true
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        status:
          type: string
          enum:
            - pending_verification
            - verified
            - detached
      required:
        - kind
        - brand
        - last4
        - expiresMonth
        - expiresYear
        - status
      additionalProperties: false
    BillingStorefrontBillingSummary:
      description: >-
        Commercial-terms summary only — null for an org with no seller role.
        Payout bank details stay on their own surface (AI-2832), never
        duplicated here.
      nullable: true
      type: object
      properties:
        onboardingStatus:
          type: string
          enum:
            - pending
            - complete
        platformFeePercent:
          nullable: true
          type: number
        currency:
          nullable: true
          type: string
        defaultNetDays:
          nullable: true
          type: number
      required:
        - onboardingStatus
        - platformFeePercent
        - currency
        - defaultNetDays
      additionalProperties: false
    CreditApplicationResponse:
      description: A single credit application.
      type: object
      properties:
        id:
          description: Surrogate id of the application row (BIGINT serialized as string).
          example: '42'
          type: string
        customerId:
          description: >-
            Credit-bearing customer the application is for (PARENT or
            STANDALONE).
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        customerName:
          description: >-
            Display name of the applicant account (company name, falling back to
            the customer's name). Resolved server-side from the core customer
            record; null on buyer-facing reads or when the customer cannot be
            resolved.
          nullable: true
          type: string
        requestedCreditLimit:
          description: Requested limit in currency minor units.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        currency:
          description: ISO 4217 currency of the limits on this application.
          type: string
        status:
          description: >-
            Lifecycle state. `PENDING` until a superadmin decides; `APPROVED`
            once a limit is granted (and `customer_standing.credit_limit` is
            raised); `REJECTED` when declined; `WITHDRAWN` when the applicant
            pulls it before a decision.
          type: string
          enum:
            - PENDING
            - APPROVED
            - REJECTED
            - WITHDRAWN
        justification:
          description: Free-text context supplied on submit. Null when not given.
          nullable: true
          type: string
        grantedCreditLimit:
          description: >-
            Limit granted by the superadmin, in currency minor units. Null until
            approved.
          nullable: true
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        reviewedBy:
          description: >-
            User id of the superadmin who decided (BIGINT serialized as string).
            Null while pending.
          nullable: true
          type: string
        reviewerName:
          description: >-
            Display name (or email) of the superadmin who decided, resolved
            server-side from the core user record. Null while pending, on
            buyer-facing reads, or when the reviewer cannot be resolved.
          nullable: true
          type: string
        reviewedAt:
          description: When the decision was recorded (ISO 8601). Null while pending.
          nullable: true
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        reviewerNotes:
          description: Superadmin note attached to the decision. Null while pending.
          nullable: true
          type: string
        createdAt:
          description: When the application was submitted (ISO 8601).
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
        updatedAt:
          description: When the row was last modified (ISO 8601).
          type: string
          format: date-time
          pattern: >-
            ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
      required:
        - id
        - customerId
        - customerName
        - requestedCreditLimit
        - currency
        - status
        - justification
        - grantedCreditLimit
        - reviewedBy
        - reviewerName
        - reviewedAt
        - reviewerNotes
        - createdAt
        - updatedAt
      additionalProperties: false
    BillingDeposit:
      description: >-
        One prepay deposit, projected read-only from the ledger’s DEPOSIT
        journal entries.
      type: object
      properties:
        id:
          description: Ledger journal-entry id of the deposit.
          type: string
        amountMinor:
          description: Deposit amount credited to the org’s funds, minor units as a string.
          type: string
        currency:
          type: string
        occurredAt:
          description: When the deposit took effect (ISO 8601).
          type: string
        status:
          type: string
          enum:
            - POSTED
            - REVERSED
        provider:
          description: Payment provider recorded on the deposit, when known.
          nullable: true
          type: string
        reference:
          description: >-
            The payment reference supplied when the deposit was recorded (e.g. a
            wire reference).
          nullable: true
          type: string
      required:
        - id
        - amountMinor
        - currency
        - occurredAt
        - status
        - provider
        - reference
      additionalProperties: false
    BillingAgreement:
      type: object
      properties:
        contractId:
          nullable: true
          type: string
        status:
          type: string
          enum:
            - active
            - no_contract
            - inherited_active
            - inherited_hidden
            - organization_contract_missing
        agreementKind:
          nullable: true
          type: string
          enum:
            - STANDARD_TOS
            - CUSTOM_CONTRACT
            - AAA
        effectiveDate:
          nullable: true
          type: string
        endDate:
          nullable: true
          type: string
        acceptedAt:
          nullable: true
          type: string
        acceptedByEmail:
          nullable: true
          type: string
      required:
        - contractId
        - status
        - agreementKind
        - effectiveDate
        - endDate
        - acceptedAt
        - acceptedByEmail
      additionalProperties: false
    LedgerAccountBalance:
      description: One ledger account and its current balance for the customer.
      type: object
      properties:
        code:
          description: Stable ledger account handle, e.g. `customer:42:USD:buyer_funds`.
          example: customer:42:USD:buyer_funds
          type: string
        kind:
          description: >-
            Accounting category of the account. STATISTICAL/CONTRA accounts are
            excluded from this balance-sheet view.
          type: string
          enum:
            - ASSET
            - LIABILITY
            - EQUITY
            - REVENUE
            - EXPENSE
        balanceMinor:
          description: >-
            Signed balance in currency minor units (per the account kind’s
            normal side), as a string.
          example: '10000000'
          type: string
          pattern: ^-?\d+$
        currency:
          $ref: '#/components/schemas/LedgerCurrency'
      required:
        - code
        - kind
        - balanceMinor
        - currency
      additionalProperties: false
    IuBucketBalance:
      type: object
      properties:
        granted:
          description: >-
            Total IUs available in this bucket for the cycle (0 for buckets the
            plan/grants do not carry).
          type: number
        used:
          description: IUs drawn from this bucket this cycle.
          type: number
        remaining:
          type: number
      required:
        - granted
        - used
        - remaining
      additionalProperties: false
    IuOverageStatus:
      type: object
      properties:
        ius:
          description: IUs consumed beyond every other bucket this cycle.
          type: number
        minor:
          description: >-
            Overage-to-date, minor USD units. Display only — AI-3079 slice 2b
            charges it.
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        capMinor:
          description: Uncharged-overage cap, minor USD units (display only in this slice).
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        warnAtMinor:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
        overWarnThreshold:
          type: boolean
        overCap:
          type: boolean
      required:
        - ius
        - minor
        - capMinor
        - warnAtMinor
        - overWarnThreshold
        - overCap
      additionalProperties: false
    BillingIuAccountRatingTerms:
      type: object
      properties:
        source:
          description: >-
            "binding" when an accepted Rate Card binding supplied this cycle's
            activity, overage, and rollover terms; "default" when the org is
            unbound and the display uses UNRATIFIED defaults.
          type: string
          enum:
            - binding
            - default
        revisionId:
          description: >-
            The storefront_rate_card_binding id whose activity terms rated this
            cycle, or null under "default".
          nullable: true
          type: string
      required:
        - source
        - revisionId
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API key or access token

````