Skip to the documentation
API

Billing

Every operation in this group: what it accepts, what it returns and the errors it can answer with.

Operations

The plan of the workspace and what it costs, as Billing shows them: what the plan includes and how much of it is used, the plans on sale, pay as you go, every charge with its invoice, and the links that start a checkout or open the billing portal.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Nothing is paid through the API. Starting a checkout, opening the billing portal and adding a card for pay as you go each return a link to the billing provider's page, where the person pays, changes the card or cancels, as they do from the app.

GET/billing

Read the plan

Scopesbilling:readReads

The plan of the workspace and what it includes: the billing interval, when it renews or ends and the next charge, how many domains it holds, how much of the sends and AI actions are used, and pay as you go. metered is false while billing is switched off, and then nothing is capped.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:read scope.

Returns

The plan and what it includes.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.billing.get()
Python
billing.get()
Ruby
billing.get
PHP
billing->get
Go
Billing.Get
Java
billing().get
C#
Billing.GetAsync
CLI
openemail billing get
MCP
getBilling

GET/billing/plans

List the plans

Scopesbilling:readReads

Every plan, cheapest first, with its price and what it includes. available says whether it is on sale, and intervals the billing intervals it is sold at.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:read scope.

Returns

Every plan.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.billing.listPlans()
Python
billing.list_plans()
Ruby
billing.list_plans
PHP
billing->listPlans
Go
Billing.ListPlans
Java
billing().listPlans
C#
Billing.ListPlansAsync
CLI
openemail billing list-plans
MCP
listBillingPlans

GET/billing/usage

Read the usage history

Scopesbilling:readReads

Sends and AI actions per day, and what pay as you go extras cost per month, as the Usage charts show them.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:read scope.

Query parameters

daysinteger | string

How many days back to go, 1 to 3660, or all for every day since the workspace was made. 30 by default.

Returns

Usage per day and extras per month.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.billing.getUsage()
Python
billing.get_usage()
Ruby
billing.get_usage
PHP
billing->getUsage
Go
Billing.GetUsage
Java
billing().getUsage
C#
Billing.GetUsageAsync
CLI
openemail billing get-usage
MCP
getBillingUsage

GET/billing/alerts

List the billing alerts

Scopesbilling:readReads

What the billing banner of the app would say now, most urgent first: a failed payment, paused pay as you go, sending or AI paused at a limit, a plan about to end, an allowance nearly used and a charge coming soon. An empty list means there is nothing to say.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:read scope.

Returns

The alerts, most urgent first.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.billing.listAlerts()
Python
billing.list_alerts()
Ruby
billing.list_alerts
PHP
billing->listAlerts
Go
Billing.ListAlerts
Java
billing().listAlerts
C#
Billing.ListAlertsAsync
CLI
openemail billing list-alerts
MCP
listBillingAlerts

GET/billing/countries

List the billing countries

Scopesbilling:readReads

Every country a billing address can be in, as two-letter ISO 3166 codes, the values country takes on PUT /billing/invoices/{orderId}/details.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:read scope.

Returns

Every country code.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.billing.listCountries()
Python
billing.list_countries()
Ruby
billing.list_countries
PHP
billing->listCountries
Go
Billing.ListCountries
Java
billing().listCountries
C#
Billing.ListCountriesAsync
CLI
openemail billing list-countries
MCP
listBillingCountries

GET/billing/pay-as-you-go

Read pay as you go

Scopesbilling:readReads

Whether usage past the allowances is billed, the monthly limit and what extras cost so far, the limits that can be chosen, the prices, and the current billing period of pay as you go once it is set up.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:read scope.

Returns

Pay as you go on this workspace.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.billing.getPayAsYouGo()
Python
billing.get_pay_as_you_go()
Ruby
billing.get_pay_as_you_go
PHP
billing->getPayAsYouGo
Go
Billing.GetPayAsYouGo
Java
billing().getPayAsYouGo
C#
Billing.GetPayAsYouGoAsync
CLI
openemail billing get-pay-as-you-go
MCP
getPayAsYouGo

PATCH/billing/pay-as-you-go

Turn pay as you go on or off

