Skip to main content
POST
/
api
/
user
/
stripe
/
plan
Get current subscription plan
curl --request POST \
  --url https://pria.praxislxp.com/api/user/stripe/plan \
  --header 'x-access-token: <api-key>'
import requests

url = "https://pria.praxislxp.com/api/user/stripe/plan"

headers = {"x-access-token": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {'x-access-token': '<api-key>'}};

fetch('https://pria.praxislxp.com/api/user/stripe/plan', 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/plan",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "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"
	"net/http"
	"io"
)

func main() {

	url := "https://pria.praxislxp.com/api/user/stripe/plan"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-access-token", "<api-key>")

	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/plan")
  .header("x-access-token", "<api-key>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://pria.praxislxp.com/api/user/stripe/plan")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "plan": "pro",
  "status": "active",
  "trial_end": 1700000000,
  "cancel_at_period_end": false,
  "current_period_end": 1700000000,
  "canceled_at": 123,
  "subscription": true
}
{
  "message": "<string>"
}
{
  "success": false,
  "message": "<string>",
  "error": "<string>"
}

Authorizations

x-access-token
string
header
required

JWT token passed in x-access-token header

Response

Plan retrieved successfully

plan
string

Plan name derived from the Stripe price ID (empty string if none)

Example:

"pro"

status
enum<string>

Stripe subscription status

Available options:
incomplete,
incomplete_expired,
trialing,
active,
past_due,
canceled,
unpaid
Example:

"active"

trial_end
integer | null

Unix timestamp when the trial ends (null if no trial)

Example:

1700000000

cancel_at_period_end
boolean

Whether the subscription is set to cancel at the end of the current period

Example:

false

current_period_end
integer | null

Unix timestamp when the current billing period ends

Example:

1700000000

canceled_at

Unix timestamp when the subscription was canceled, or empty string if not canceled

subscription
boolean

Whether the user has an active Stripe subscription

Example:

true