Warteliste offen: Hol dir früh Zugang

API-Referenz: Abrechnung

2 Endpunkte der Gruppe «Abrechnung». Die Referenz stammt aus der englischen OpenAPI-Spezifikation und ist nicht übersetzt.

Plan, usage, payment, invoices and the own IP pool (admin)

GET/v1/billing

Beispiel

curl "https://api.sendtide.ch/v1/billing" \
  -H "Authorization: Bearer sk_test_…"

Antworten

StatusBeschreibung
200 Billing Billing
Felder der Antwort
planobject
next_planstring | null
usageobject
invoicesarray<object>
billing_addressobject
vat_ratenumberThe VAT rate of this account today (vat.rate); every invoice stores its own Example: 0.081
vatobjectHow VAT is treated for this account today. The treatment of an invoice is decided when it is created and stored on it.
vat.reasonenum: ch_vat | reverse_charge | not_registeredch_vat: Swiss VAT (customers in CH and LI). reverse_charge: customer abroad with company and VAT number, 0 %. not_registered: Sendtide is not VAT registered, no VAT.
vat.ratenumberExample: 0.081
vat.countrystringISO code of the billing country Example: CH
vat.statusenum: valid | invalid | uncheckedResult of the check of the VAT number
vat.checked_atstring | null (date-time)
vat.business_details_requiredbooleanOutside CH and LI and company or a usable VAT number is missing; paid plans and the IP pool are refused
ip_poolobject
ip_pool.enabledboolean
ip_pool.stateenum: off | provisioning | warming | active | removing | failed
ip_pool.errorstring | null
ip_pool.availablebooleanThe platform offers the pool
ip_pool.price_chfnumberExample: 149
ip_pool.included_mailsintegerExample: 1000000
ip_pool.overage_per_1000_chfnumberExample: 0.15
ip_pool.sent_this_periodintegerMails sent through the pool in the current period
dedicated_ipsinteger1 with an IP pool, else 0. Use ip_pool.

Billing settings and the own IP pool (admin)

PATCH/v1/billing

ip_pool switches «Eigener IP-Pool» on or off: an SES managed dedicated IP pool for the account (Scale plan only, 403 plan_limit otherwise; 422 feature_unavailable while the platform has it off). CHF 149 a month flat including 1'000'000 mails sent through the pool, above that CHF 0.15 per 1'000 started, billed per day the pool was held. The state is in ip_pool.state: provisioning, warming (SES allocates and warms the IPs itself, mail already goes through the pool), active, removing, failed. Deprecated: dedicated_ips (a count): more than 0 means ip_pool: true; answers carry the Deprecation and Sunset headers.

billing_address keys: company, addition, street, zip, city, country (ISO 3166-1 alpha-2; an older country name is converted), vat_id, reference. The VAT number is checked for its format (CH, LI, the EU countries, GB, NO; any other country takes letters and digits) and stored in its canonical form: 422 validation_error on billing_address.vat_id when it is malformed. With VIES_CHECK on, an EU number is looked up at VIES; the result is in vat.status. Outside Switzerland and Liechtenstein Sendtide sells to businesses only: 422 business_details_required when ip_pool is switched on (and on POST /v1/billing/plan for a paid plan) while company, country and a VAT number are missing or the number was found invalid.

Request-Body application/json

FeldTypBeschreibung
stop_at_quotaboolean
budget_chfnumber
clear_budgetboolean
billing_emailstring
billing_addressobject
ip_poolboolean
dedicated_ipsveraltetinteger

Beispiel

curl -X PATCH "https://api.sendtide.ch/v1/billing" \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{"stop_at_quota":true,"budget_chf":100}'

Antworten

StatusBeschreibung
200 Billing Billing
Felder der Antwort
planobject
next_planstring | null
usageobject
invoicesarray<object>
billing_addressobject
vat_ratenumberThe VAT rate of this account today (vat.rate); every invoice stores its own Example: 0.081
vatobjectHow VAT is treated for this account today. The treatment of an invoice is decided when it is created and stored on it.
vat.reasonenum: ch_vat | reverse_charge | not_registeredch_vat: Swiss VAT (customers in CH and LI). reverse_charge: customer abroad with company and VAT number, 0 %. not_registered: Sendtide is not VAT registered, no VAT.
vat.ratenumberExample: 0.081
vat.countrystringISO code of the billing country Example: CH
vat.statusenum: valid | invalid | uncheckedResult of the check of the VAT number
vat.checked_atstring | null (date-time)
vat.business_details_requiredbooleanOutside CH and LI and company or a usable VAT number is missing; paid plans and the IP pool are refused
ip_poolobject
ip_pool.enabledboolean
ip_pool.stateenum: off | provisioning | warming | active | removing | failed
ip_pool.errorstring | null
ip_pool.availablebooleanThe platform offers the pool
ip_pool.price_chfnumberExample: 149
ip_pool.included_mailsintegerExample: 1000000
ip_pool.overage_per_1000_chfnumberExample: 0.15
ip_pool.sent_this_periodintegerMails sent through the pool in the current period
dedicated_ipsinteger1 with an IP pool, else 0. Use ip_pool.
403 Fehler im üblichen Format, Fehler und Limits
422 Fehler im üblichen Format, Fehler und Limits