Aller à la documentation
Go

client.Billing

Chaque méthode de cet espace de noms : sa signature, ses paramètres, ce qu'elle retourne et un exemple.

Méthodes

The plan of the workspace and what it costs, as Plans & Billing shows them: the plan and its usage, 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. Only the workspace owner reaches it, and nothing is paid through the API.

Billing.Get

Read the plan

Portéesbilling:read
Signature
Get(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)

Returns the plan of the workspace and what it includes, as Plans & 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. metered is false when billing is off on the install, 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with plan, interval, renewsAt, nextCharge, domains, usage and payAsYouGo.

Exemple

billing, err := client.Billing.Get(ctx)if err != nil {	return err} fmt.Println(billing.String("planName"), billing.Object("usage").Object("sends").Int("used"), billing.Object("usage").Object("sends").Int("limit"))

Remarques

  • A limit of null means the plan has none.

Aussi disponible dans

API
GET /billing
TypeScript
billing.get()
Python
billing.get()
Ruby
billing.get
PHP
billing->get
Java
billing().get
C#
Billing.GetAsync
CLI
openemail billing get

Billing.ListPlans

List the plans

Portéesbilling:read
Signature
ListPlans(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)

Returns every plan, cheapest first, with its price in US cents and what it includes. available says whether it is sold on the install, 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with one billing plan object per plan in data.

Exemple

plan, err := client.Billing.ListPlans(ctx)if err != nil {	return err} fmt.Println(plan.String("object"))

Aussi disponible dans

API
GET /billing/plans
TypeScript
billing.listPlans()
Python
billing.list_plans()
Ruby
billing.list_plans
PHP
billing->listPlans
Java
billing().listPlans
C#
Billing.ListPlansAsync
CLI
openemail billing list-plans

Billing.GetUsage

Read the usage history

Portéesbilling:read
Signature
GetUsage(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)

Returns the sends and AI actions of each day, and what pay as you go extras cost each 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

openemail.WithDaysint

How many days back to go, from 1 to 3,660. The server defaults to 30.

openemail.WithDaysWindowstring

all, for every day since the workspace was made. It is constants.BillingUsageWindowsAll.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with days, months, dailyAiActions and monthlySends.

Exemple

usage, err := client.Billing.GetUsage(ctx, openemail.WithDays(90))if err != nil {	return err} sent := 0 for _, day := range usage.Objects("days") {	sent += day.Int("sends")} fmt.Println(sent, "sends in the last 90 days")

Aussi disponible dans

API
GET /billing/usage
TypeScript
billing.getUsage()
Python
billing.get_usage()
Ruby
billing.get_usage
PHP
billing->getUsage
Java
billing().getUsage
C#
Billing.GetUsageAsync
CLI
openemail billing get-usage

Billing.ListAlerts

List the billing alerts

Portéesbilling:read
Signature
ListAlerts(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)

Returns 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with one billing alert object per alert in data.

Exemple

alert, err := client.Billing.ListAlerts(ctx)if err != nil {	return err} fmt.Println(alert.String("object"))

Remarques

  • An alert keeps its id while the same thing is true, so one that was dismissed can stay dismissed.

Aussi disponible dans

API
GET /billing/alerts
TypeScript
billing.listAlerts()
Python
billing.list_alerts()
Ruby
billing.list_alerts
PHP
billing->listAlerts
Java
billing().listAlerts
C#
Billing.ListAlertsAsync
CLI
openemail billing list-alerts

Billing.ListCountries

List the billing countries

Portéesbilling:read
Signature
ListCountries(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)

Returns every country a billing address can be in, as the two-letter ISO 3166 codes SaveInvoiceDetails takes as country.

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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with the codes in data.

Exemple

country, err := client.Billing.ListCountries(ctx)if err != nil {	return err} fmt.Println(country.String("object"))

Aussi disponible dans

API
GET /billing/countries
TypeScript
billing.listCountries()
Python
billing.list_countries()
Ruby
billing.list_countries
PHP
billing->listCountries
Java
billing().listCountries
C#
Billing.ListCountriesAsync
CLI
openemail billing list-countries

Billing.GetPayAsYouGo

Read pay as you go

Portéesbilling:read
Signature
GetPayAsYouGo(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)

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

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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with the state, limits, prices and period.

Exemple

payg, err := client.Billing.GetPayAsYouGo(ctx)if err != nil {	return err} fmt.Println(payg.Bool("enabled"), payg.Int("spentCents"), payg.Int("limitCents"))

