Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.quickshops.app/llms.txt

Use this file to discover all available pages before exploring further.

The Subscriptions endpoint generates a Stripe billing portal URL for a specific subscriber. You call this endpoint from your server, receive a URL, and redirect the subscriber’s browser to the portal. From there they can cancel their subscription, update their payment method, or view billing history. A secret key is required.
The memberSessionId is the session ID from your member authentication system that links the portal request to the correct subscriber in Quickshops. This value identifies which subscriber’s billing portal to open — pass the session ID of the currently authenticated user.

Create billing portal session

Generates a Stripe billing portal URL for the subscriber identified by the given member session ID.
POST /v1/subscription/portal

Body parameters

memberSessionId
string
required
The session ID of the authenticated member whose subscription portal you want to open. This must correspond to an active subscriber on the store.

Request

curl -X POST https://api.quickshops.app/v1/subscription/portal \
  -H "x-api-key: qk_your_secret_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "memberSessionId": "sess_01j..." }'

Response

{
  "url": "https://billing.stripe.com/p/session/..."
}
url
string
required
A Stripe billing portal URL. Redirect the subscriber’s browser to this URL so they can manage their subscription.

Redirecting the subscriber

Call this endpoint from your server-side handler using the authenticated subscriber’s session ID. Return the URL to your frontend to perform the redirect. Keep your secret API key on the server.
// Server-side only (API route, server action, or loader)
const response = await fetch("https://api.quickshops.app/v1/subscription/portal", {
  method: "POST",
  headers: {
    "x-api-key": process.env.HEADLESS_API_KEY!,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ memberSessionId: currentUser.sessionId }),
});

const { url } = await response.json();

// Return the URL to your frontend so it can redirect the subscriber
return { portalUrl: url };
Then in your client-side code, redirect using the URL returned from your server:
// Client-side — after receiving the URL from your server endpoint
window.location.href = portalUrl;
After the subscriber finishes in the portal, Stripe redirects them to the return URL configured in your Quickshops dashboard.