WhatsApp funding and usage for Tech Providers with managed billing: funding status per WhatsApp Business Account (WABA) and portfolio, recorded charges, and stopping funding.
Usage amounts are in micro USD (customer_charge_micro_usd).
Summary
Functions
Verifies an external multi-partner solution account with Meta and ensures Kapso funds it, without waiting for Meta's webhook. Call it after Embedded Signup completes.
Gets the funding status of a WABA.
Gets the charges recorded for a WABA between start_time and end_time.
Gets the status of a funding revocation operation.
Gets the charges recorded across a portfolio's accounts between start_time and end_time.
Lists the WABAs of a business portfolio with their funding status. Params: limit, before, after.
Queues an asynchronous stop of Kapso funding for a portfolio.
Types
@type result() :: {:ok, map()} | {:error, KapsoEx.Error.t()}
@type time() :: DateTime.t() | String.t()
Functions
@spec ensure_account_funding(KapsoEx.Client.t(), String.t(), String.t()) :: result()
Verifies an external multi-partner solution account with Meta and ensures Kapso funds it, without waiting for Meta's webhook. Call it after Embedded Signup completes.
@spec get_account_funding(KapsoEx.Client.t(), String.t()) :: result()
Gets the funding status of a WABA.
@spec get_account_usage(KapsoEx.Client.t(), String.t(), time(), time()) :: result()
Gets the charges recorded for a WABA between start_time and end_time.
@spec get_funding_operation(KapsoEx.Client.t(), String.t(), String.t()) :: result()
Gets the status of a funding revocation operation.
@spec get_portfolio_usage(KapsoEx.Client.t(), String.t(), time(), time()) :: result()
Gets the charges recorded across a portfolio's accounts between start_time and end_time.
@spec list_portfolio_accounts(KapsoEx.Client.t(), String.t(), map() | keyword()) :: result()
Lists the WABAs of a business portfolio with their funding status. Params: limit, before, after.
@spec revoke_portfolio_funding(KapsoEx.Client.t(), String.t(), String.t()) :: result()
Queues an asynchronous stop of Kapso funding for a portfolio.
idempotency_key (1-255 bytes) must be stable per logical request:
reuse it when retrying after a network failure to get the original
operation back. Follow it with get_funding_operation/3.