Open Stripe's customer portal.
const url = 'https://api.opdns.io/v1/account/billing/portal';const options = { method: 'POST', headers: {cookie: '__Host-opdns_session=<__Host-opdns_session>'}};
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.opdns.io/v1/account/billing/portal \ --cookie __Host-opdns_session=<__Host-opdns_session>The organisation owner’s session only. Returns the URL of a Stripe customer
portal session for the organisation (short-lived): the card, the billing address
and tax id, a plan or interval change, cancellation at the end of the period, and
the invoices. The portal links back to the dashboard’s
Account page. 409 no_billing_account before the first completed checkout.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The portal URL.
object
Where the dashboard sends the browser (Stripe’s page, short-lived).
Example
{ "url": "https://billing.stripe.com/p/session/test_a1b2c3"}Not authenticated.
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/unauthenticated", "title": "Unauthorized", "status": 401, "code": "unauthenticated", "detail": "You're not signed in, or your sign-in has ended. Please sign in again to continue.", "request_id": "5f2c9a0e7b1d4c38"}Authenticated but not allowed: insufficient_scope, session_required, csrf_rejected, reauth_required (sign in again within five minutes), account_pending_deletion (the account is in its deletion cooling-off), email_unverified (creating a profile before the email address is verified).
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/insufficient_scope", "title": "Forbidden", "status": 403, "code": "insufficient_scope", "detail": "This API token isn't allowed to do this: it needs the profiles:write scope. Create a token that includes it, then try again.", "required_scope": "profiles:write", "request_id": "5f2c9a0e7b1d4c38"}Conflict. On POSTs with an Idempotency-Key: idempotency_key_reused (the key was used with a different request) or idempotency_in_progress (the first request with it is still running; retry after Retry-After).
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/idempotency_key_reused", "title": "Conflict", "status": 409, "code": "idempotency_key_reused", "detail": "This Idempotency-Key was already used with a different request. Please use a new key for each new request.", "request_id": "5f2c9a0e7b1d4c38"}Headers
Section titled “Headers”The payment provider (Stripe) failed or did not answer.
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/billing_provider_error", "title": "Bad Gateway", "status": 502, "code": "billing_provider_error", "detail": "Our payment provider isn't responding right now. This isn't a problem with your account. Please try again in a minute."}Billing is not available on this deployment (no payment keys yet).
object
Stable machine code.
object
Seconds, repeating the Retry-After header (rate limits, offline nodes).
The plan limit a plan_limit problem hit.
object
The plan’s value of the limit.
Where to move to a larger plan.
The scope the API token lacked (insufficient_scope).
Example
{ "type": "https://opdns.io/problems/billing_unavailable", "title": "Service Unavailable", "status": 503, "code": "billing_unavailable", "detail": "Payments aren't available yet, so plans can't be bought or changed right now. Please check back later."}