Subscriptions
Get current subscription
Returns current plan, subscription details, and usage summary
GET
/
api
/
subscription
Get current subscription
curl --request GET \
--url https://spitshake.io/api/subscription \
--header 'X-Auth-Token: <api-key>'import requests
url = "https://spitshake.io/api/subscription"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://spitshake.io/api/subscription', 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://spitshake.io/api/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Auth-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://spitshake.io/api/subscription"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Auth-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.get("https://spitshake.io/api/subscription")
.header("X-Auth-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Auth-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"plan": {
"id": 123,
"name": "<string>",
"display_name": "<string>",
"price_monthly_cents": 123,
"price_yearly_cents": 123,
"limits": {
"templates": 123,
"submissions_per_month": 123,
"users": 123,
"storage_mb": 123
},
"features": [
"<string>"
],
"position": 123
},
"subscription": {
"id": 123,
"status": "active",
"interval": "monthly",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"trial_ends_at": "2023-11-07T05:31:56Z"
},
"usage": {
"templates": {
"used": 123,
"limit": 123,
"allowed": true
},
"submissions_this_month": {
"used": 123,
"limit": 123,
"allowed": true
},
"users": {
"used": 123,
"limit": 123,
"allowed": true
}
}
}⌘I
Get current subscription
curl --request GET \
--url https://spitshake.io/api/subscription \
--header 'X-Auth-Token: <api-key>'import requests
url = "https://spitshake.io/api/subscription"
headers = {"X-Auth-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Auth-Token': '<api-key>'}};
fetch('https://spitshake.io/api/subscription', 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://spitshake.io/api/subscription",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Auth-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://spitshake.io/api/subscription"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Auth-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.get("https://spitshake.io/api/subscription")
.header("X-Auth-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://spitshake.io/api/subscription")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Auth-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"plan": {
"id": 123,
"name": "<string>",
"display_name": "<string>",
"price_monthly_cents": 123,
"price_yearly_cents": 123,
"limits": {
"templates": 123,
"submissions_per_month": 123,
"users": 123,
"storage_mb": 123
},
"features": [
"<string>"
],
"position": 123
},
"subscription": {
"id": 123,
"status": "active",
"interval": "monthly",
"current_period_start": "2023-11-07T05:31:56Z",
"current_period_end": "2023-11-07T05:31:56Z",
"canceled_at": "2023-11-07T05:31:56Z",
"trial_ends_at": "2023-11-07T05:31:56Z"
},
"usage": {
"templates": {
"used": 123,
"limit": 123,
"allowed": true
},
"submissions_this_month": {
"used": 123,
"limit": 123,
"allowed": true
},
"users": {
"used": 123,
"limit": 123,
"allowed": true
}
}
}
