Attach Stripe ids to a plan version
const url = 'https://api.sloose.com/billing/admin/plans/pv_business_3/stripe';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"stripeProductId":"example","stripePriceMonthlyId":"example","stripePriceAnnualId":"example","stripePriceOverageId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.sloose.com/billing/admin/plans/pv_business_3/stripe \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "stripeProductId": "example", "stripePriceMonthlyId": "example", "stripePriceAnnualId": "example", "stripePriceOverageId": "example" }'Backoffice route: a staff session, or ADMIN_TOKEN; never a customer’s session. Run after creating the products and prices in Stripe. Only the fields you send change.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The plan version id.
Example
pv_business_3The plan version id.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "stripeProductId": "example", "stripePriceMonthlyId": "example", "stripePriceAnnualId": "example", "stripePriceOverageId": "example"}Responses
Section titled “Responses”The plan version as it now stands.
object
Examplegenerated
{ "additionalProperty": "example"}A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}A customer’s session, an API token, or no bearer at all — not staff, and not the ADMIN_TOKEN (code: ADMIN_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No such plan version.
object
Examplegenerated
{ "error": "example"}The restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.
object
Example
{ "code": "MAINTENANCE"}Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).