Previous
Session management
The billing client API allows you to retrieve billing information from Viam.
Billing client API methods are only available in the Python and TypeScript SDKs.
The billing client API supports the following methods:
Method Name | Description |
---|---|
GetCurrentMonthUsage | Access data usage information for the current month for a given organization. |
GetOrgBillingInformation | Access billing information (payment method, billing tier, etc.) for a given org. |
GetInvoicesSummary | Access total outstanding balance plus invoice summaries for a given org. |
GetInvoicePdf | Access invoice PDF data and optionally save it to a provided file path. |
Access data usage information for the current month for a given organization. You can also find your usage data on the Payment and billing page.
Parameters:
org_id
(str) (required): the ID of the organization to request usage data for.timeout
(float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.Returns:
Example:
usage = await billing_client.get_current_month_usage("<ORG-ID>")
For more information, see the Python SDK Docs.
Parameters:
orgId
(string) (required): The organization ID.Returns:
Example:
const usage = await billing.getCurrentMonthUsage('<organization-id>');
For more information, see the TypeScript SDK Docs.
Access billing information (payment method, billing tier, etc.) for a given org. You can also find this information on the Payment and billing page.
Parameters:
org_id
(str) (required): the ID of the org to request data for.timeout
(float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.Returns:
Example:
information = await billing_client.get_org_billing_information("<ORG-ID>")
For more information, see the Python SDK Docs.
Parameters:
orgId
(string) (required): The organization ID.Returns:
Example:
const billingInfo = await billing.getOrgBillingInformation(
'<organization-id>'
);
For more information, see the TypeScript SDK Docs.
Access total outstanding balance plus invoice summaries for a given org.
Parameters:
org_id
(str) (required): the ID of the org to request data for.timeout
(float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.Returns:
Example:
summary = await billing_client.get_invoices_summary("<ORG-ID>")
For more information, see the Python SDK Docs.
Parameters:
orgId
(string) (required): The organization ID.Returns:
Example:
const invoicesSummary = await billing.getInvoicesSummary(
'<organization-id>'
);
For more information, see the TypeScript SDK Docs.
Access invoice PDF data and optionally save it to a provided file path. You can also find your invoices on the Payment and billing page.
Parameters:
invoice_id
(str) (required): the ID of the invoice being requested.org_id
(str) (required): the ID of the org to request data from.dest
(str) (required): the filepath to save the invoice to.timeout
(float) (optional): An option to set how long to wait (in seconds) before calling a time-out and closing the underlying RPC call.Returns:
Example:
await billing_client.get_invoice_pdf("<INVOICE-ID>", "<ORG-ID>", "invoice.pdf")
For more information, see the Python SDK Docs.
Parameters:
id
(string) (required): The invoice ID.orgId
(string) (required): The organization ID.Returns:
Example:
const invoicePdf = await billing.getInvoicePdf(
'<invoice-id>',
'<organization-id>'
);
For more information, see the TypeScript SDK Docs.
Was this page helpful?
Glad to hear it! If you have any other feedback please let us know:
We're sorry about that. To help us improve, please tell us what we can do better:
Thank you!