Docs
/
/

Billing mAPI reference

Complete reference documentation for the Billing resource.

Billing

#

Use the billing API to retrieve a snapshot of your account's current draft invoice, including amount due, plan, per-metric usage, and remaining credit blocks. See Knock plans for details on plans and usage.

Get billing summary

#

Returns a snapshot of the current draft invoice for the account, including amount due, plan, per-metric usage, and remaining credit blocks.

Endpoint

GET/v1/billing/summary

Returns

A snapshot of the current draft Orb invoice for the account, including plan, per-metric usage, and remaining credit blocks.

amount_due
string

The amount due on the draft invoice, as a decimal string.

credits
BillingCreditBlock[]

Unexpired Orb credit blocks for custom pricing units on the draft invoice, including scheduled and depleted allotments.

currency
string
Required

The Orb custom pricing-unit identifier, such as mnr_credits or ai_credits.

effective_at
string(date-time)
Required

When the block becomes effective.

expires_at
string(date-time)
Required

When the block expires.

id
string
Required

The Orb credit block id.

name
string
Required

The display name for the credit currency.

quantity
number
Required

The block's original allocation.

remaining
number
Required

The block's remaining balance.

status
enum(string)
Required

Derived block status: scheduled when not yet effective, depleted when remaining is zero or less, otherwise active.

activedepletedscheduled
currency
string

The invoice currency code, such as USD.

invoice_id
string

The Orb draft invoice id, if present.

period_end
string(date-time)

The end of the current usage period, hoisted from the first usage line item.

period_start
string(date-time)

The start of the current usage period, hoisted from the first usage line item.

plan
object

The Knock plan currently assigned to the account.

display_name
string

The human-readable plan name.

id
string

The unique identifier of the plan.

type
enum(string)

The plan type.

freestartergrowthenterprise
target_date
string(date)

The date the draft invoice is scheduled to be issued.

usage
BillingUsageRecord[]

Per-metric usage line items from the draft invoice.

amount
string
Required

The billed dollar amount for this metric after credits and adjustments.

credits_applied
integer
Required

Prepaid credits applied to this metric during the current service period.

metric_id
string
Required

The Orb billable metric id.

name
string
Required

The Orb billable metric name.

pricing_currency
string
Required

The Orb price currency for this line item, used to correlate usage with credit blocks.

quantity
integer
Required

Orb line-item usage quantity for this period. This is not replaced by credits_applied.

quantity_type
enum(string)
Required

Whether the GraphQL usage quantity is raw usage or credits applied. Prefer quantity and credits_applied for new clients.

usagecredits

Returned when the account exceeds one request per second for this endpoint.

BillingSummary

#

A snapshot of the current draft Orb invoice for the account, including plan, per-metric usage, and remaining credit blocks.

Attributes

amount_due
string

The amount due on the draft invoice, as a decimal string.

credits
BillingCreditBlock[]

Unexpired Orb credit blocks for custom pricing units on the draft invoice, including scheduled and depleted allotments.

currency
string
Required

The Orb custom pricing-unit identifier, such as mnr_credits or ai_credits.

effective_at
string(date-time)
Required

When the block becomes effective.

expires_at
string(date-time)
Required

When the block expires.

id
string
Required

The Orb credit block id.

name
string
Required

The display name for the credit currency.

quantity
number
Required

The block's original allocation.

remaining
number
Required

The block's remaining balance.

status
enum(string)
Required

Derived block status: scheduled when not yet effective, depleted when remaining is zero or less, otherwise active.

activedepletedscheduled
currency
string

The invoice currency code, such as USD.

invoice_id
string

The Orb draft invoice id, if present.

period_end
string(date-time)

The end of the current usage period, hoisted from the first usage line item.

period_start
string(date-time)

The start of the current usage period, hoisted from the first usage line item.

plan
object

The Knock plan currently assigned to the account.

display_name
string

The human-readable plan name.

id
string

The unique identifier of the plan.

type
enum(string)

The plan type.

freestartergrowthenterprise
target_date
string(date)

The date the draft invoice is scheduled to be issued.

usage
BillingUsageRecord[]

Per-metric usage line items from the draft invoice.

amount
string
Required

The billed dollar amount for this metric after credits and adjustments.

credits_applied
integer
Required

Prepaid credits applied to this metric during the current service period.

metric_id
string
Required

The Orb billable metric id.

name
string
Required

The Orb billable metric name.

pricing_currency
string
Required

The Orb price currency for this line item, used to correlate usage with credit blocks.

quantity
integer
Required

Orb line-item usage quantity for this period. This is not replaced by credits_applied.

quantity_type
enum(string)
Required

Whether the GraphQL usage quantity is raw usage or credits applied. Prefer quantity and credits_applied for new clients.

usagecredits
New chat