Remarques

  • Amounts are in US cents.

Aussi disponible dans

API
GET /billing/pay-as-you-go
TypeScript
billing.getPayAsYouGo()
Python
billing.get_pay_as_you_go()
Ruby
billing.get_pay_as_you_go
PHP
billing->getPayAsYouGo
Java
billing().getPayAsYouGo
C#
Billing.GetPayAsYouGoAsync
CLI
openemail billing get-pay-as-you-go

Billing.SetPayAsYouGo

Turn pay as you go on or off

Portéesbilling:write
Signature
SetPayAsYouGo(ctx context.Context, body openemail.Body, opts ...openemail.RequestOption) (openemail.Object, error)

Turns pay as you go on or off, as the switch on Plans & 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 ConfirmPayAsYouGo after they return.

Nothing is paid through the API: the person pays, changes the card or cancels on the billing provider's page the link opens, 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

enabledboolObligatoire

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

themestring

light or dark, for the page the link opens.

localestring

A language tag such as de or pt-PT, for the page the link opens.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with enabled, suspended, activating and checkoutUrl.

Exemple

result, err := client.Billing.SetPayAsYouGo(ctx, openemail.Body{"enabled": true})if err != nil {	return err} fmt.Println(result.String("checkoutUrl"))

Remarques

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • Turning it on where pay as you go is not set up on the install is 503 billing_not_configured.

  • The SDK does not retry it.

Aussi disponible dans

API
PATCH /billing/pay-as-you-go
TypeScript
billing.setPayAsYouGo()
Python
billing.set_pay_as_you_go()
Ruby
billing.set_pay_as_you_go
PHP
billing->setPayAsYouGo
Java
billing().setPayAsYouGo
C#
Billing.SetPayAsYouGoAsync
CLI
openemail billing set-pay-as-you-go

Billing.SetPayAsYouGoLimit

Set the pay as you go limit

Portéesbilling:write
Signature
SetPayAsYouGoLimit(ctx context.Context, body openemail.Body, opts ...openemail.RequestOption) (openemail.Object, error)

Sets the monthly spending limit of pay as you go, in US cents, one of the amounts GetPayAsYouGo 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

limitCentsintObligatoire

The limit in US cents: 1,000, 2,500, 5,000, 10,000, 25,000, 50,000, 100,000, 250,000 or 500,000.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with limitCents.

Exemple

limit, err := client.Billing.SetPayAsYouGoLimit(ctx, openemail.Body{"limitCents": 10000})if err != nil {	return err} fmt.Println(limit.String("object"))

Remarques

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • A workspace where pay as you go was never set up is 409 pay_as_you_go_not_enrolled.

  • The SDK does not retry it.

Aussi disponible dans

API
PUT /billing/pay-as-you-go/limit
TypeScript
billing.setPayAsYouGoLimit()
Python
billing.set_pay_as_you_go_limit()
Ruby
billing.set_pay_as_you_go_limit
PHP
billing->setPayAsYouGoLimit
Java
billing().setPayAsYouGoLimit
C#
Billing.SetPayAsYouGoLimitAsync
CLI
openemail billing set-pay-as-you-go-limit

Billing.ConfirmPayAsYouGo

Confirm pay as you go

Portéesbilling:write
Signature
ConfirmPayAsYouGo(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)

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.

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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with enabled.

Exemple

confirmation, err := client.Billing.ConfirmPayAsYouGo(ctx)if err != nil {	return err} fmt.Println(confirmation.Bool("enabled"))

Remarques

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • It is safe to call again.

  • The SDK does not retry it.

Aussi disponible dans

API
POST /billing/pay-as-you-go/confirm
TypeScript
billing.confirmPayAsYouGo()
Python
billing.confirm_pay_as_you_go()
Ruby
billing.confirm_pay_as_you_go
PHP
billing->confirmPayAsYouGo
Java
billing().confirmPayAsYouGo
C#
Billing.ConfirmPayAsYouGoAsync
CLI
openemail billing confirm-pay-as-you-go

Billing.StartCheckout

Start a checkout

Portéesbilling:write
Signature
StartCheckout(ctx context.Context, body openemail.Body, opts ...openemail.RequestOption) (openemail.Object, error)

Starts buying a paid plan for a workspace on Free, as choosing a plan in the app does, and returns with 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 with OpenPortal instead.

Nothing is paid through the API: the person pays, changes the card or cancels on the billing provider's page the link opens, 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

planstringObligatoire

starter, business or enterprise.

intervalstring