Scopesbilling:writeChanges data
Asks for a verification code

Turns pay as you go on or off, as the switch on Billing does. Off takes effect at once, and usage stops at the allowances. On takes effect at once when a card is already saved. The first time, checkoutUrl is a link where the person adds a card, and pay as you go starts once they have: call POST /billing/pay-as-you-go/confirm after they return. activating means a card was just saved and it is being turned on. theme styles the page the link opens.

Nothing is paid through the API. Starting a checkout, opening the billing portal and adding a card for pay as you go each return a link to the billing provider's page, where the person pays, changes the card or cancels, as they do from the app.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:write scope.

Request body

themestring

light or dark, for the page the link opens.

One of"light""dark"
enabledbooleanRequired

true to turn it on, false to turn it off.

Returns

What happened.

Errors

403

The key lacks the scope, or may not send as that address.

step_up_required: the call was made with an OAuth access token that has not been verified in the last 60 minutes. Ask for a code with POST /security/step-up, send it to POST /security/step-up/verify, then repeat the call. The person can also choose Allow changes for 60 minutes on the app in Account settings, Connected apps, on the Nextmail website. An API key is never asked for a code.

503

billing_not_configured: pay as you go is unavailable right now.

The errors every operation can return400401404422429500Error catalog

Also available in

TypeScript
nextmail.billing.setPayAsYouGo()
Python
billing.set_pay_as_you_go()
Ruby
billing.set_pay_as_you_go
PHP
billing->setPayAsYouGo
Go
Billing.SetPayAsYouGo
Java
billing().setPayAsYouGo
C#
Billing.SetPayAsYouGoAsync
CLI
openemail billing set-pay-as-you-go
MCP
setPayAsYouGo

GET/billing/add-ons

List add-ons

Scopesbilling:readReads

What can be bought on top of the plan, today the dedicated sending IP: whether it is for sale, its price per IP a month, whether the workspace has it and when it ends, and eligibility, which says whether the workspace qualifies. A dedicated IP needs the Business or Enterprise plan and at least 100,000 emails sent in a month, because below that volume it delivers worse than the shared IPs.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:read scope.

Returns

The add-ons.

Errors

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.billing.listAddOns()
Python
billing.list_add_ons()
Ruby
billing.list_add_ons
PHP
billing->listAddOns
Go
Billing.ListAddOns
Java
billing().listAddOns
C#
Billing.ListAddOnsAsync
CLI
openemail billing list-add-ons
MCP
listBillingAddOns

POST/billing/add-ons/checkout

Start a checkout for an add-on

Scopesbilling:writeChanges data
Asks for a verification code

Returns a link where the person pays for an add-on on the billing provider's page. Once it is paid the dedicated IP is set up and warmed up, which GET /sending/dedicated-ips shows. theme styles the page the link opens.

Nothing is paid through the API. Starting a checkout, opening the billing portal and adding a card for pay as you go each return a link to the billing provider's page, where the person pays, changes the card or cancels, as they do from the app.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:write scope.

Request body

themestring

light or dark, for the page the link opens.

One of"light""dark"
addOnstringRequired

The add-on to buy: dedicated-ip.

One of"dedicated-ip"

Returns

The link to pay at.

Errors

403

The key lacks the scope, or may not send as that address.

step_up_required: the call was made with an OAuth access token that has not been verified in the last 60 minutes. Ask for a code with POST /security/step-up, send it to POST /security/step-up/verify, then repeat the call. The person can also choose Allow changes for 60 minutes on the app in Account settings, Connected apps, on the Nextmail website. An API key is never asked for a code.

503

add_on_unavailable: add-ons are not on sale right now.

The errors every operation can return400401404422429500Error catalog

Also available in

TypeScript
nextmail.billing.startAddOnCheckout()
Python
billing.start_add_on_checkout()
Ruby
billing.start_add_on_checkout
PHP
billing->startAddOnCheckout
Go
Billing.StartAddOnCheckout
Java
billing().startAddOnCheckout
C#
Billing.StartAddOnCheckoutAsync
CLI
openemail billing start-add-on-checkout
MCP
startAddOnCheckout

