Create Plan
curl --request POST \
--url https://api.creptapay.com/v1/plans \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Pro monthly",
"amount": 49,
"description": "<string>",
"currency": "USD",
"interval_count": 1,
"trial_days": 14,
"grace_days": 7,
"collection_mode": "invoice",
"metadata": {}
}
'import requests
url = "https://api.creptapay.com/v1/plans"
payload = {
"name": "Pro monthly",
"amount": 49,
"description": "<string>",
"currency": "USD",
"interval_count": 1,
"trial_days": 14,
"grace_days": 7,
"collection_mode": "invoice",
"metadata": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Pro monthly',
amount: 49,
description: '<string>',
currency: 'USD',
interval_count: 1,
trial_days: 14,
grace_days: 7,
collection_mode: 'invoice',
metadata: {}
})
};
fetch('https://api.creptapay.com/v1/plans', 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.creptapay.com/v1/plans",
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([
'name' => 'Pro monthly',
'amount' => 49,
'description' => '<string>',
'currency' => 'USD',
'interval_count' => 1,
'trial_days' => 14,
'grace_days' => 7,
'collection_mode' => 'invoice',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.creptapay.com/v1/plans"
payload := strings.NewReader("{\n \"name\": \"Pro monthly\",\n \"amount\": 49,\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"interval_count\": 1,\n \"trial_days\": 14,\n \"grace_days\": 7,\n \"collection_mode\": \"invoice\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.creptapay.com/v1/plans")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Pro monthly\",\n \"amount\": 49,\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"interval_count\": 1,\n \"trial_days\": 14,\n \"grace_days\": 7,\n \"collection_mode\": \"invoice\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creptapay.com/v1/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Pro monthly\",\n \"amount\": 49,\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"interval_count\": 1,\n \"trial_days\": 14,\n \"grace_days\": 7,\n \"collection_mode\": \"invoice\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "Successfully created plan",
"data": {
"id": "6712f0a1b9c4e2d3f4a5b6c7",
"name": "Pro monthly",
"description": "Everything in Starter, plus priority support",
"amount": 49,
"currency": "USD",
"interval": "month",
"interval_count": 1,
"cadence": "every month",
"trial_days": 14,
"grace_days": 7,
"allowed_currencies": [
"USDC"
],
"collection_mode": "invoice",
"status": "active",
"metadata": null,
"createdAt": "2026-01-15T09:22:11.000Z",
"updatedAt": "2026-01-15T09:22:11.000Z"
}
}{
"message": "A grace period can't be longer than 30 days",
"data": null
}{
"message": "Invalid API key",
"data": null
}Plans
Create Plan
Create a subscription plan. Requires a secret key.
POST
/
plans
Create Plan
curl --request POST \
--url https://api.creptapay.com/v1/plans \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "Pro monthly",
"amount": 49,
"description": "<string>",
"currency": "USD",
"interval_count": 1,
"trial_days": 14,
"grace_days": 7,
"collection_mode": "invoice",
"metadata": {}
}
'import requests
url = "https://api.creptapay.com/v1/plans"
payload = {
"name": "Pro monthly",
"amount": 49,
"description": "<string>",
"currency": "USD",
"interval_count": 1,
"trial_days": 14,
"grace_days": 7,
"collection_mode": "invoice",
"metadata": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Pro monthly',
amount: 49,
description: '<string>',
currency: 'USD',
interval_count: 1,
trial_days: 14,
grace_days: 7,
collection_mode: 'invoice',
metadata: {}
})
};
fetch('https://api.creptapay.com/v1/plans', 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.creptapay.com/v1/plans",
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([
'name' => 'Pro monthly',
'amount' => 49,
'description' => '<string>',
'currency' => 'USD',
'interval_count' => 1,
'trial_days' => 14,
'grace_days' => 7,
'collection_mode' => 'invoice',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.creptapay.com/v1/plans"
payload := strings.NewReader("{\n \"name\": \"Pro monthly\",\n \"amount\": 49,\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"interval_count\": 1,\n \"trial_days\": 14,\n \"grace_days\": 7,\n \"collection_mode\": \"invoice\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.creptapay.com/v1/plans")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Pro monthly\",\n \"amount\": 49,\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"interval_count\": 1,\n \"trial_days\": 14,\n \"grace_days\": 7,\n \"collection_mode\": \"invoice\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creptapay.com/v1/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Pro monthly\",\n \"amount\": 49,\n \"description\": \"<string>\",\n \"currency\": \"USD\",\n \"interval_count\": 1,\n \"trial_days\": 14,\n \"grace_days\": 7,\n \"collection_mode\": \"invoice\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"message": "Successfully created plan",
"data": {
"id": "6712f0a1b9c4e2d3f4a5b6c7",
"name": "Pro monthly",
"description": "Everything in Starter, plus priority support",
"amount": 49,
"currency": "USD",
"interval": "month",
"interval_count": 1,
"cadence": "every month",
"trial_days": 14,
"grace_days": 7,
"allowed_currencies": [
"USDC"
],
"collection_mode": "invoice",
"status": "active",
"metadata": null,
"createdAt": "2026-01-15T09:22:11.000Z",
"updatedAt": "2026-01-15T09:22:11.000Z"
}
}{
"message": "A grace period can't be longer than 30 days",
"data": null
}{
"message": "Invalid API key",
"data": null
}Create a subscription plan — the price, how often it bills, and how long a late
payer has to catch up.
Request authentication
This endpoint requires a Secret Key (sk_...) passed in either the
x-api-key header or as a Bearer token in the Authorization header.
Request parameters
The fiat currency the plan is priced in. Customers pay the stablecoin
equivalent.
Days after a period ends that a subscriber can still pay before the
subscription expires. Between
0 and 30.invoice sends a pay link each cycle — the only value accepted today.
auto_debit (pull against an approved on-chain allowance) and both are
coming soon and are rejected for now.Body
application/json