month or year. Defaults to month.

themestring

light or dark, for the page the link opens.

localestring

A language tag such as de or pt-PT, for the page the link opens.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with url.

Exemple

checkout, err := client.Billing.StartCheckout(ctx, openemail.Body{"plan": "business", "interval": "year"})if err != nil {	return err} fmt.Println(checkout.String("url"))

Remarques

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • A workspace that already pays for a plan is 409 plan_conflict, and a plan or interval not sold on the install is 422 plan_unavailable.

  • The SDK does not retry it.

Aussi disponible dans

API
POST /billing/checkout
TypeScript
billing.startCheckout()
Python
billing.start_checkout()
Ruby
billing.start_checkout
PHP
billing->startCheckout
Java
billing().startCheckout
C#
Billing.StartCheckoutAsync
CLI
openemail billing start-checkout

Billing.OpenPortal

Open the billing portal

Portéesbilling:write
Signature
OpenPortal(ctx context.Context, body openemail.Body, opts ...openemail.RequestOption) (openemail.Object, error)

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.

Nothing is paid through the API: the person pays, changes the card or cancels on the billing provider's page the link opens, 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

themestring

light or dark, for the page the link opens.

localestring

A language tag such as de or pt-PT, for the page the link opens.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with url.

Exemple

portal, err := client.Billing.OpenPortal(ctx, openemail.Body{"theme": "dark"})if err != nil {	return err} fmt.Println(portal.String("url"))

Remarques

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • The SDK does not retry it.

Aussi disponible dans

API
POST /billing/portal
TypeScript
billing.openPortal()
Python
billing.open_portal()
Ruby
billing.open_portal
PHP
billing->openPortal
Java
billing().openPortal
C#
Billing.OpenPortalAsync
CLI
openemail billing open-portal

Billing.ListInvoices

List the charges

Portéesbilling:read
Signature
ListInvoices(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)

Returns every charge of the workspace with the state of its invoice, a page at a time, as History on Plans & Billing lists them. search matches the plan, the invoice number, the charge id and the name billed.

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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

openemail.WithPageint

Which page, from 1.

openemail.WithLimitint

Charges per page, from 1 to 100. The server defaults to 25.

openemail.WithSortstring

newest, the default, or oldest.

openemail.WithSearchstring

Words to look for, up to 120 characters.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with data, total, page, limit, hasMore and metered.

Exemple

invoice, err := client.Billing.ListInvoices(ctx, openemail.WithLimit(10))if err != nil {	return err} fmt.Println(invoice.String("object"))

Remarques

Aussi disponible dans

API
GET /billing/invoices
TypeScript
billing.listInvoices()
Python
billing.list_invoices()
Ruby
billing.list_invoices
PHP
billing->listInvoices
Java
billing().listInvoices
C#
Billing.ListInvoicesAsync
CLI
openemail billing list-invoices

Billing.GetInvoice

Get the invoice of a charge

Portéesbilling:read
Signature
GetInvoice(ctx context.Context, orderID string, opts ...openemail.RequestOption) (openemail.Object, error)

Returns 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, 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

orderIDstringObligatoire

The charge id, as ListInvoices returns it.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with url and fileName.

Exemple

invoice, err := client.Billing.GetInvoice(ctx, "ord_8b1f4c2e9a7d3b60e5f1a2c4")if err != nil {	return err} fmt.Println(invoice.String("fileName"), invoice.String("url"))

Remarques

Aussi disponible dans

API
GET /billing/invoices/{orderId}
TypeScript
billing.getInvoice()
Python
billing.get_invoice()
Ruby
billing.get_invoice
PHP
billing->getInvoice
Java
billing().getInvoice
C#
Billing.GetInvoiceAsync
CLI
openemail billing get-invoice

Billing.SaveInvoiceDetails

Save the billing details of a charge

Portéesbilling:write
Signature
SaveInvoiceDetails(ctx context.Context, orderID string, body openemail.Body, opts ...openemail.RequestOption) (openemail.Object, error)

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.

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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

orderIDstringObligatoire

The charge id, as ListInvoices returns it.

namestringObligatoire

Who is billed, up to 200 characters.

line1stringObligatoire

The street address, up to 200 characters.

line2string

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

citystringObligatoire

Up to 120 characters.

postalCodestring

Up to 40 characters.

statestring

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

countrystringObligatoire

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

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with invoice and message.

Exemple

