Get Subscription
curl --request GET \
--url https://api.creptapay.com/v1/subscriptions/{subscriptionId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.creptapay.com/v1/subscriptions/{subscriptionId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.creptapay.com/v1/subscriptions/{subscriptionId}', 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/subscriptions/{subscriptionId}",
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-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"
"net/http"
"io"
)
func main() {
url := "https://api.creptapay.com/v1/subscriptions/{subscriptionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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://api.creptapay.com/v1/subscriptions/{subscriptionId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creptapay.com/v1/subscriptions/{subscriptionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Successfully fetched subscription",
"data": {
"id": "6713a2b4c8d5e3f2a1b9c4e2",
"reference": "SUB-K3F9A2QP",
"status": "active",
"collection_mode": "invoice",
"checkout_url": "https://pay.creptapay.com/SUB-K3F9A2QP",
"amount_due": {
"amount": 49,
"currency": "USD"
},
"terms": {
"amount": 49,
"currency": "USD",
"interval": "month",
"interval_count": 1,
"grace_days": 7,
"allowed_currencies": [
"USDC"
],
"captured_at": "2026-01-15T09:22:11.000Z"
},
"on_legacy_terms": false,
"plan": {
"id": "6712f0a1b9c4e2d3f4a5b6c7",
"name": "Pro monthly",
"amount": 49,
"currency": "USD",
"interval": "month",
"interval_count": 1,
"grace_days": 7
},
"customer": {
"id": "60d0fe4f5311236168a109c9",
"name": "Chidera Okonkwo",
"email": "chidera@example.com"
},
"current_period_start": "2026-02-15T09:22:11.000Z",
"current_period_end": "2026-03-15T09:22:11.000Z",
"next_billing_at": "2026-03-15T09:22:11.000Z",
"grace_ends_at": "2026-03-22T09:22:11.000Z",
"trial_ends_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"cancel_reason": null,
"latest_payment": {
"id": "60d0fe4f5311236168a109cb",
"reference": "CP-B2C3D4E5F6",
"status": "paid",
"amount": 49,
"currency": "USD",
"crypto_currency": "USDC",
"network": "BASE",
"tx_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"billing_period_start": "2026-02-15T09:22:11.000Z",
"billing_period_end": "2026-03-15T09:22:11.000Z",
"createdAt": "2026-02-15T09:20:02.000Z"
},
"payments_count": 2,
"failed_attempts": 0,
"last_failure_reason": null,
"metadata": null,
"createdAt": "2026-01-15T09:22:11.000Z",
"updatedAt": "2026-02-15T09:22:14.000Z"
}
}{
"message": "A grace period can't be longer than 30 days",
"data": null
}{
"message": "Invalid API key",
"data": null
}{
"message": "Plan not found",
"data": null
}Subscriptions
Get Subscription
GET
/
subscriptions
/
{subscriptionId}
Get Subscription
curl --request GET \
--url https://api.creptapay.com/v1/subscriptions/{subscriptionId} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.creptapay.com/v1/subscriptions/{subscriptionId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.creptapay.com/v1/subscriptions/{subscriptionId}', 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/subscriptions/{subscriptionId}",
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-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"
"net/http"
"io"
)
func main() {
url := "https://api.creptapay.com/v1/subscriptions/{subscriptionId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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://api.creptapay.com/v1/subscriptions/{subscriptionId}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creptapay.com/v1/subscriptions/{subscriptionId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "Successfully fetched subscription",
"data": {
"id": "6713a2b4c8d5e3f2a1b9c4e2",
"reference": "SUB-K3F9A2QP",
"status": "active",
"collection_mode": "invoice",
"checkout_url": "https://pay.creptapay.com/SUB-K3F9A2QP",
"amount_due": {
"amount": 49,
"currency": "USD"
},
"terms": {
"amount": 49,
"currency": "USD",
"interval": "month",
"interval_count": 1,
"grace_days": 7,
"allowed_currencies": [
"USDC"
],
"captured_at": "2026-01-15T09:22:11.000Z"
},
"on_legacy_terms": false,
"plan": {
"id": "6712f0a1b9c4e2d3f4a5b6c7",
"name": "Pro monthly",
"amount": 49,
"currency": "USD",
"interval": "month",
"interval_count": 1,
"grace_days": 7
},
"customer": {
"id": "60d0fe4f5311236168a109c9",
"name": "Chidera Okonkwo",
"email": "chidera@example.com"
},
"current_period_start": "2026-02-15T09:22:11.000Z",
"current_period_end": "2026-03-15T09:22:11.000Z",
"next_billing_at": "2026-03-15T09:22:11.000Z",
"grace_ends_at": "2026-03-22T09:22:11.000Z",
"trial_ends_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"cancel_reason": null,
"latest_payment": {
"id": "60d0fe4f5311236168a109cb",
"reference": "CP-B2C3D4E5F6",
"status": "paid",
"amount": 49,
"currency": "USD",
"crypto_currency": "USDC",
"network": "BASE",
"tx_hash": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890",
"billing_period_start": "2026-02-15T09:22:11.000Z",
"billing_period_end": "2026-03-15T09:22:11.000Z",
"createdAt": "2026-02-15T09:20:02.000Z"
},
"payments_count": 2,
"failed_attempts": 0,
"last_failure_reason": null,
"metadata": null,
"createdAt": "2026-01-15T09:22:11.000Z",
"updatedAt": "2026-02-15T09:22:14.000Z"
}
}{
"message": "A grace period can't be longer than 30 days",
"data": null
}{
"message": "Invalid API key",
"data": null
}{
"message": "Plan not found",
"data": null
}