Skip to main content

Methods

List credit activity
TypeScript
GET /v1/organizations/{organizationId}/billing/credit/activityList invoices
TypeScript
GET /v1/organizations/{organizationId}/billing/invoicesGet the project’s effective billing terms
TypeScript
GET /v1/organizations/{organizationId}/billing/projects/{projectId}/termsGet organization billing overview
TypeScript
GET /v1/organizations/{organizationId}/billingGet organization credit
TypeScript
GET /v1/organizations/{organizationId}/billing/creditGet organization payment method
TypeScript
GET /v1/organizations/{organizationId}/billing/payment-methodGet the organization’s effective billing terms
TypeScript
GET /v1/organizations/{organizationId}/billing/termsChange plan
TypeScript
POST /v1/organizations/{organizationId}/billing/projects/{projectId}/purchaseCreate payment method checkout
TypeScript
POST /v1/organizations/{organizationId}/billing/checkoutPreview an organization billing change
TypeScript
POST /v1/organizations/{organizationId}/billing/previewPreview a project billing change
TypeScript
POST /v1/organizations/{organizationId}/billing/projects/{projectId}/preview

Models

ListCreditActivityResponse

array of CreditActivity
required
Newest first.
integer | null
required
Pass as page to read the next page. Null on the last page.

ListInvoicesResponse

array of Invoice
required
string | null
required
Pass as cursor to read the next page. Null on the last page.

GetEffectiveTermsResponse

array of SubscriptionTerms
required
One entry per category the project holds, by category. Empty means it holds none.
string
required
The IANA time zone the payer is billed in, e.g. America/Los_Angeles. Billing periods start and end at its midnights, so read their calendar dates in it.

GetOrganizationBillingOverviewResponse

OrganizationBillingPeriod | null
required
Charges so far this billing period, for an organization that pays by invoice; null for one that pays by card, or while its projects are still being moved to its billing day.
integer
required
Bumps on every entitlement change for the organization.
OrganizationSubscription | null
required
The organization-owned subscription, or null when billing was never opened or has ended.

GetOrganizationCreditResponse

integer
required
Credit left to offset the organization’s next invoices, in cents: on credit notes, and in its wallet, granted to it or purchased. Zero when none is left.
string
required
ISO currency code.

GetOrganizationPaymentMethodResponse

BillingAgreement
required
How the organization pays: self_serve by card, each purchase paid when made; enterprise by invoice on its contract’s terms, its purchases added to its next monthly invoice.
boolean
required
True once a card is captured for the payer.
PaymentMethod | null
required
Metadata for the default card, or null.
PurchaseRefusal | null
required
Why the organization can’t pay for a purchase now, or null when it can. payment_method_required: add a card first; an organization that pays by invoice never needs one. billing_not_ready: its billing is still being set up; try again shortly. Decide purchases on this, not on cardOnFile.

GetOrganizationTermsResponse

OrganizationSubscriptionTerms | null
required
What one subscription is billed on now. plan is the plan as this subscription has it: its own prices when overridden, each fixed charge at the subscription’s price and quantity, and entitlements resolved with overrides. The organization’s own subscription, or null when it holds none.
string
required
The IANA time zone the payer is billed in, e.g. America/Los_Angeles. Billing periods start and end at its midnights, so read their calendar dates in it.

TerminalBillingOperation

One of: SucceededBillingOperation
null
required
BillingOperationKind
required
string
required
Stable handle for this provisioning action.
null
required
string | null
required
BillingOperationResult
required
"succeeded"
required
Terminal. The result is authoritative.
string | null
required
One of: FailedBillingOperation
BillingOperationFailure
required
BillingOperationKind
required
string
required
Stable handle for this provisioning action.
null
required
string | null
required
null
required
"failed"
required
Terminal. Failure contains a stable code and retryability.
string | null
required

PendingBillingOperation

null
required
BillingOperationKind
required
string
required
Stable handle for this provisioning action.
BillingPaymentAction | null
required
Set while a payment the operation waits for needs the customer’s authentication. Completing it within the payment window completes the operation.
null
required
null
required
"pending"
required
Accepted and still executing. Poll the operation route.
string | null
required

