@getdial/sdk - v0.21.0
    Preparing search index...

    Type Alias BillingActivityItem

    BillingActivityItem:
        | {
            attribution: "wallet"
            | "entitlement";
            balanceAfterCents: number;
            billedQuantity: number;
            callId: string | null;
            fareName: string;
            messageId: string | null;
            number: string | null;
            occurredAt: string;
            phoneNumberId: string;
            totalCents: number;
            type: "usage";
        }
        | {
            amountCents: number;
            balanceAfterCents: number;
            invoiceId: string
            | null;
            kind: "card" | "welcome" | "manual";
            occurredAt: string;
            type: "credit";
        }
        | {
            amountCents: number;
            balanceAfterCents: number;
            invoiceId: string;
            occurredAt: string;
            reason: string;
            type: "payment";
        }

    One activity item, discriminated by type:

    • usage — a call/SMS/number-ownership charge.
    • credit — a wallet credit (top-up / welcome / manual grant).
    • payment — a subscription invoice (initial / renewal / proration).

    Every item carries balanceAfterCents: the credit-wallet balance in USD cents immediately after this row — a running balance (the newest item equals the current wallet balance). Rows that don't move the wallet (payment, subscription-covered usage) carry the balance as of their moment.

    Type Declaration

    • {
          attribution: "wallet" | "entitlement";
          balanceAfterCents: number;
          billedQuantity: number;
          callId: string | null;
          fareName: string;
          messageId: string | null;
          number: string | null;
          occurredAt: string;
          phoneNumberId: string;
          totalCents: number;
          type: "usage";
      }
      • attribution: "wallet" | "entitlement"
      • balanceAfterCents: number
      • billedQuantity: number
      • callId: string | null

        Id of the call that incurred it (call fares only; null otherwise).

      • fareName: string
      • messageId: string | null

        Id of the message that incurred it (SMS fares only; null otherwise).

      • number: string | null

        The number this usage was billed for, or null if it has since been deleted.

      • occurredAt: string
      • phoneNumberId: string
      • totalCents: number
      • type: "usage"
    • {
          amountCents: number;
          balanceAfterCents: number;
          invoiceId: string | null;
          kind: "card" | "welcome" | "manual";
          occurredAt: string;
          type: "credit";
      }
    • {
          amountCents: number;
          balanceAfterCents: number;
          invoiceId: string;
          occurredAt: string;
          reason: string;
          type: "payment";
      }