Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview

Open the billing portal

Starts a Stripe billing portal session, where the organisation changes its card, reads its invoices and cancels its subscription, and returns the URL to send the browser to. It answers 409 when the cluster does not bill through Stripe.

POST/_luna/orgs/{org}/billing/portal
Authorization
AuthorizationBearer token · headerrequired

An account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.

Scopes:billing:write
Path parameters
orgstringrequired

The organisation, by its slug.

Request body
requiredapplication/json
returnUrlstringrequired

The http or https URL to return to when the person is done.

Responses
200

The billing portal page.

urlstringrequired

The page's URL. It works once and for a short while.

default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://luna.example.com/_luna/orgs/string/billing/portal' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "returnUrl": "string"
}'
Response
{
  "url": "string"
}

Was this page helpful?