DELETE/billing/add-ons/{addOn}

Cancel an add-on

Scopesbilling:writeDeletes
Asks for a verification code

Cancels an add-on. It stays until the end of the month already paid for, which endsAt gives. Then the dedicated IP is released and mail leaves through the shared IPs again.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:write scope.

Path parameters

addOnstringRequired

The add-on to cancel.

One of"dedicated-ip"

Returns

The add-on, with when it ends.

Errors

403

The key lacks the scope, or may not send as that address.

step_up_required: the call was made with an OAuth access token that has not been verified in the last 60 minutes. Ask for a code with POST /security/step-up, send it to POST /security/step-up/verify, then repeat the call. The person can also choose Allow changes for 60 minutes on the app in Account settings, Connected apps, on the Nextmail website. An API key is never asked for a code.

409

add_on_not_active: the workspace does not have this add-on.

503

add_on_unavailable: billing did not answer.

The errors every operation can return400401404422429500Error catalog

Also available in

TypeScript
nextmail.billing.cancelAddOn()
Python
billing.cancel_add_on()
Ruby
billing.cancel_add_on
PHP
billing->cancelAddOn
Go
Billing.CancelAddOn
Java
billing().cancelAddOn
C#
Billing.CancelAddOnAsync
CLI
openemail billing cancel-add-on
MCP
cancelAddOn

PUT/billing/pay-as-you-go/limit

Set the pay as you go limit

Scopesbilling:writeChanges data
Asks for a verification code

Sets the monthly spending limit of pay as you go, one of the amounts GET /billing/pay-as-you-go lists in limits. Extras stop for the rest of a calendar month once it is reached.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:write scope.

Request body

limitCentsintegerRequired

The monthly limit in US cents.

One of100025005000100002500050000100000250000500000

Returns

The limit.

Errors

403

The key lacks the scope, or may not send as that address.

step_up_required: the call was made with an OAuth access token that has not been verified in the last 60 minutes. Ask for a code with POST /security/step-up, send it to POST /security/step-up/verify, then repeat the call. The person can also choose Allow changes for 60 minutes on the app in Account settings, Connected apps, on the Nextmail website. An API key is never asked for a code.

409

pay_as_you_go_not_enrolled: pay as you go has never been set up on this workspace.

The errors every operation can return400401404422429500Error catalog

Also available in

TypeScript
nextmail.billing.setPayAsYouGoLimit()
Python
billing.set_pay_as_you_go_limit()
Ruby
billing.set_pay_as_you_go_limit
PHP
billing->setPayAsYouGoLimit
Go
Billing.SetPayAsYouGoLimit
Java
billing().setPayAsYouGoLimit
C#
Billing.SetPayAsYouGoLimitAsync
CLI
openemail billing set-pay-as-you-go-limit
MCP
setPayAsYouGoLimit

POST/billing/pay-as-you-go/confirm

Confirm pay as you go

Scopesbilling:writeChanges data
Asks for a verification code

Checks with the billing provider whether the card from a pay as you go checkout was saved, and records it, as the app does when the person comes back from the checkout. enabled says whether pay as you go is on now. It is safe to call again.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:write scope.

Returns

Whether pay as you go is on.

Errors

403

The key lacks the scope, or may not send as that address.

step_up_required: the call was made with an OAuth access token that has not been verified in the last 60 minutes. Ask for a code with POST /security/step-up, send it to POST /security/step-up/verify, then repeat the call. The person can also choose Allow changes for 60 minutes on the app in Account settings, Connected apps, on the Nextmail website. An API key is never asked for a code.

The errors every operation can return400401404422429500Error catalog

Also available in

TypeScript
nextmail.billing.confirmPayAsYouGo()
Python
billing.confirm_pay_as_you_go()
Ruby
billing.confirm_pay_as_you_go
PHP
billing->confirmPayAsYouGo
Go
Billing.ConfirmPayAsYouGo
Java
billing().confirmPayAsYouGo
C#
Billing.ConfirmPayAsYouGoAsync
CLI
openemail billing confirm-pay-as-you-go
MCP
confirmPayAsYouGo

