---
title: "Billing"
description: "The plan, pay as you go, invoices, and the links to pay."
url: "https://nextmail.sh/docs/mcp/tools/billing"
area: "MCP server"
category: "Tools"
---

# Billing

The plan, pay as you go, invoices, and the links to pay.

## Billing tools

| Tool | What it does |
| --- | --- |
| getBilling | The plan of the workspace and what it includes, as Billing shows it: how it is billed, when it renews or ends and the next charge, the domains, this month’s sends, today’s AI actions and pay as you go. |
| listBillingPlans | Every plan, cheapest first, with its price, where it is sold and what it includes. |
| getBillingUsage | Sends and AI actions per day, and what pay as you go extras cost per month, as the Usage charts show them. `days` goes back up to 3,660 days, and `all` to the day the workspace was made. |
| listBillingAlerts | What the billing banner of the app would say now, most urgent first. |
| listBillingCountries | Every country code a billing address takes. |
| getPayAsYouGo | Pay as you go: whether extras are billed, the monthly limit and what they cost so far, the current period, the limits that can be chosen and the prices. |
| setPayAsYouGo | Turn pay as you go on or off. The first time, it returns a link where the person adds a card. In the app’s chat it always asks first. |
| setPayAsYouGoLimit | Set the monthly limit of pay as you go. In the app’s chat it always asks first. |
| confirmPayAsYouGo | After the person added the card, check that it was saved and record it. In the app’s chat it always asks first. |
| startPlanCheckout | The link to a checkout for a paid plan, for a workspace on Free. In the app’s chat it always asks first. |
| openBillingPortal | The link to the billing portal, where the plan is changed or cancelled and the card updated. In the app’s chat it always asks first. |
| listInvoices | Every charge with the state of its invoice, as History on Billing lists them, a page at a time. |
| getInvoice | The link to the invoice of one charge, a PDF, since a tool carries no file. |
| saveBillingDetails | Save the name and address billed on a charge, keep the address for later charges and start writing its invoice. In the app’s chat it always asks first. |
| estimateCost | Every plan priced for a usage, as the cost calculator on the website does: sends a month, domains, people and AI actions a day, with the monthly total, whether the plan fits and the cheapest one that does. It reads nothing in the workspace and needs no permission. |
| listBillingAddOns | What can be bought on top of the plan, today a dedicated sending IP: its price, whether the workspace qualifies and whether it has one. |
| startAddOnCheckout | The link to a checkout for a dedicated sending IP. In the app’s chat it always asks first. |
| cancelAddOn | Cancel the dedicated IP at the end of the month already paid for. In the app’s chat it always asks first. |

> Only the owner of the workspace reaches billing, through a client connected with every address. Reading needs `billing:read` and every change needs `billing:write`.

> Nothing is paid through a tool. A checkout, the billing portal and adding a card for pay as you go each return a link for the person to open, and they pay, change the card or cancel there.

> Some tools on this server make a change the REST API guards with a verification code, and ask for the same code. Until the client has verified a code in the last 60 minutes, or the person has chosen Allow changes for 60 minutes on it in Account → Connected apps, such a tool answers with a result that starts `Refused (step_up_required):` and changes nothing. `emptyAudience` never asks for a code. The API Authentication page lists every tool that asks, and shows how to ask for a code and verify it.

## Reference

### `getBilling`

The plan of this workspace and what it includes, as Billing shows it: how it is billed, when it renews or ends and the next charge, how many domains it holds, how much of this month's sends and today's AI actions are used, and pay as you go. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:read`.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

Takes no input.

Also available in: API [`GET /billing`](https://nextmail.sh/docs/api/reference/billing#get-billing); TypeScript [`nextmail.billing.get()`](https://nextmail.sh/docs/sdk/reference/billing#get); Python [`billing.get()`](https://nextmail.sh/docs/python/reference/billing#get); Ruby [`billing.get`](https://nextmail.sh/docs/ruby/reference/billing#get); PHP [`billing->get`](https://nextmail.sh/docs/php/reference/billing#get); Go [`Billing.Get`](https://nextmail.sh/docs/go/reference/billing#get); Java [`billing().get`](https://nextmail.sh/docs/java/reference/billing#get); C# [`Billing.GetAsync`](https://nextmail.sh/docs/csharp/reference/billing#get).

### `listBillingPlans`

Every plan, cheapest first, with its price, whether it is sold here and at which intervals, and what it includes. Prices are in US dollars. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:read`.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

