BillingService
plany.billing.v1.BillingService — prices, your balance, and what you spent it on.
Plany is prepaid: your account holds a balance of credit, your plan adds credit each month, and what you run draws it down. This service tells you what things cost, what you have left, and where it went.
Prices
These need no credential, so you can price something before you have an account.
| Call | What it returns |
|---|---|
ListPlans, GetPlan | The plans, their monthly price and the credit each includes. |
ListSkus, GetSku | Every price Plany charges. GetSku takes the full name, skus/{sku}. |
EstimateCost | What some usage would cost. Pass plan to compare plans, or account for your own rates. |
grpcurl -d '{}' api.plany.cloud:443 plany.billing.v1.BillingService/ListPlansYour balance
GetBillingAccount on accounts/{account}/billing returns your plan, your
balance, the current period, your burn rate over the last day and, from that,
when the balance is projected to run out.
BillingReading what you spent
| Call | What it returns |
|---|---|
ListLedgerEntries | Every grant and charge on the account, dated, each with an explanation of how it was priced. |
QueryCosts | Spend over an interval, grouped by SKU, project, region, service, day or hour. |
plany billing costsAdding credit and changing plan
Credit is bought, and plans are subscribed to, in the console: Billing → Add
credit or Billing → Plans. Payment is taken on Stripe's own checkout page,
so a card never passes through your code or Plany's API. plany billing topup
prints the link.
Money
Every amount is google.type.Money — currency_code, units and nanos. An
account's currency is fixed when it is created, and every amount on it uses that
one. Add amounts up with integer arithmetic, never floating point.
Permissions
| Permission | Lets you |
|---|---|
billing.accounts.get | Read the balance and plan. |
billing.ledgerEntries.list | Read the ledger. |
billing.costs.query | Query costs. |
billing.credit.purchase | Buy credit and subscribe to plans. |