API Documentation
The UptimeTea API is easy to use and free for all plans.
Start checkout
Creates a Stripe Checkout session. Send the user to session_url to pay.
POST
https://api.uptimetea.com/billing/checkout
Headers
-
AuthorizationREQUIREDSTRINGBearer $TOKEN -
Content-TypeREQUIREDSTRINGapplication/json
Body parameters
-
planSTRINGteam or agency. Defaults to team.
-
intervalSTRINGmonth or year. Defaults to month.
Response body
{
"session_url": "https://checkout.stripe.com/c/pay/cs_123"
}
Code examples
curl -X POST "https://api.uptimetea.com/billing/checkout" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"plan": "team",
"interval": "year"
}'
// Start checkout
const response = await fetch('https://api.uptimetea.com/billing/checkout', {
method: 'POST',
headers: {
'Authorization': 'Bearer ' + yourToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"plan": "team",
"interval": "year"
})
});
const data = await response.json();
console.log(data);
# Start checkout
import requests
headers = {'Authorization': f'Bearer {your_token}'}
response = requests.post(
'https://api.uptimetea.com/billing/checkout',
headers=headers,
json={
'plan': 'team',
'interval': 'year'
}
)
print(response.json())
// Start checkout
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"plan": "team",
"interval": "year"
}`)
req, _ := http.NewRequest("POST", "https://api.uptimetea.com/billing/checkout", body)
req.Header.Set("Authorization", "Bearer "+yourToken)
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(resp.Status, string(data))
}
# Start checkout
require 'net/http'
require 'uri'
uri = URI('https://api.uptimetea.com/billing/checkout')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{your_token}"
request['Content-Type'] = 'application/json'
request.body = <<~JSON
{
"plan": "team",
"interval": "year"
}
JSON
response = http.request(request)
puts response.code, response.body
<?php
// Start checkout
$ch = curl_init('https://api.uptimetea.com/billing/checkout');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . $yourToken,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, <<<'JSON'
{
"plan": "team",
"interval": "year"
}
JSON);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);