Skip to content

billing

9 calls. Every request needs the Authorization header: see the overview.

GET /billing/alerts

The low-balance and work-refused alerts the tenant’s admins get.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Response: LowBalanceAlertSettings (200)

curl -X GET "https://api.maitento.com/billing/alerts" \
-H "Authorization: $MAITENTO_AUTH"
PUT /billing/alerts

Replaces the alerts (Tenant.Admin).

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Request body: LowBalanceAlertSettingsInput

FieldTypeRequiredDescription
emailAtPercentOfLastTopUpinteger | nullEmail when the balance falls to this percentage of the last top-up; null for no email.
showPortalBannerbooleanShow a banner in the portal while the balance is low: below LowBalanceAlertSettings.EmailAtPercentOfLastTopUp of the last top-up, or below 20% of it when the email is off. The billing standing’s lowBalance says when.
emailWhenWorkRefusedbooleanEmail when work is refused because the balance has run out.

Response: LowBalanceAlertSettings (200)

curl -X PUT "https://api.maitento.com/billing/alerts" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"emailAtPercentOfLastTopUp":0,"showPortalBanner":false,"emailWhenWorkRefused":false}'
GET /billing/auto-top-up

The automatic top-up: whether it’s on, when it buys credit and how much, and whether it stopped.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Response: AutoTopUpView (200)

curl -X GET "https://api.maitento.com/billing/auto-top-up" \
-H "Authorization: $MAITENTO_AUTH"
PUT /billing/auto-top-up

Turns the automatic top-up on or off, or changes it (Tenant.Admin). Saving it again restarts one that stopped.

Who can call it: Tenant admins only, with an API key or a portal session. Try it in the API playground.

Request body: AutoTopUpApiRequest

FieldTypeRequiredDescription
enabledboolean
thresholdAmountnumberBuy more when the balance falls below this, in the billing currency.
topUpAmountnumberHow much to buy each time; at least the minimum top-up.

Response: AutoTopUpView (200)

curl -X PUT "https://api.maitento.com/billing/auto-top-up" \
-H "Authorization: $MAITENTO_AUTH" \
-H "Content-Type: application/json" \
-d '{"enabled":false,"thresholdAmount":0,"topUpAmount":0}'
GET /billing/balance

The balance, and whether it can pay for more work.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Response: TenantBalance (200)

curl -X GET "https://api.maitento.com/billing/balance" \
-H "Authorization: $MAITENTO_AUTH"
GET /billing/catalogue

The plans on sale, cheapest first, with what each includes and costs (the tenant’s own plan among them).

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Response: BillingCatalogue (200)

curl -X GET "https://api.maitento.com/billing/catalogue" \
-H "Authorization: $MAITENTO_AUTH"
GET /billing/notices

The tenant’s latest billing notices (what its Billing webhooks were sent), newest first.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Query parameters

NameTypeRequiredDescription
limitinteger

Response: BillingNotice[] (200)

curl -X GET "https://api.maitento.com/billing/notices" \
-H "Authorization: $MAITENTO_AUTH"
GET /billing/plan

What the plan includes and costs: allowances, lanes, limits, retention, priority and prices.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Response: EffectiveEntitlements (200)

curl -X GET "https://api.maitento.com/billing/plan" \
-H "Authorization: $MAITENTO_AUTH"
GET /billing/standing

Where the tenant stands: its plan and its state, its balance, whether it can start work (out of credit, or an allowance used up), any plan change on its way, and this billing period’s use of each allowance.

Who can call it: Admins and members, with an API key or a portal session. Try it in the API playground.

Response: BillingStanding (200)

curl -X GET "https://api.maitento.com/billing/standing" \
-H "Authorization: $MAITENTO_AUTH"