POST/billing/checkout

Start a checkout

Scopesbilling:writeChanges data
Asks for a verification code

Starts buying a paid plan for a workspace on Free, as choosing a plan in the app does, and returns the link to the checkout. Nothing is charged until the person pays there, and the plan starts once they have. A workspace that already pays for a plan changes it on the billing portal instead.

Nothing is paid through the API. Starting a checkout, opening the billing portal and adding a card for pay as you go each return a link to the billing provider's page, where the person pays, changes the card or cancels, as they do from the app.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:write scope.

Request body

themestring

light or dark, for the page the link opens.

One of"light""dark"
planstringRequired

starter, business or enterprise.

One of"starter""business""enterprise"
intervalstring

month or year. Defaults to month.

One of"month""year"

Returns

The link to the checkout.

Errors

403

The key lacks the scope, or may not send as that address.

step_up_required: the call was made with an OAuth access token that has not been verified in the last 60 minutes. Ask for a code with POST /security/step-up, send it to POST /security/step-up/verify, then repeat the call. The person can also choose Allow changes for 60 minutes on the app in Account settings, Connected apps, on the Nextmail website. An API key is never asked for a code.

409

plan_conflict: the workspace already pays for a plan.

422

plan_unavailable: the plan is not on sale, or not at that interval. invalid_parameter: the body did not validate.

503

billing_not_configured: paid plans are not on sale right now.

The errors every operation can return400401404429500Error catalog

Also available in

TypeScript
nextmail.billing.startCheckout()
Python
billing.start_checkout()
Ruby
billing.start_checkout
PHP
billing->startCheckout
Go
Billing.StartCheckout
Java
billing().startCheckout
C#
Billing.StartCheckoutAsync
CLI
openemail billing start-checkout
MCP
startPlanCheckout

POST/billing/portal

Open the billing portal

Scopesbilling:writeChanges data
Asks for a verification code

Returns a link to the billing portal, where the person changes or cancels the plan, updates the card and downloads past invoices, as Manage does in the app. The body is optional.

Nothing is paid through the API. Starting a checkout, opening the billing portal and adding a card for pay as you go each return a link to the billing provider's page, where the person pays, changes the card or cancels, as they do from the app.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:write scope.

Request body

themestring

light or dark, for the page the link opens.

One of"light""dark"

Returns

The link to the billing portal.

Errors

403

The key lacks the scope, or may not send as that address.

step_up_required: the call was made with an OAuth access token that has not been verified in the last 60 minutes. Ask for a code with POST /security/step-up, send it to POST /security/step-up/verify, then repeat the call. The person can also choose Allow changes for 60 minutes on the app in Account settings, Connected apps, on the Nextmail website. An API key is never asked for a code.

503

billing_not_configured: billing is unavailable right now.

The errors every operation can return400401404422429500Error catalog

Also available in

TypeScript
nextmail.billing.openPortal()
Python
billing.open_portal()
Ruby
billing.open_portal
PHP
billing->openPortal
Go
Billing.OpenPortal
Java
billing().openPortal
C#
Billing.OpenPortalAsync
CLI
openemail billing open-portal
MCP
openBillingPortal

GET/billing/invoices

List the charges

Scopesbilling:readReads

Every charge of the workspace with its invoice, as History on Billing lists them. page and limit page through them, total counts them all, and search matches the plan, the invoice number, the charge id and the name billed. metered is false while billing is switched off.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:read scope.

Query parameters

pageinteger

Which page, from 1.

At least 1Default1
limitinteger

Charges per page, 1 to 100.

At least 1At most 100Default25
sortstring

Newest or oldest first.

One of"newest""oldest"Default"newest"
searchstring

Words to look for.

Up to 120 characters

Returns

A page of charges.

Errors

502

billing_unreachable: the billing provider did not answer.

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.billing.listInvoices()
Python
billing.list_invoices()
Ruby
billing.list_invoices
PHP
billing->listInvoices
Go
Billing.ListInvoices
Java
billing().listInvoices
C#
Billing.ListInvoicesAsync
CLI
openemail billing list-invoices
MCP
listInvoices