details, err := client.Billing.SaveInvoiceDetails(ctx, "ord_8b1f4c2e9a7d3b60e5f1a2c4", openemail.Body{	"name":       "Acme Ltd",	"line1":      "1 Market Street",	"city":       "London",	"postalCode": "EC1A 1AA",	"country":    "GB",})if err != nil {	return err} fmt.Println(details.String("object"))

Remarques

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • An address the billing provider refuses is 422 billing_address_rejected.

  • The SDK does not retry it.

Aussi disponible dans

API
PUT /billing/invoices/{orderId}/details
TypeScript
billing.saveInvoiceDetails()
Python
billing.save_invoice_details()
Ruby
billing.save_invoice_details
PHP
billing->saveInvoiceDetails
Java
billing().saveInvoiceDetails
C#
Billing.SaveInvoiceDetailsAsync
CLI
openemail billing save-invoice-details

Billing.ListAddOns

List add-ons

Portéesbilling:read
Signature
ListAddOns(ctx context.Context, opts ...openemail.RequestOption) (openemail.Object, error)

Returns 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 in priceCents, whether the workspace has it and when it ends, the IPs it brought, 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with one add on object per add-on in data: addOn, available, status, priceCents, endsAt, eligibility and ips.

Exemple

on, err := client.Billing.ListAddOns(ctx)if err != nil {	return err} fmt.Println(on.String("object"))

Remarques

  • status is null until the workspace has the add-on. pending is paid and being set up, warming and active send through the dedicated IP, and releasing is being taken down.

  • A GET is retried automatically on network failure and on 408, 500, 502, 503 and 504 responses, up to the client's openemail.WithMaxRetries, and on a 429 only when it carries a Retry-After of a minute or less.

Aussi disponible dans

API
GET /billing/add-ons
TypeScript
billing.listAddOns()
Python
billing.list_add_ons()
Ruby
billing.list_add_ons
PHP
billing->listAddOns
Java
billing().listAddOns
C#
Billing.ListAddOnsAsync
CLI
openemail billing list-add-ons

Billing.StartAddOnCheckout

Start a checkout for an add-on

Portéesbilling:write
Signature
StartAddOnCheckout(ctx context.Context, body openemail.Body, opts ...openemail.RequestOption) (openemail.Object, error)

Starts buying an add-on, as the button under Plans & Billing does, and returns with the link to the checkout. Nothing is charged until the person pays there. Once it is paid the dedicated IP is set up and warmed up, which Sending.ListDedicatedIPs shows.

Nothing is paid through the API: the person pays on the billing provider's page the link opens, 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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

addOnstringObligatoire

The add-on to buy: dedicated-ip.

themestring

light or dark, for the page the link opens.

localestring

A language tag such as de or pt-PT, for the page the link opens.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object with addOn and url.

Exemple

checkout, err := client.Billing.StartAddOnCheckout(ctx, openemail.Body{"addOn": "dedicated-ip"})if err != nil {	return err} fmt.Println(checkout.String("url"))

Remarques

Aussi disponible dans

API
POST /billing/add-ons/checkout
TypeScript
billing.startAddOnCheckout()
Python
billing.start_add_on_checkout()
Ruby
billing.start_add_on_checkout
PHP
billing->startAddOnCheckout
Java
billing().startAddOnCheckout
C#
Billing.StartAddOnCheckoutAsync
CLI
openemail billing start-add-on-checkout

Billing.CancelAddOn

Cancel an add-on

Portéesbilling:write
Signature
CancelAddOn(ctx context.Context, addOn string, opts ...openemail.RequestOption) (openemail.Object, error)

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 403 owner_only, and a key or token limited to particular addresses or domains is 422 capability_unsupported.

Paramètres

addOnstringObligatoire

The add-on to cancel: dedicated-ip.

openemail.WithAPIKeystring

Overrides the client's API key for this call only.

Retourne

An openemail.Object, now with endsAt set.

Exemple

addOn, err := client.Billing.CancelAddOn(ctx, "dedicated-ip")if err != nil {	return err} fmt.Println(addOn.String("endsAt"))

Remarques

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • A workspace that does not have the add-on, or whose add-on is already ending, is 409 add_on_not_active.

  • The SDK does not retry a delete.

Aussi disponible dans

API
DELETE /billing/add-ons/{addOn}
TypeScript
billing.cancelAddOn()
Python
billing.cancel_add_on()
Ruby
billing.cancel_add_on
PHP
billing->cancelAddOn
Java
billing().cancelAddOn
C#
Billing.CancelAddOnAsync
CLI
openemail billing cancel-add-on