CreateOrganizationPaymentMethodCheckoutResponse

string (uri)
required
Hosted Stripe page; send the user here.

PreviewOrganizationChangeResponse

integer | null
required
The payer’s credit balance once dueNow is charged: the credit the change issues included, less what dueNow uses. In dueNow’s currency. Null when the change charges nothing now (a downgrade).
BillingChangeEffect
required
What the change does beside what it bills, by the kind of change requested: fixed_charge for a fixed-charge change, plan_change for a plan change.
BillingPreviewDeferred
required
Billed later rather than with dueNow: one line per plan change addition, billed when it is added and priced as if added now; or, for an organization that pays by invoice, what a fixed-charge change adds to its next invoice. After coupons, before taxes; the balance left after dueNow applies to it first. nextCharge already includes it. No lines when nothing is billed later.
BillingPreviewInvoice
required
An invoice priced by the billing engine as it would bill it: its lines, then what coupons, taxes and credits change, and what the payer is charged. No lines when it bills nothing.
BillingNextCharge | null
required
What is charged next for all that is held after the change: the first of upcomingInvoices, at its time and total, after coupons, with taxes, before credits. For a downgrade, the target plan’s first charge at the period end. Usage and a minimum commitment are billed after the period. Null when nothing is charged, or the subscription ends first.
string | null
required
For an organization that pays by invoice: when its next monthly invoice is drafted, which bills the change instead of dueNow. A fixed-charge change’s units go on it, in dueLater; an upgrade’s new plan and dueLater too, while dueNow is the replaced plan’s invoice, issued at once and due on the organization’s terms. Null when dueNow is charged with the change.
string
required
The IANA time zone the payer is billed in, e.g. America/Los_Angeles. Billing periods start and end at its midnights, so read their calendar dates in it.
array of BillingUpcomingInvoice
required
The invoices the subscription the change leaves issues in the following periods, assuming no later change: one, and another while a coupon with an end discounted the last, so the last listed is the price from then on. At most 24. For a change at the period end (a downgrade, or the held plan kept), the first is what the invoice due then bills for it.

PreviewProjectChangeResponse

integer | null
required
The payer’s credit balance once dueNow is charged: the credit the change issues included, less what dueNow uses. In dueNow’s currency. Null when the change charges nothing now (a downgrade).
BillingChangeEffect
required
What the change does beside what it bills, by the kind of change requested: fixed_charge for a fixed-charge change, plan_change for a plan change.
BillingPreviewDeferred
required
Billed later rather than with dueNow: one line per plan change addition, billed when it is added and priced as if added now; or, for an organization that pays by invoice, what a fixed-charge change adds to its next invoice. After coupons, before taxes; the balance left after dueNow applies to it first. nextCharge already includes it. No lines when nothing is billed later.
BillingPreviewInvoice
required
An invoice priced by the billing engine as it would bill it: its lines, then what coupons, taxes and credits change, and what the payer is charged. No lines when it bills nothing.
BillingNextCharge | null
required
What is charged next for all that is held after the change: the first of upcomingInvoices, at its time and total, after coupons, with taxes, before credits. For a downgrade, the target plan’s first charge at the period end. Usage and a minimum commitment are billed after the period. Null when nothing is charged, or the subscription ends first.
string | null
required
For an organization that pays by invoice: when its next monthly invoice is drafted, which bills the change instead of dueNow. A fixed-charge change’s units go on it, in dueLater; an upgrade’s new plan and dueLater too, while dueNow is the replaced plan’s invoice, issued at once and due on the organization’s terms. Null when dueNow is charged with the change.
string
required
The IANA time zone the payer is billed in, e.g. America/Los_Angeles. Billing periods start and end at its midnights, so read their calendar dates in it.
array of BillingUpcomingInvoice
required
The invoices the subscription the change leaves issues in the following periods, assuming no later change: one, and another while a coupon with an end discounted the last, so the last listed is the price from then on. At most 24. For a change at the period end (a downgrade, or the held plan kept), the first is what the invoice due then bills for it.