Start a Stripe Checkout
curl --request POST \
--url https://api.datacircle.dev/checkout/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_usd": 50
}
'import requests
url = "https://api.datacircle.dev/checkout/"
payload = { "amount_usd": 50 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount_usd: 50})
};
fetch('https://api.datacircle.dev/checkout/', 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://api.datacircle.dev/checkout/",
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([
'amount_usd' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.datacircle.dev/checkout/"
payload := strings.NewReader("{\n \"amount_usd\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.datacircle.dev/checkout/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount_usd\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datacircle.dev/checkout/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount_usd\": 50\n}"
response = http.request(request)
puts response.read_body{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_a1Kq7RzT3vXbN8mLwP2cYdF6hJ0sE4uG9iO5tA1kB3nV7xZ2"
}{
"error": "amount_usd must be a whole number from 5 to 10000"
}{
"error": "stripe refused the checkout session"
}{
"error": "payments are not configured on this server"
}Datacircle
Start a Stripe Checkout
Starts a Stripe Checkout that adds funds to your balance, any whole number of dollars from 5 to 10,000. Open checkout_url, or hand it to a human to pay: nothing is charged until they do. The funds land in funds_usd once Stripe confirms the payment, and never expire.
POST
/
checkout
/
Start a Stripe Checkout
curl --request POST \
--url https://api.datacircle.dev/checkout/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount_usd": 50
}
'import requests
url = "https://api.datacircle.dev/checkout/"
payload = { "amount_usd": 50 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount_usd: 50})
};
fetch('https://api.datacircle.dev/checkout/', 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://api.datacircle.dev/checkout/",
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([
'amount_usd' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.datacircle.dev/checkout/"
payload := strings.NewReader("{\n \"amount_usd\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.datacircle.dev/checkout/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount_usd\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.datacircle.dev/checkout/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount_usd\": 50\n}"
response = http.request(request)
puts response.read_body{
"checkout_url": "https://checkout.stripe.com/c/pay/cs_live_a1Kq7RzT3vXbN8mLwP2cYdF6hJ0sE4uG9iO5tA1kB3nV7xZ2"
}{
"error": "amount_usd must be a whole number from 5 to 10000"
}{
"error": "stripe refused the checkout session"
}{
"error": "payments are not configured on this server"
}Authorizations
Your API key: Authorization: Bearer <your API key>. Authorization: Token <your API key> works too.
Body
application/json
How much to add to your balance, in whole dollars. Add $50 to your account: you get $50 of API PLUS the flat file (the co-op files in GET /files/).
Required range:
5 <= x <= 10000Example:
50
Response
{"checkout_url": ...}: send the browser there
The Stripe Checkout page for this payment: open it, or hand it to a human to pay. The funds land in funds_usd once Stripe confirms the payment.