GET/billing/invoices/{orderId}

Get the invoice of a charge

Scopesbilling:readReads

The link to the invoice of one charge, as a PDF, and its file name. An invoice that was not written yet is written first, from the billing details on the charge or on the account, which can take a few seconds. The link is signed by the billing provider, downloads the PDF and stops working after a while, so fetch it again rather than keeping it.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:read scope.

Path parameters

orderIdstringRequired

The id of a charge, as GET /billing/invoices lists it.

Returns

The link to the invoice.

Errors

409

billing_details_required: the charge has no billing name and address yet. invoice_unavailable: a draft or void charge has no invoice.

502

billing_unreachable: the billing provider did not answer.

504

invoice_not_ready: the invoice is still being written.

The errors every operation can return400401403404422429500Error catalog

Also available in

TypeScript
nextmail.billing.getInvoice()
Python
billing.get_invoice()
Ruby
billing.get_invoice
PHP
billing->getInvoice
Go
Billing.GetInvoice
Java
billing().getInvoice
C#
Billing.GetInvoiceAsync
CLI
openemail billing get-invoice
MCP
getInvoice

PUT/billing/invoices/{orderId}/details

Save the billing details of a charge

Scopesbilling:writeChanges data
Asks for a verification code

Saves the name and address billed on a charge, as the Billing address dialog does, keeps the address for later charges, and starts writing its invoice. invoice is ready when the charge already had one, started when it is being written, and refused with the reason in message. Read it with GET /billing/invoices/{orderId}.

Billing belongs to the owner of the workspace. An API key acts for the owner, and an OAuth access token reaches billing only when the owner connected the app with every address. A token that acts for a member is refused with owner_only, and a key or token limited to particular addresses or domains with capability_unsupported. Reading needs billing:read, every change needs billing:write, and an OAuth access token needs a verification code for every change.

Requires the billing:write scope.

Path parameters

orderIdstringRequired

The id of a charge, as GET /billing/invoices lists it.

Request body

namestringRequired

Who is billed, up to 200 characters.

1 to 200 characters
line1stringRequired

The street address, up to 200 characters.

1 to 200 characters
line2string

A flat, suite or building, up to 200 characters.

Up to 200 characters
citystringRequired

Up to 120 characters.

1 to 120 characters
postalCodestring

Up to 40 characters.

Up to 40 characters
statestring

The state or region, up to 60 characters. In the US and Canada, its two-letter code.

Up to 60 characters
countrystringRequired

A two-letter ISO 3166 code, one of those listCountries returns.

One of"AD""AE""AF""AG""AI""AL""AM""AO""AQ""AR""AS""AT""AU""AW""AX""AZ""BA""BB""BD""BE""BF""BG""BH""BI""BJ""BL""BM""BN""BO""BQ""BR""BS""BT""BV""BW""BY""BZ""CA""CC""CD""CF""CG""CH""CI""CK""CL""CM""CN""CO""CR""CV""CW""CX""CY""CZ""DE""DJ""DK""DM""DO""DZ""EC""EE""EG""EH""ER""ES""ET""FI""FJ""FK""FM""FO""FR""GA""GB""GD""GE""GF""GG""GH""GI""GL""GM""GN""GP""GQ""GR""GS""GT""GU""GW""GY""HK""HM""HN""HR""HT""HU""ID""IE""IL""IM""IN""IO""IQ""IS""IT""JE""JM""JO""JP""KE""KG""KH""KI""KM""KN""KR""KW""KY""KZ""LA""LB""LC""LI""LK""LR""LS""LT""LU""LV""LY""MA""MC""MD""ME""MF""MG""MH""MK""ML""MM""MN""MO""MP""MQ""MR""MS""MT""MU""MV""MW""MX""MY""MZ""NA""NC""NE""NF""NG""NI""NL""NO""NP""NR""NU""NZ""OM""PA""PE""PF""PG""PH""PK""PL""PM""PN""PR""PS""PT""PW""PY""QA""RE""RO""RS""RW""SA""SB""SC""SD""SE""SG""SH""SI""SJ""SK""SL""SM""SN""SO""SR""SS""ST""SV""SX""SZ""TC""TD""TF""TG""TH""TJ""TK""TL""TM""TN""TO""TR""TT""TV""TW""TZ""UA""UG""UM""US""UY""UZ""VA""VC""VE""VG""VI""VN""VU""WF""WS""YE""YT""ZA""ZM""ZW"

