Retrieve a checkout session.
curl --request GET \
--url https://api.creem.io/v1/checkouts \
--header 'x-api-key: <api-key>'import requests
url = "https://api.creem.io/v1/checkouts"
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.creem.io/v1/checkouts', 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.creem.io/v1/checkouts",
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.creem.io/v1/checkouts"
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.creem.io/v1/checkouts")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creem.io/v1/checkouts")
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{
"id": "<string>",
"mode": "test",
"object": "<string>",
"status": "completed",
"product": "<string>",
"request_id": "<string>",
"units": 1,
"custom_price": 1500,
"trial_period_days": 92,
"order": {
"id": "<string>",
"mode": "test",
"object": "<string>",
"product": "<string>",
"amount": 2000,
"currency": "USD",
"status": "pending",
"type": "recurring",
"created_at": "2023-09-13T00:00:00Z",
"updated_at": "2023-09-13T00:00:00Z",
"customer": "<string>",
"transaction": "tx_1234567890",
"discount": "dis_1234567890",
"sub_total": 1800,
"tax_amount": 200,
"discount_amount": 100,
"amount_due": 1900,
"amount_paid": 1900,
"fx_amount": 128195,
"fx_currency": "SEK",
"fx_rate": 10.42,
"affiliate": "<string>",
"recovered": false
},
"subscription": "<string>",
"customer": "<string>",
"custom_fields": [
{
"type": "text",
"key": "<string>",
"label": "<string>",
"optional": true,
"text": {
"max_length": 123,
"minimum_length": 123,
"value": "<string>"
},
"checkbox": {
"label": "<string>",
"value": true
}
}
],
"checkout_url": "<string>",
"success_url": "https://example.com/return",
"license_keys": [
{
"id": "<string>",
"mode": "test",
"object": "<string>",
"product_id": "prod_abc123",
"status": "active",
"key": "ABC123-XYZ456-XYZ456-XYZ456",
"activation": 5,
"created_at": "2023-09-13T00:00:00Z",
"activation_limit": 1,
"expires_at": "2023-09-13T00:00:00Z",
"instance": {
"id": "<string>",
"mode": "test",
"object": "license-instance",
"name": "My Customer License Instance",
"status": "active",
"created_at": "2023-09-13T00:00:00Z"
}
}
],
"feature": {
"id": "feat_abc123",
"description": "Get access to the full course materials.",
"type": "licenseKey",
"private_note": "Thank you for your purchase! Here is your access code: XYZ123",
"file": {
"files": [
{
"id": "file_abc123",
"file_name": "ebook.pdf",
"url": "https://storage.creem.io/files/ebook.pdf",
"type": "application/pdf",
"size": 1024000
}
]
},
"license_key": {
"id": "<string>",
"mode": "test",
"object": "<string>",
"product_id": "prod_abc123",
"status": "active",
"key": "ABC123-XYZ456-XYZ456-XYZ456",
"activation": 5,
"created_at": "2023-09-13T00:00:00Z",
"activation_limit": 1,
"expires_at": "2023-09-13T00:00:00Z",
"instance": {
"id": "<string>",
"mode": "test",
"object": "license-instance",
"name": "My Customer License Instance",
"status": "active",
"created_at": "2023-09-13T00:00:00Z"
}
},
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images",
"requires_moderation": false,
"resets_each_period": false
},
"license": {
"id": "<string>",
"mode": "test",
"object": "<string>",
"product_id": "prod_abc123",
"status": "active",
"key": "ABC123-XYZ456-XYZ456-XYZ456",
"activation": 5,
"created_at": "2023-09-13T00:00:00Z",
"activation_limit": 1,
"expires_at": "2023-09-13T00:00:00Z",
"instance": {
"id": "<string>",
"mode": "test",
"object": "license-instance",
"name": "My Customer License Instance",
"status": "active",
"created_at": "2023-09-13T00:00:00Z"
}
}
},
"metadata": {
"userId": "user_123",
"visitCount": 42,
"lastVisit": "2023-04-01"
},
"discount": {
"id": "dis_3e6Z6TzvHKdsjEgXnGDEp0",
"discountCode": "HOLIDAY2024",
"name": "<string>",
"type": "percentage",
"amount": 123,
"duration": "forever",
"durationInMonths": 123
}
}Checkout
Retrieve a checkout session
Retrieve details of a checkout session by ID. View status, customer info, and payment details.
GET
/
v1
/
checkouts
Retrieve a checkout session.
curl --request GET \
--url https://api.creem.io/v1/checkouts \
--header 'x-api-key: <api-key>'import requests
url = "https://api.creem.io/v1/checkouts"
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.creem.io/v1/checkouts', 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.creem.io/v1/checkouts",
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.creem.io/v1/checkouts"
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.creem.io/v1/checkouts")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creem.io/v1/checkouts")
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{
"id": "<string>",
"mode": "test",
"object": "<string>",
"status": "completed",
"product": "<string>",
"request_id": "<string>",
"units": 1,
"custom_price": 1500,
"trial_period_days": 92,
"order": {
"id": "<string>",
"mode": "test",
"object": "<string>",
"product": "<string>",
"amount": 2000,
"currency": "USD",
"status": "pending",
"type": "recurring",
"created_at": "2023-09-13T00:00:00Z",
"updated_at": "2023-09-13T00:00:00Z",
"customer": "<string>",
"transaction": "tx_1234567890",
"discount": "dis_1234567890",
"sub_total": 1800,
"tax_amount": 200,
"discount_amount": 100,
"amount_due": 1900,
"amount_paid": 1900,
"fx_amount": 128195,
"fx_currency": "SEK",
"fx_rate": 10.42,
"affiliate": "<string>",
"recovered": false
},
"subscription": "<string>",
"customer": "<string>",
"custom_fields": [
{
"type": "text",
"key": "<string>",
"label": "<string>",
"optional": true,
"text": {
"max_length": 123,
"minimum_length": 123,
"value": "<string>"
},
"checkbox": {
"label": "<string>",
"value": true
}
}
],
"checkout_url": "<string>",
"success_url": "https://example.com/return",
"license_keys": [
{
"id": "<string>",
"mode": "test",
"object": "<string>",
"product_id": "prod_abc123",
"status": "active",
"key": "ABC123-XYZ456-XYZ456-XYZ456",
"activation": 5,
"created_at": "2023-09-13T00:00:00Z",
"activation_limit": 1,
"expires_at": "2023-09-13T00:00:00Z",
"instance": {
"id": "<string>",
"mode": "test",
"object": "license-instance",
"name": "My Customer License Instance",
"status": "active",
"created_at": "2023-09-13T00:00:00Z"
}
}
],
"feature": {
"id": "feat_abc123",
"description": "Get access to the full course materials.",
"type": "licenseKey",
"private_note": "Thank you for your purchase! Here is your access code: XYZ123",
"file": {
"files": [
{
"id": "file_abc123",
"file_name": "ebook.pdf",
"url": "https://storage.creem.io/files/ebook.pdf",
"type": "application/pdf",
"size": 1024000
}
]
},
"license_key": {
"id": "<string>",
"mode": "test",
"object": "<string>",
"product_id": "prod_abc123",
"status": "active",
"key": "ABC123-XYZ456-XYZ456-XYZ456",
"activation": 5,
"created_at": "2023-09-13T00:00:00Z",
"activation_limit": 1,
"expires_at": "2023-09-13T00:00:00Z",
"instance": {
"id": "<string>",
"mode": "test",
"object": "license-instance",
"name": "My Customer License Instance",
"status": "active",
"created_at": "2023-09-13T00:00:00Z"
}
},
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images",
"requires_moderation": false,
"resets_each_period": false
},
"license": {
"id": "<string>",
"mode": "test",
"object": "<string>",
"product_id": "prod_abc123",
"status": "active",
"key": "ABC123-XYZ456-XYZ456-XYZ456",
"activation": 5,
"created_at": "2023-09-13T00:00:00Z",
"activation_limit": 1,
"expires_at": "2023-09-13T00:00:00Z",
"instance": {
"id": "<string>",
"mode": "test",
"object": "license-instance",
"name": "My Customer License Instance",
"status": "active",
"created_at": "2023-09-13T00:00:00Z"
}
}
},
"metadata": {
"userId": "user_123",
"visitCount": 42,
"lastVisit": "2023-04-01"
},
"discount": {
"id": "dis_3e6Z6TzvHKdsjEgXnGDEp0",
"discountCode": "HOLIDAY2024",
"name": "<string>",
"type": "percentage",
"amount": 123,
"duration": "forever",
"durationInMonths": 123
}
}Authorizations
Query Parameters
Response
Successfully retrieved the checkout session