Get a checkout link for a paid plan
const url = 'https://api.ringingbytes.com/v1/billing/checkout';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"plan":"payg"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.ringingbytes.com/v1/billing/checkout \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "plan": "payg" }'A hosted checkout link for an organization without a plan. The same link is emailed to the organization’s owners; only a person can pay. Poll GET /v1/account for the outcome. Needs billing:checkout. At most 5 links an hour per organization (429). An organization that already has a plan gets 409 SUBSCRIPTION_EXISTS: agents cannot change or cancel plans.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Responses
Section titled “Responses”OK
object
Hosted checkout. Give it to a person: only a person can pay.
True only when the email service accepted the link for every owner. When false, give the link to your person yourself: nobody may have received it.
How the emails to the owners went. Failed emails are not retried.
object
The organization’s owners.
Emails the email service accepted (one per owner). Less than owners when some failed or the server sends no email.
Example
{ "plan": "payg"}