Returns

Errors

403

The key lacks the scope, or may not send as that address.

step_up_required: the call was made with an OAuth access token that has not been verified in the last 60 minutes. Ask for a code with POST /security/step-up, send it to POST /security/step-up/verify, then repeat the call. The person can also choose Allow changes for 60 minutes on the app in Account settings, Connected apps, on the Nextmail website. An API key is never asked for a code.

422

billing_address_rejected: the billing provider refused the address. invalid_parameter: the body did not validate.

502

billing_unreachable: the billing provider did not answer.

The errors every operation can return400401404429500Error catalog

Also available in

TypeScript
nextmail.billing.saveInvoiceDetails()
Python
billing.save_invoice_details()
Ruby
billing.save_invoice_details
PHP
billing->saveInvoiceDetails
Go
Billing.SaveInvoiceDetails
Java
billing().saveInvoiceDetails
C#
Billing.SaveInvoiceDetailsAsync
CLI
openemail billing save-invoice-details
MCP
saveBillingDetails

Objects

AddOnobject

objectstringRequired
One of"add_on"
addOnstringRequired
One of"dedicated-ip"
availablebooleanRequired

Whether the add-on is on sale.

statusstringRequired

Null when the workspace does not have it. pending is paid and being set up, warming and active send through the dedicated IP, and releasing is being taken down.

Can be nullOne of"pending""warming""active""releasing""released""failed"
priceCentsintegerRequired

US cents per IP a month.

endsAtstringRequired

When a cancelled add-on ends. Null while it renews.

Can be nullFormatdate-time
eligibilityobjectRequired
eligiblebooleanRequired
planstringRequired
monthlySendsintegerRequired

The most the workspace sent in this month or the last.

minimumMonthlySendsintegerRequired
reasonstringRequired

What is missing: the plan or the volume. Null when the workspace qualifies.

Can be nullOne of"plan""volume"
ipsDedicatedIp[]Required

AddOnCheckoutobject

objectstringRequired
One of"add_on_checkout"
addOnstringRequired
One of"dedicated-ip"
urlstringRequired

Where the person pays.

AddOnListobject

objectstringRequired
One of"list"
dataAddOn[]Required

Billingobject

objectstringRequired
One of"billing"
workspaceIdstringRequired
workspaceNamestring
planstringRequired
One of"free""starter""business""enterprise"
planNamestring
meteredbooleanRequired

False while billing is switched off, and then nothing is capped.

intervalstring

How often the plan is billed. Null on Free.

Can be nullOne of"month""year"
renewsAtstring

When the plan renews, or ends when cancelAtPeriodEnd is true.

Can be nullFormatdate-time
cancelAtPeriodEndboolean

The plan was cancelled and ends at renewsAt.

nextChargeobject

The next charge of the plan, when one is due. cents is null until it is known.

Can be null
centsinteger
Can be null
currencystring
Can be null
atstring
Formatdate-time
domainsobject
usedinteger

Domains in the workspace.

At least 0
includedinteger

Domains the plan includes. Null when there is no limit.

Can be nullAt least 0
canAddboolean
usageobject
sendsobject
usedinteger

Used so far.

At least 0
limitinteger

What the plan includes. Null when there is no limit.

Can be nullAt least 0
resetsAtstring

When the monthly sends start again.

Formatdate-time
aiActionsobject
usedinteger

Used so far.

At least 0
limitinteger

What the plan includes. Null when there is no limit.

Can be nullAt least 0
resetsAtstring

When the daily AI actions start again.

Formatdate-time
payAsYouGoobject
availableboolean

Whether the plan of the workspace can buy anything past its allowances.

enabledboolean

Whether usage past the allowances is being billed now: switched on and not paused.

suspendedboolean

Paused because the last payment failed. Update the card on the billing portal to resume.

