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>"
}
'import requests
url = "https://pria.praxislxp.com/api/user/stripe/subscribe"
payload = {
"priceId": "price_1234567890",
"trial": "true",
"mode": "subscription",
"institutionId": "<string>",
"plan": "<string>"
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
priceId: 'price_1234567890',
trial: 'true',
mode: 'subscription',
institutionId: '<string>',
plan: '<string>'
})
};
fetch('https://pria.praxislxp.com/api/user/stripe/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pria.praxislxp.com/api/user/stripe/subscribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'priceId' => 'price_1234567890',
'trial' => 'true',
'mode' => 'subscription',
'institutionId' => '<string>',
'plan' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pria.praxislxp.com/api/user/stripe/subscribe"
payload := strings.NewReader("{\n \"priceId\": \"price_1234567890\",\n \"trial\": \"true\",\n \"mode\": \"subscription\",\n \"institutionId\": \"<string>\",\n \"plan\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pria.praxislxp.com/api/user/stripe/subscribe")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"priceId\": \"price_1234567890\",\n \"trial\": \"true\",\n \"mode\": \"subscription\",\n \"institutionId\": \"<string>\",\n \"plan\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/user/stripe/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"priceId\": \"price_1234567890\",\n \"trial\": \"true\",\n \"mode\": \"subscription\",\n \"institutionId\": \"<string>\",\n \"plan\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cs_test_abc123",
"url": "<string>",
"mode": "<string>",
"status": "<string>",
"client_reference_id": "<string>"
}{
"message": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}Billing
Create subscription checkout session
Creates a Stripe checkout session and returns the full session object. The client should redirect the user to the session URL to complete payment.
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>"
}
'import requests
url = "https://pria.praxislxp.com/api/user/stripe/subscribe"
payload = {
"priceId": "price_1234567890",
"trial": "true",
"mode": "subscription",
"institutionId": "<string>",
"plan": "<string>"
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
priceId: 'price_1234567890',
trial: 'true',
mode: 'subscription',
institutionId: '<string>',
plan: '<string>'
})
};
fetch('https://pria.praxislxp.com/api/user/stripe/subscribe', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pria.praxislxp.com/api/user/stripe/subscribe",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'priceId' => 'price_1234567890',
'trial' => 'true',
'mode' => 'subscription',
'institutionId' => '<string>',
'plan' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pria.praxislxp.com/api/user/stripe/subscribe"
payload := strings.NewReader("{\n \"priceId\": \"price_1234567890\",\n \"trial\": \"true\",\n \"mode\": \"subscription\",\n \"institutionId\": \"<string>\",\n \"plan\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pria.praxislxp.com/api/user/stripe/subscribe")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"priceId\": \"price_1234567890\",\n \"trial\": \"true\",\n \"mode\": \"subscription\",\n \"institutionId\": \"<string>\",\n \"plan\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/user/stripe/subscribe")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"priceId\": \"price_1234567890\",\n \"trial\": \"true\",\n \"mode\": \"subscription\",\n \"institutionId\": \"<string>\",\n \"plan\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "cs_test_abc123",
"url": "<string>",
"mode": "<string>",
"status": "<string>",
"client_reference_id": "<string>"
}{
"message": "<string>"
}{
"success": false,
"message": "<string>",
"error": "<string>"
}Authorizations
JWT token passed in x-access-token header
Body
application/json
Stripe price ID to subscribe to
Example:
"price_1234567890"
Set to 'true' to enable a trial period on the subscription
Example:
"true"
Stripe checkout mode (defaults to 'subscription')
Available options:
subscription, payment Example:
"subscription"
Institution ID to associate with the subscription (falls back to user's institution)
Plan identifier
Response
Checkout session created successfully. Returns the full Stripe checkout session object.
Full Stripe Checkout Session object (see Stripe API docs)
Was this page helpful?
⌘I