What "Restart" voids and what it charges today, before the customer confirms.
POST
/billing/subscription/restart/preview
const url = 'https://api.siteqwality.com/billing/subscription/restart/preview';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
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.siteqwality.com/billing/subscription/restart/preview \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”The invoices voided and today’s charge
Media type application/json
object
stripe_subscription_id
required
The plan being restarted; send it back on the confirm.
string
status
required
unpaid or past_due.
string
voided
required
Voided first, oldest first: nothing more is owed on them.
object
invoices
required
Voided by the start over, oldest first: nothing more is owed on them.
Array<object>
One invoice “Choose a different plan” voids.
object
id
required
string
number
string | null
created
required
Unix seconds.
integer format: int64
amount_cents
required
Left to pay on it, minor units.
integer format: int64
currency
required
ISO 4217, uppercase.
string
status
required
string
amount_cents
required
What is left to pay on them together, minor units.
integer format: int64
currency
ISO 4217, uppercase; null when nothing is outstanding.
string | null
charge
required
The same plan from today.
object
amount_due_cents
required
Charged today, net of any account credit, minor units.
integer format: int64
total_cents
required
integer format: int64
currency
required
ISO 4217, uppercase.
string
lines
required
Array<object>
object
description
required
string
amount_cents
required
integer format: int64
renews_at
Unix seconds: when the restarted plan first renews.
integer | null format: int64
Example generated
{ "stripe_subscription_id": "example", "status": "example", "voided": { "invoices": [ { "id": "example", "number": "example", "created": 1, "amount_cents": 1, "currency": "example", "status": "example" } ], "amount_cents": 1, "currency": "example" }, "charge": { "amount_due_cents": 1, "total_cents": 1, "currency": "example", "lines": [ { "description": "example", "amount_cents": 1 } ], "renews_at": 1 }}Missing or invalid authentication
Caller has no billing role
The plan is not unpaid or past due, or can’t be restarted
Internal server error