enrolledboolean

Whether pay as you go has ever been set up, with a card, on this workspace.

switchedOnboolean

Whether it is switched on, paused or not.

coversSendsboolean

Whether sends past the monthly allowance can be bought on this plan.

coversAiActionsboolean

Whether AI actions past the daily allowance can be bought on this plan.

limitCentsinteger

The monthly spending limit in US cents. Extras stop once a calendar month reaches it.

spentCentsinteger

What extras cost this calendar month so far, in US cents.

At least 0
extraSendsinteger

Sends past the allowance this month.

At least 0
extraAiActionsinteger

AI actions past the allowance this month.

At least 0
estimatedCentsinteger

What those extras come to, in US cents.

At least 0
availablePlansstring[]

The plans on sale.

One of"free""starter""business""enterprise"

BillingAlertobject

objectstringRequired
One of"billing_alert"
idstringRequired

Stays the same while the same thing is true, so a dismissed alert can stay dismissed.

kindstringRequired
One of"payment_failed""pay_as_you_go_paused""sending_paused""spend_limit_reached""ai_used_up""plan_ending""sends_nearly_used""spend_nearly_reached""upcoming_charge"
severitystringRequired
One of"blocked""warning""info"
targetstringRequired

Which tab of Billing it is about: the plan or the usage.

One of"billing""usage"
planNamestring
Can be null
atstring

When it happens: the charge, the end of the plan or the reset.

Can be nullFormatdate-time
centsinteger
Can be null
currencystring
Can be null
usedinteger
Can be null
limitinteger
Can be null
payAsYouGoboolean

Whether pay as you go can lift the limit it is about.

BillingCheckoutobject

objectstring
One of"checkout"
urlstring
Formaturi

BillingCountryListobject

objectstring
One of"list"
datastring[]

BillingInvoiceobject

objectstringRequired
One of"invoice"
idstringRequired

The charge id the invoice calls take.

createdAtstringRequired
Formatdate-time
amountCentsintegerRequired
subtotalCentsinteger
currencystringRequired
statusstring
Can be nullOne of"draft""pending""paid""refunded""partially_refunded""void"
paidboolean
reasonstring

Why it was charged: a purchase, a renewal or a change.

invoiceNumberstring
Can be null
invoiceReadyboolean

Whether its invoice was written.

needsBillingDetailsboolean

Its invoice needs a billing name and address first.

billingNamestring
Can be null
productstring
Can be null
payAsYouGoboolean

A charge for pay as you go extras.

discountobject
Can be null
codestring
Can be null
namestring
Can be null
amountCentsinteger
percentOffnumber
Can be null

BillingInvoiceDetailsobject

objectstring
One of"invoice_details"
orderIdstring
invoicestring
One of"ready""started""refused"
messagestring

Why the invoice could not be started, when invoice is refused.

Can be null

BillingInvoiceListobject

objectstring
One of"list"
totalinteger

How many charges there are in all.

At least 0
pageinteger
At least 1
limitinteger
At least 1
hasMoreboolean
meteredboolean

False while billing is switched off.

BillingPlanobject

objectstringRequired
One of"plan"
idstringRequired
One of"free""starter""business""enterprise"
namestringRequired
availablebooleanRequired

Whether it is on sale.

intervalsstring[]Required

The billing intervals it is sold at. Empty for Free.

One of"month""year"
monthlyPriceCentsinteger

The price billed monthly, in US cents a month.

At least 0
yearlyMonthlyPriceCentsinteger

The price billed yearly, in US cents a month.

At least 0
includedDomainsinteger

Domains it includes. Null when there is no limit.

Can be nullAt least 0
monthlySendsinteger

Sends it includes each calendar month. Null when there is no limit.

Can be nullAt least 0
dailyAiActionsinteger

AI actions it includes each day. Null when there is no limit.

Can be nullAt least 0
dailyAutoLabelsinteger

Arriving messages a day that labels applied by AI may read. 0 means the plan has no AI labels.

At least 0
uploadStorageBytesinteger

The bytes of uploaded files a workspace on the plan may keep. Received and sent files are not counted.

