Skip to main content
POST
/
api
/
user
/
stripe
/
subscribe
Create subscription checkout session
curl --request POST \
  --url https://pria.praxislxp.com/api/user/stripe/subscribe \
  --header 'Content-Type: application/json' \
  --header 'x-access-token: <api-key>' \
  --data '
{
  "priceId": "price_1234567890",
  "trial": "true",
  "mode": "subscription",
  "institutionId": "<string>",
  "plan": "<string>"
}
'
{
  "id": "cs_test_abc123",
  "url": "<string>",
  "mode": "<string>",
  "status": "<string>",
  "client_reference_id": "<string>"
}

Authorizations

x-access-token
string
header
required

JWT token passed in x-access-token header

Body

application/json
priceId
string
required

Stripe price ID to subscribe to

Example:

"price_1234567890"

trial
string

Set to 'true' to enable a trial period on the subscription

Example:

"true"

mode
enum<string>

Stripe checkout mode (defaults to 'subscription')

Available options:
subscription,
payment
Example:

"subscription"

institutionId
string

Institution ID to associate with the subscription (falls back to user's institution)

plan
string

Plan identifier

Response

Checkout session created successfully. Returns the full Stripe checkout session object.

Full Stripe Checkout Session object (see Stripe API docs)

id
string

Stripe checkout session ID

Example:

"cs_test_abc123"

url
string<uri>

URL to redirect the user to for checkout

mode
string

Checkout mode (subscription or payment)

status
string

Session status

client_reference_id
string

Reference containing priceId and institutionId