Takes no input.

Also available in: API [`GET /billing/plans`](https://nextmail.sh/docs/api/reference/billing#get-billing-plans); TypeScript [`nextmail.billing.listPlans()`](https://nextmail.sh/docs/sdk/reference/billing#listPlans); Python [`billing.list_plans()`](https://nextmail.sh/docs/python/reference/billing#listPlans); Ruby [`billing.list_plans`](https://nextmail.sh/docs/ruby/reference/billing#listPlans); PHP [`billing->listPlans`](https://nextmail.sh/docs/php/reference/billing#listPlans); Go [`Billing.ListPlans`](https://nextmail.sh/docs/go/reference/billing#listPlans); Java [`billing().listPlans`](https://nextmail.sh/docs/java/reference/billing#listPlans); C# [`Billing.ListPlansAsync`](https://nextmail.sh/docs/csharp/reference/billing#listPlans).

### `getBillingUsage`

Sends and AI actions per day, and what pay as you go extras cost per month, as the Usage charts show them. days goes back 1 to 3660 days, 30 by default, and "all" goes back to the day the workspace was made. Days with no use are left out. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:read`.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

- `days` (`integer | string`)

Also available in: API [`GET /billing/usage`](https://nextmail.sh/docs/api/reference/billing#get-billing-usage); TypeScript [`nextmail.billing.getUsage()`](https://nextmail.sh/docs/sdk/reference/billing#getUsage); Python [`billing.get_usage()`](https://nextmail.sh/docs/python/reference/billing#getUsage); Ruby [`billing.get_usage`](https://nextmail.sh/docs/ruby/reference/billing#getUsage); PHP [`billing->getUsage`](https://nextmail.sh/docs/php/reference/billing#getUsage); Go [`Billing.GetUsage`](https://nextmail.sh/docs/go/reference/billing#getUsage); Java [`billing().getUsage`](https://nextmail.sh/docs/java/reference/billing#getUsage); C# [`Billing.GetUsageAsync`](https://nextmail.sh/docs/csharp/reference/billing#getUsage).

### `listBillingAlerts`

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. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:read`.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

Takes no input.

Also available in: API [`GET /billing/alerts`](https://nextmail.sh/docs/api/reference/billing#get-billing-alerts); TypeScript [`nextmail.billing.listAlerts()`](https://nextmail.sh/docs/sdk/reference/billing#listAlerts); Python [`billing.list_alerts()`](https://nextmail.sh/docs/python/reference/billing#listAlerts); Ruby [`billing.list_alerts`](https://nextmail.sh/docs/ruby/reference/billing#listAlerts); PHP [`billing->listAlerts`](https://nextmail.sh/docs/php/reference/billing#listAlerts); Go [`Billing.ListAlerts`](https://nextmail.sh/docs/go/reference/billing#listAlerts); Java [`billing().listAlerts`](https://nextmail.sh/docs/java/reference/billing#listAlerts); C# [`Billing.ListAlertsAsync`](https://nextmail.sh/docs/csharp/reference/billing#listAlerts).

### `listBillingCountries`

Every country a billing address can be in, as the two-letter ISO 3166 codes saveBillingDetails takes as country. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:read`.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

Takes no input.

Also available in: API [`GET /billing/countries`](https://nextmail.sh/docs/api/reference/billing#get-billing-countries); TypeScript [`nextmail.billing.listCountries()`](https://nextmail.sh/docs/sdk/reference/billing#listCountries); Python [`billing.list_countries()`](https://nextmail.sh/docs/python/reference/billing#listCountries); Ruby [`billing.list_countries`](https://nextmail.sh/docs/ruby/reference/billing#listCountries); PHP [`billing->listCountries`](https://nextmail.sh/docs/php/reference/billing#listCountries); Go [`Billing.ListCountries`](https://nextmail.sh/docs/go/reference/billing#listCountries); Java [`billing().listCountries`](https://nextmail.sh/docs/java/reference/billing#listCountries); C# [`Billing.ListCountriesAsync`](https://nextmail.sh/docs/csharp/reference/billing#listCountries).

### `getPayAsYouGo`

Pay as you go on this workspace: whether usage past the allowances is billed, the monthly limit and what extras cost so far, the current billing period, the limits that can be chosen and the prices. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:read`.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

Takes no input.

Also available in: API [`GET /billing/pay-as-you-go`](https://nextmail.sh/docs/api/reference/billing#get-billing-pay-as-you-go); TypeScript [`nextmail.billing.getPayAsYouGo()`](https://nextmail.sh/docs/sdk/reference/billing#getPayAsYouGo); Python [`billing.get_pay_as_you_go()`](https://nextmail.sh/docs/python/reference/billing#getPayAsYouGo); Ruby [`billing.get_pay_as_you_go`](https://nextmail.sh/docs/ruby/reference/billing#getPayAsYouGo); PHP [`billing->getPayAsYouGo`](https://nextmail.sh/docs/php/reference/billing#getPayAsYouGo); Go [`Billing.GetPayAsYouGo`](https://nextmail.sh/docs/go/reference/billing#getPayAsYouGo); Java [`billing().getPayAsYouGo`](https://nextmail.sh/docs/java/reference/billing#getPayAsYouGo); C# [`Billing.GetPayAsYouGoAsync`](https://nextmail.sh/docs/csharp/reference/billing#getPayAsYouGo).

### `setPayAsYouGo`

Turn pay as you go on or off, as the switch on Billing does. Off takes effect at once, and usage stops at the plan's allowances. On takes effect at once when a card is saved. The first time, it returns a link where the person adds a card on the billing provider's page: give them the link, and call confirmPayAsYouGo once they say they are done. Nothing is paid through this tool. It asks for a verification code, and in the app's chat it always asks first. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`PATCH /billing/pay-as-you-go`](https://nextmail.sh/docs/api/reference/billing#patch-billing-pay-as-you-go).
- Toolkit: `billing`.

**Inputs**

- `enabled` (`boolean`, required)
- `theme` (`string`, one of `"light"`, `"dark"`): Light or dark, for the page the link opens. Left out, it follows the browser.

Also available in: API [`PATCH /billing/pay-as-you-go`](https://nextmail.sh/docs/api/reference/billing#patch-billing-pay-as-you-go); TypeScript [`nextmail.billing.setPayAsYouGo()`](https://nextmail.sh/docs/sdk/reference/billing#setPayAsYouGo); Python [`billing.set_pay_as_you_go()`](https://nextmail.sh/docs/python/reference/billing#setPayAsYouGo); Ruby [`billing.set_pay_as_you_go`](https://nextmail.sh/docs/ruby/reference/billing#setPayAsYouGo); PHP [`billing->setPayAsYouGo`](https://nextmail.sh/docs/php/reference/billing#setPayAsYouGo); Go [`Billing.SetPayAsYouGo`](https://nextmail.sh/docs/go/reference/billing#setPayAsYouGo); Java [`billing().setPayAsYouGo`](https://nextmail.sh/docs/java/reference/billing#setPayAsYouGo); C# [`Billing.SetPayAsYouGoAsync`](https://nextmail.sh/docs/csharp/reference/billing#setPayAsYouGo).

### `setPayAsYouGoLimit`

Set the monthly spending limit of pay as you go, in US cents. Extras stop for the rest of a calendar month once it is reached. Pay as you go has to be set up first. It asks for a verification code, and in the app's chat it always asks first. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`PUT /billing/pay-as-you-go/limit`](https://nextmail.sh/docs/api/reference/billing#put-billing-pay-as-you-go-limit).
- Toolkit: `billing`.

**Inputs**

- `limitCents` (`integer`, required): One of 1000, 2500, 5000, 10000, 25000, 50000, 100000, 250000, 500000.

Also available in: API [`PUT /billing/pay-as-you-go/limit`](https://nextmail.sh/docs/api/reference/billing#put-billing-pay-as-you-go-limit); TypeScript [`nextmail.billing.setPayAsYouGoLimit()`](https://nextmail.sh/docs/sdk/reference/billing#setPayAsYouGoLimit); Python [`billing.set_pay_as_you_go_limit()`](https://nextmail.sh/docs/python/reference/billing#setPayAsYouGoLimit); Ruby [`billing.set_pay_as_you_go_limit`](https://nextmail.sh/docs/ruby/reference/billing#setPayAsYouGoLimit); PHP [`billing->setPayAsYouGoLimit`](https://nextmail.sh/docs/php/reference/billing#setPayAsYouGoLimit); Go [`Billing.SetPayAsYouGoLimit`](https://nextmail.sh/docs/go/reference/billing#setPayAsYouGoLimit); Java [`billing().setPayAsYouGoLimit`](https://nextmail.sh/docs/java/reference/billing#setPayAsYouGoLimit); C# [`Billing.SetPayAsYouGoLimitAsync`](https://nextmail.sh/docs/csharp/reference/billing#setPayAsYouGoLimit).

### `confirmPayAsYouGo`

After the person added a card through the link setPayAsYouGo gave, check with the billing provider that it was saved and record it, as the app does when they come back. It asks for a verification code, and in the app's chat it always asks first. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`POST /billing/pay-as-you-go/confirm`](https://nextmail.sh/docs/api/reference/billing#post-billing-pay-as-you-go-confirm).
- Toolkit: `billing`.

**Inputs**

Takes no input.

Also available in: API [`POST /billing/pay-as-you-go/confirm`](https://nextmail.sh/docs/api/reference/billing#post-billing-pay-as-you-go-confirm); TypeScript [`nextmail.billing.confirmPayAsYouGo()`](https://nextmail.sh/docs/sdk/reference/billing#confirmPayAsYouGo); Python [`billing.confirm_pay_as_you_go()`](https://nextmail.sh/docs/python/reference/billing#confirmPayAsYouGo); Ruby [`billing.confirm_pay_as_you_go`](https://nextmail.sh/docs/ruby/reference/billing#confirmPayAsYouGo); PHP [`billing->confirmPayAsYouGo`](https://nextmail.sh/docs/php/reference/billing#confirmPayAsYouGo); Go [`Billing.ConfirmPayAsYouGo`](https://nextmail.sh/docs/go/reference/billing#confirmPayAsYouGo); Java [`billing().confirmPayAsYouGo`](https://nextmail.sh/docs/java/reference/billing#confirmPayAsYouGo); C# [`Billing.ConfirmPayAsYouGoAsync`](https://nextmail.sh/docs/csharp/reference/billing#confirmPayAsYouGo).

### `startPlanCheckout`

Start buying a paid plan for a workspace on Free, as choosing a plan in the app does, and return the link to the checkout on the billing provider's page. Nothing is charged until the person pays there, so give them the link. A workspace that already pays for a plan changes it with openBillingPortal instead. interval is month or year, month by default. It asks for a verification code, and in the app's chat it always asks first. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`POST /billing/checkout`](https://nextmail.sh/docs/api/reference/billing#post-billing-checkout).
- Toolkit: `billing`.

**Inputs**

- `plan` (`string`, required, one of `"starter"`, `"business"`, `"enterprise"`)
- `interval` (`string`, one of `"month"`, `"year"`)
- `theme` (`string`, one of `"light"`, `"dark"`): Light or dark, for the page the link opens. Left out, it follows the browser.

Also available in: API [`POST /billing/checkout`](https://nextmail.sh/docs/api/reference/billing#post-billing-checkout); TypeScript [`nextmail.billing.startCheckout()`](https://nextmail.sh/docs/sdk/reference/billing#startCheckout); Python [`billing.start_checkout()`](https://nextmail.sh/docs/python/reference/billing#startCheckout); Ruby [`billing.start_checkout`](https://nextmail.sh/docs/ruby/reference/billing#startCheckout); PHP [`billing->startCheckout`](https://nextmail.sh/docs/php/reference/billing#startCheckout); Go [`Billing.StartCheckout`](https://nextmail.sh/docs/go/reference/billing#startCheckout); Java [`billing().startCheckout`](https://nextmail.sh/docs/java/reference/billing#startCheckout); C# [`Billing.StartCheckoutAsync`](https://nextmail.sh/docs/csharp/reference/billing#startCheckout).

### `openBillingPortal`

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. Nothing changes until they act there. It asks for a verification code, and in the app's chat it always asks first. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`POST /billing/portal`](https://nextmail.sh/docs/api/reference/billing#post-billing-portal).
- Toolkit: `billing`.

**Inputs**

- `theme` (`string`, one of `"light"`, `"dark"`): Light or dark, for the page the link opens. Left out, it follows the browser.

Also available in: API [`POST /billing/portal`](https://nextmail.sh/docs/api/reference/billing#post-billing-portal); TypeScript [`nextmail.billing.openPortal()`](https://nextmail.sh/docs/sdk/reference/billing#openPortal); Python [`billing.open_portal()`](https://nextmail.sh/docs/python/reference/billing#openPortal); Ruby [`billing.open_portal`](https://nextmail.sh/docs/ruby/reference/billing#openPortal); PHP [`billing->openPortal`](https://nextmail.sh/docs/php/reference/billing#openPortal); Go [`Billing.OpenPortal`](https://nextmail.sh/docs/go/reference/billing#openPortal); Java [`billing().openPortal`](https://nextmail.sh/docs/java/reference/billing#openPortal); C# [`Billing.OpenPortalAsync`](https://nextmail.sh/docs/csharp/reference/billing#openPortal).

### `listInvoices`

Every charge of the workspace with the state of its invoice, as History on Billing lists them, newest first unless sort is oldest. search matches the plan, the invoice number, the charge id and the name billed. getInvoice returns the link to an invoice. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:read`.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

- `page` (`integer`, at least 1)
- `limit` (`integer`, at least 1, at most 100)
- `sort` (`string`, one of `"newest"`, `"oldest"`)
- `search` (`string`, up to 120 characters)

Also available in: API [`GET /billing/invoices`](https://nextmail.sh/docs/api/reference/billing#get-billing-invoices); TypeScript [`nextmail.billing.listInvoices()`](https://nextmail.sh/docs/sdk/reference/billing#listInvoices); Python [`billing.list_invoices()`](https://nextmail.sh/docs/python/reference/billing#listInvoices); Ruby [`billing.list_invoices`](https://nextmail.sh/docs/ruby/reference/billing#listInvoices); PHP [`billing->listInvoices`](https://nextmail.sh/docs/php/reference/billing#listInvoices); Go [`Billing.ListInvoices`](https://nextmail.sh/docs/go/reference/billing#listInvoices); Java [`billing().listInvoices`](https://nextmail.sh/docs/java/reference/billing#listInvoices); C# [`Billing.ListInvoicesAsync`](https://nextmail.sh/docs/csharp/reference/billing#listInvoices).

### `getInvoice`

The link to the invoice of one charge, a PDF, since a tool carries no file. An invoice that was not written yet is written first, which takes a few seconds. Take the charge id from listInvoices. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:read`.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

- `orderId` (`string`, required, not empty)

Also available in: API [`GET /billing/invoices/{orderId}`](https://nextmail.sh/docs/api/reference/billing#get-billing-invoices-orderid); TypeScript [`nextmail.billing.getInvoice()`](https://nextmail.sh/docs/sdk/reference/billing#getInvoice); Python [`billing.get_invoice()`](https://nextmail.sh/docs/python/reference/billing#getInvoice); Ruby [`billing.get_invoice`](https://nextmail.sh/docs/ruby/reference/billing#getInvoice); PHP [`billing->getInvoice`](https://nextmail.sh/docs/php/reference/billing#getInvoice); Go [`Billing.GetInvoice`](https://nextmail.sh/docs/go/reference/billing#getInvoice); Java [`billing().getInvoice`](https://nextmail.sh/docs/java/reference/billing#getInvoice); C# [`Billing.GetInvoiceAsync`](https://nextmail.sh/docs/csharp/reference/billing#getInvoice).

### `saveBillingDetails`

Save the name and address billed on a charge, as the Billing address dialog does, keep the address for later charges, and start writing its invoice. country is a two-letter code from listBillingCountries, and in the US and Canada state is its two-letter code. It asks for a verification code, and in the app's chat it always asks first. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`PUT /billing/invoices/{orderId}/details`](https://nextmail.sh/docs/api/reference/billing#put-billing-invoices-orderid-details).
- Toolkit: `billing`.

**Inputs**

- `orderId` (`string`, required, not empty)
- `name` (`string`, required, 1 to 200 characters)
- `line1` (`string`, required, 1 to 200 characters)
- `line2` (`string`, up to 200 characters)
- `city` (`string`, required, 1 to 120 characters)
- `postalCode` (`string`, up to 40 characters)
- `state` (`string`, up to 60 characters)
- `country` (`string`, required, 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"`)

Also available in: API [`PUT /billing/invoices/{orderId}/details`](https://nextmail.sh/docs/api/reference/billing#put-billing-invoices-orderid-details); TypeScript [`nextmail.billing.saveInvoiceDetails()`](https://nextmail.sh/docs/sdk/reference/billing#saveInvoiceDetails); Python [`billing.save_invoice_details()`](https://nextmail.sh/docs/python/reference/billing#saveInvoiceDetails); Ruby [`billing.save_invoice_details`](https://nextmail.sh/docs/ruby/reference/billing#saveInvoiceDetails); PHP [`billing->saveInvoiceDetails`](https://nextmail.sh/docs/php/reference/billing#saveInvoiceDetails); Go [`Billing.SaveInvoiceDetails`](https://nextmail.sh/docs/go/reference/billing#saveInvoiceDetails); Java [`billing().saveInvoiceDetails`](https://nextmail.sh/docs/java/reference/billing#saveInvoiceDetails); C# [`Billing.SaveInvoiceDetailsAsync`](https://nextmail.sh/docs/csharp/reference/billing#saveInvoiceDetails).

### `estimateCost`

Price every Nextmail plan for a usage, as the cost calculator on the Nextmail website does: the plan, the extra sends and AI actions it would bill, the monthly total in US dollars, whether each plan fits, and the cheapest plan that fits. A plan does not fit when the usage needs more domains than it includes, more than one person without team access, or more sends than it allows without billing extra.

- No scope.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

- `sends` (`integer`, at least 0, at most 1000000000): Emails sent in a month. Defaults to 0.
- `domains` (`integer`, at least 0, at most 1000000): Domains sent from. Defaults to 1.
- `people` (`integer`, at least 1, at most 1000000): People who use the workspace. Defaults to 1.
- `aiActions` (`integer`, at least 0, at most 10000000): AI actions in a day, such as drafts, rewrites and summaries. Defaults to 0.
- `interval` (`string`, one of `"month"`, `"year"`): How the plan is paid: month or year. Defaults to month.

### `listBillingAddOns`

The add-ons this workspace can buy on top of its plan, today the dedicated sending IP: whether it is for sale, its price, whether the workspace has it and when it ends, whether the workspace qualifies (the Business or Enterprise plan and 100,000 emails in a month), and the IPs it holds. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:read`.
- The app's assistant runs it without asking.
- Toolkit: `billing`.

**Inputs**

Takes no input.

Also available in: API [`GET /billing/add-ons`](https://nextmail.sh/docs/api/reference/billing#get-billing-add-ons); TypeScript [`nextmail.billing.listAddOns()`](https://nextmail.sh/docs/sdk/reference/billing#listAddOns); Python [`billing.list_add_ons()`](https://nextmail.sh/docs/python/reference/billing#listAddOns); Ruby [`billing.list_add_ons`](https://nextmail.sh/docs/ruby/reference/billing#listAddOns); PHP [`billing->listAddOns`](https://nextmail.sh/docs/php/reference/billing#listAddOns); Go [`Billing.ListAddOns`](https://nextmail.sh/docs/go/reference/billing#listAddOns); Java [`billing().listAddOns`](https://nextmail.sh/docs/java/reference/billing#listAddOns); C# [`Billing.ListAddOnsAsync`](https://nextmail.sh/docs/csharp/reference/billing#listAddOns).

### `startAddOnCheckout`

Start buying an add-on, today the dedicated sending IP at 49 US dollars per IP a month. It returns a link to the billing provider's page: give it to the person, who pays there. Nothing is paid through this tool. The IP is set up and warmed up after the payment, which listDedicatedIps shows. It asks for a verification code, and in the app's chat it always asks first. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`POST /billing/add-ons/checkout`](https://nextmail.sh/docs/api/reference/billing#post-billing-add-ons-checkout).
- Toolkit: `billing`.

**Inputs**

- `addOn` (`string`, required, one of `"dedicated-ip"`)
- `theme` (`string`, one of `"light"`, `"dark"`): Light or dark, for the page the link opens. Left out, it follows the browser.

Also available in: API [`POST /billing/add-ons/checkout`](https://nextmail.sh/docs/api/reference/billing#post-billing-add-ons-checkout); TypeScript [`nextmail.billing.startAddOnCheckout()`](https://nextmail.sh/docs/sdk/reference/billing#startAddOnCheckout); Python [`billing.start_add_on_checkout()`](https://nextmail.sh/docs/python/reference/billing#startAddOnCheckout); Ruby [`billing.start_add_on_checkout`](https://nextmail.sh/docs/ruby/reference/billing#startAddOnCheckout); PHP [`billing->startAddOnCheckout`](https://nextmail.sh/docs/php/reference/billing#startAddOnCheckout); Go [`Billing.StartAddOnCheckout`](https://nextmail.sh/docs/go/reference/billing#startAddOnCheckout); Java [`billing().startAddOnCheckout`](https://nextmail.sh/docs/java/reference/billing#startAddOnCheckout); C# [`Billing.StartAddOnCheckoutAsync`](https://nextmail.sh/docs/csharp/reference/billing#startAddOnCheckout).

### `cancelAddOn`

Cancel an add-on, today the dedicated sending IP. It stays until the end of the month already paid for, then the IP is released and mail goes out through the shared IPs again. It asks for a verification code, and in the app's chat it always asks first. Only the owner of the workspace reaches billing, through a client connected with every address.

- Scopes: `billing:write`.
- The app's assistant always asks first.
- Asks for a verification code, the same as [`DELETE /billing/add-ons/{addOn}`](https://nextmail.sh/docs/api/reference/billing#delete-billing-add-ons-addon).
- Toolkit: `billing`.

**Inputs**

- `addOn` (`string`, required, one of `"dedicated-ip"`)

Also available in: API [`DELETE /billing/add-ons/{addOn}`](https://nextmail.sh/docs/api/reference/billing#delete-billing-add-ons-addon); TypeScript [`nextmail.billing.cancelAddOn()`](https://nextmail.sh/docs/sdk/reference/billing#cancelAddOn); Python [`billing.cancel_add_on()`](https://nextmail.sh/docs/python/reference/billing#cancelAddOn); Ruby [`billing.cancel_add_on`](https://nextmail.sh/docs/ruby/reference/billing#cancelAddOn); PHP [`billing->cancelAddOn`](https://nextmail.sh/docs/php/reference/billing#cancelAddOn); Go [`Billing.CancelAddOn`](https://nextmail.sh/docs/go/reference/billing#cancelAddOn); Java [`billing().cancelAddOn`](https://nextmail.sh/docs/java/reference/billing#cancelAddOn); C# [`Billing.CancelAddOnAsync`](https://nextmail.sh/docs/csharp/reference/billing#cancelAddOn).
