Buy a credit pack
curl --request POST \
--url https://sendpaperplane.com/v1/credits/checkout \
--header 'Content-Type: application/json' \
--data '
{
"pack": "value",
"email": "jordan@example.com"
}
'import requests
url = "https://sendpaperplane.com/v1/credits/checkout"
payload = {
"pack": "value",
"email": "jordan@example.com"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({pack: 'value', email: 'jordan@example.com'})
};
fetch('https://sendpaperplane.com/v1/credits/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({pack: 'value', email: 'jordan@example.com'})
};
fetch('https://sendpaperplane.com/v1/credits/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sendpaperplane.com/v1/credits/checkout"
payload := strings.NewReader("{\n \"pack\": \"value\",\n \"email\": \"jordan@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://sendpaperplane.com/v1/credits/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"pack\": \"value\",\n \"email\": \"jordan@example.com\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sendpaperplane.com/v1/credits/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([
'pack' => 'value',
'email' => 'jordan@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://sendpaperplane.com/v1/credits/checkout")
.header("Content-Type", "application/json")
.body("{\n \"pack\": \"value\",\n \"email\": \"jordan@example.com\"\n}")
.asString();{
"status": "ok",
"checkout_ui_mode": "hosted",
"payment_url": "https://checkout.stripe.com/c/pay/cs_test_a1b2c3"
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}Buy a credit pack
Returns a Stripe-hosted checkout URL (default) or, with checkout_ui_mode: "embedded", a Stripe Embedded Checkout payment_client_secret to mount in place. The credit code is emailed once payment settles either way.
POST
/
v1
/
credits
/
checkout
Buy a credit pack
curl --request POST \
--url https://sendpaperplane.com/v1/credits/checkout \
--header 'Content-Type: application/json' \
--data '
{
"pack": "value",
"email": "jordan@example.com"
}
'import requests
url = "https://sendpaperplane.com/v1/credits/checkout"
payload = {
"pack": "value",
"email": "jordan@example.com"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({pack: 'value', email: 'jordan@example.com'})
};
fetch('https://sendpaperplane.com/v1/credits/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({pack: 'value', email: 'jordan@example.com'})
};
fetch('https://sendpaperplane.com/v1/credits/checkout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sendpaperplane.com/v1/credits/checkout"
payload := strings.NewReader("{\n \"pack\": \"value\",\n \"email\": \"jordan@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://sendpaperplane.com/v1/credits/checkout")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"pack\": \"value\",\n \"email\": \"jordan@example.com\"\n}"
response = http.request(request)
puts response.read_body<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sendpaperplane.com/v1/credits/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([
'pack' => 'value',
'email' => 'jordan@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://sendpaperplane.com/v1/credits/checkout")
.header("Content-Type", "application/json")
.body("{\n \"pack\": \"value\",\n \"email\": \"jordan@example.com\"\n}")
.asString();{
"status": "ok",
"checkout_ui_mode": "hosted",
"payment_url": "https://checkout.stripe.com/c/pay/cs_test_a1b2c3"
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}{
"status": "failed",
"code": "<string>",
"reason": "<string>",
"next": [
"<string>"
]
}Body
application/json
Response
Checkout link (checkout_ui_mode: "hosted", the default) or a Stripe Embedded Checkout payment_client_secret (checkout_ui_mode: "embedded") — a discriminated union keyed on checkout_ui_mode, never both.
Last modified on September 17, 2026
Was this page helpful?