At least 0
teamAccessboolean

Whether members can be added.

prioritySupportboolean
extraSendsboolean

Whether pay as you go can buy sends past the allowance.

extraAiActionsboolean

Whether pay as you go can buy AI actions past the allowance.

BillingPortalobject

objectstring
One of"billing_portal"
urlstring
Formaturi

BillingUsageobject

objectstringRequired
One of"usage_history"
daysobject[]Required
daystring
Formatdate
aiActionsinteger

AI actions that day.

At least 0
aiExtrainteger

Of those, the ones past the daily allowance, billed by pay as you go.

At least 0
sendsinteger

Emails sent that day.

At least 0
monthsobject[]Required
monthstring

The month, as YYYY-MM.

extraSendsinteger

Sends billed by pay as you go.

At least 0
extraAiActionsinteger

AI actions billed by pay as you go.

At least 0
sendCentsinteger

What the extra sends cost, in US cents.

At least 0
aiCentsinteger

What the extra AI actions cost, in US cents.

At least 0
centsinteger

Both, in US cents.

At least 0
dailyAiActionsinteger

AI actions the plan includes each day. Null when there is no limit.

Can be nullAt least 0
monthlySendsinteger

Sends the plan includes each month. Null when there is no limit.

Can be nullAt least 0

DedicatedIpobject

objectstringRequired
One of"dedicated_ip"
ipstringRequired
statusstringRequired

warming while the IP is being warmed up, ready once all of the workspace's mail leaves through it.

One of"available""warming""ready""released"
poolstringRequired

The pool the IP sends through.

Can be null
poolStatusstringRequired
Can be nullOne of"pending""warming""active""releasing""released""failed"
warmupPercentintegerRequired
At least 0At most 100
assignedAtstringRequired
Can be nullFormatdate-time
readyAtstringRequired
Can be nullFormatdate-time
checkedAtstringRequired

When the warm-up was last read.

Can be nullFormatdate-time

PayAsYouGoobject

objectstringRequired
One of"pay_as_you_go"
availablebooleanRequired

Whether the plan of the workspace can buy anything past its allowances.

enabledbooleanRequired

Whether usage past the allowances is being billed now: switched on and not paused.

suspendedboolean

Paused because the last payment failed. Update the card on the billing portal to resume.

enrolledboolean

Whether pay as you go has ever been set up, with a card, on this workspace.

switchedOnboolean

Whether it is switched on, paused or not.

coversSendsboolean

Whether sends past the monthly allowance can be bought on this plan.

coversAiActionsboolean

Whether AI actions past the daily allowance can be bought on this plan.

limitCentsinteger

The monthly spending limit in US cents. Extras stop once a calendar month reaches it.

spentCentsinteger

What extras cost this calendar month so far, in US cents.

At least 0
extraSendsinteger

Sends past the allowance this month.

At least 0
extraAiActionsinteger

AI actions past the allowance this month.

At least 0
estimatedCentsinteger

What those extras come to, in US cents.

At least 0
limitsinteger[]Required

The monthly limits that can be chosen, in US cents.

One of100025005000100002500050000100000250000500000
pricesobjectRequired

What extras cost: priceCents US cents for every unit.

sendsobject
unitinteger
priceCentsinteger
aiActionsobject
unitinteger
priceCentsinteger
periodobject

The current billing period of pay as you go. Null until it is set up.

Can be null
endsAtstring
Formatdate-time
sendsinteger

Extra sends in the period.

At least 0
aiActionsinteger

Extra AI actions in the period.

At least 0
estimatedCentsinteger

What they come to, in US cents.

At least 0

PayAsYouGoConfirmationobject

objectstring
One of"pay_as_you_go_confirmation"
enabledboolean

PayAsYouGoLimitobject

objectstring
One of"pay_as_you_go_limit"
limitCentsinteger

PayAsYouGoSwitchobject

objectstring
One of"pay_as_you_go_switch"
enabledboolean
suspendedboolean
activatingboolean

A card was just saved, and pay as you go is being turned on.

checkoutUrlstring

Where the person adds a card, the first time pay as you go is turned on.

Can be null