curl --request POST \
--url https://api.creem.io/v1/products \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"price": 400,
"currency": "USD",
"billing_type": "recurring",
"image_url": "https://picsum.photos/200/300",
"image_urls": [
"https://picsum.photos/200/300",
"https://picsum.photos/200/301"
],
"billing_period": "every-month",
"recurring_interval": "week",
"recurring_interval_count": 1,
"tax_mode": "inclusive",
"business_net_pricing": false,
"tax_category": "saas",
"pay_what_you_want": false,
"suggested_price": 1500,
"trial_period_days": 7,
"trial_price": 100,
"default_success_url": "https://example.com/?status=successful",
"custom_fields": [
{
"type": "text",
"key": "companyName",
"label": "Company Name",
"optional": true,
"text": {
"max_length": 200,
"min_length": 1
},
"checkbox": {
"label": "I agree to the [terms and conditions](https://example.com/terms)"
}
}
],
"custom_field": [
{
"type": "text",
"key": "companyName",
"label": "Company Name",
"optional": true,
"text": {
"max_length": 200,
"min_length": 1
},
"checkbox": {
"label": "I agree to the [terms and conditions](https://example.com/terms)"
}
}
],
"abandoned_cart_recovery_enabled": false,
"usage_prices": [
{
"meter_id": "mtr_abc123",
"unit_price": 0.002,
"settlement_mode": "prepaid",
"id": "price_abc123",
"free_allowance": 1000,
"cap": 50000,
"target_account": "per_unit",
"target_account_name": "images",
"trial_usage_mode": "free"
}
],
"features": [
{
"type": "customerCredits",
"description": "500 image credits",
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images"
},
"id": "feat_abc123"
}
]
}
'import requests
url = "https://api.creem.io/v1/products"
payload = {
"name": "<string>",
"description": "<string>",
"price": 400,
"currency": "USD",
"billing_type": "recurring",
"image_url": "https://picsum.photos/200/300",
"image_urls": ["https://picsum.photos/200/300", "https://picsum.photos/200/301"],
"billing_period": "every-month",
"recurring_interval": "week",
"recurring_interval_count": 1,
"tax_mode": "inclusive",
"business_net_pricing": False,
"tax_category": "saas",
"pay_what_you_want": False,
"suggested_price": 1500,
"trial_period_days": 7,
"trial_price": 100,
"default_success_url": "https://example.com/?status=successful",
"custom_fields": [
{
"type": "text",
"key": "companyName",
"label": "Company Name",
"optional": True,
"text": {
"max_length": 200,
"min_length": 1
},
"checkbox": { "label": "I agree to the [terms and conditions](https://example.com/terms)" }
}
],
"custom_field": [
{
"type": "text",
"key": "companyName",
"label": "Company Name",
"optional": True,
"text": {
"max_length": 200,
"min_length": 1
},
"checkbox": { "label": "I agree to the [terms and conditions](https://example.com/terms)" }
}
],
"abandoned_cart_recovery_enabled": False,
"usage_prices": [
{
"meter_id": "mtr_abc123",
"unit_price": 0.002,
"settlement_mode": "prepaid",
"id": "price_abc123",
"free_allowance": 1000,
"cap": 50000,
"target_account": "per_unit",
"target_account_name": "images",
"trial_usage_mode": "free"
}
],
"features": [
{
"type": "customerCredits",
"description": "500 image credits",
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images"
},
"id": "feat_abc123"
}
]
}
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: '<string>',
description: '<string>',
price: 400,
currency: 'USD',
billing_type: 'recurring',
image_url: 'https://picsum.photos/200/300',
image_urls: ['https://picsum.photos/200/300', 'https://picsum.photos/200/301'],
billing_period: 'every-month',
recurring_interval: 'week',
recurring_interval_count: 1,
tax_mode: 'inclusive',
business_net_pricing: false,
tax_category: 'saas',
pay_what_you_want: false,
suggested_price: 1500,
trial_period_days: 7,
trial_price: 100,
default_success_url: 'https://example.com/?status=successful',
custom_fields: [
{
type: 'text',
key: 'companyName',
label: 'Company Name',
optional: true,
text: {max_length: 200, min_length: 1},
checkbox: {label: 'I agree to the [terms and conditions](https://example.com/terms)'}
}
],
custom_field: [
{
type: 'text',
key: 'companyName',
label: 'Company Name',
optional: true,
text: {max_length: 200, min_length: 1},
checkbox: {label: 'I agree to the [terms and conditions](https://example.com/terms)'}
}
],
abandoned_cart_recovery_enabled: false,
usage_prices: [
{
meter_id: 'mtr_abc123',
unit_price: 0.002,
settlement_mode: 'prepaid',
id: 'price_abc123',
free_allowance: 1000,
cap: 50000,
target_account: 'per_unit',
target_account_name: 'images',
trial_usage_mode: 'free'
}
],
features: [
{
type: 'customerCredits',
description: '500 image credits',
customer_credits: {amount: '100', unit_label: 'tokens', bucket_name: 'images'},
id: 'feat_abc123'
}
]
})
};
fetch('https://api.creem.io/v1/products', 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/products",
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' => '<string>',
'description' => '<string>',
'price' => 400,
'currency' => 'USD',
'billing_type' => 'recurring',
'image_url' => 'https://picsum.photos/200/300',
'image_urls' => [
'https://picsum.photos/200/300',
'https://picsum.photos/200/301'
],
'billing_period' => 'every-month',
'recurring_interval' => 'week',
'recurring_interval_count' => 1,
'tax_mode' => 'inclusive',
'business_net_pricing' => false,
'tax_category' => 'saas',
'pay_what_you_want' => false,
'suggested_price' => 1500,
'trial_period_days' => 7,
'trial_price' => 100,
'default_success_url' => 'https://example.com/?status=successful',
'custom_fields' => [
[
'type' => 'text',
'key' => 'companyName',
'label' => 'Company Name',
'optional' => true,
'text' => [
'max_length' => 200,
'min_length' => 1
],
'checkbox' => [
'label' => 'I agree to the [terms and conditions](https://example.com/terms)'
]
]
],
'custom_field' => [
[
'type' => 'text',
'key' => 'companyName',
'label' => 'Company Name',
'optional' => true,
'text' => [
'max_length' => 200,
'min_length' => 1
],
'checkbox' => [
'label' => 'I agree to the [terms and conditions](https://example.com/terms)'
]
]
],
'abandoned_cart_recovery_enabled' => false,
'usage_prices' => [
[
'meter_id' => 'mtr_abc123',
'unit_price' => 0.002,
'settlement_mode' => 'prepaid',
'id' => 'price_abc123',
'free_allowance' => 1000,
'cap' => 50000,
'target_account' => 'per_unit',
'target_account_name' => 'images',
'trial_usage_mode' => 'free'
]
],
'features' => [
[
'type' => 'customerCredits',
'description' => '500 image credits',
'customer_credits' => [
'amount' => '100',
'unit_label' => 'tokens',
'bucket_name' => 'images'
],
'id' => 'feat_abc123'
]
]
]),
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.creem.io/v1/products"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 400,\n \"currency\": \"USD\",\n \"billing_type\": \"recurring\",\n \"image_url\": \"https://picsum.photos/200/300\",\n \"image_urls\": [\n \"https://picsum.photos/200/300\",\n \"https://picsum.photos/200/301\"\n ],\n \"billing_period\": \"every-month\",\n \"recurring_interval\": \"week\",\n \"recurring_interval_count\": 1,\n \"tax_mode\": \"inclusive\",\n \"business_net_pricing\": false,\n \"tax_category\": \"saas\",\n \"pay_what_you_want\": false,\n \"suggested_price\": 1500,\n \"trial_period_days\": 7,\n \"trial_price\": 100,\n \"default_success_url\": \"https://example.com/?status=successful\",\n \"custom_fields\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"custom_field\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"abandoned_cart_recovery_enabled\": false,\n \"usage_prices\": [\n {\n \"meter_id\": \"mtr_abc123\",\n \"unit_price\": 0.002,\n \"settlement_mode\": \"prepaid\",\n \"id\": \"price_abc123\",\n \"free_allowance\": 1000,\n \"cap\": 50000,\n \"target_account\": \"per_unit\",\n \"target_account_name\": \"images\",\n \"trial_usage_mode\": \"free\"\n }\n ],\n \"features\": [\n {\n \"type\": \"customerCredits\",\n \"description\": \"500 image credits\",\n \"customer_credits\": {\n \"amount\": \"100\",\n \"unit_label\": \"tokens\",\n \"bucket_name\": \"images\"\n },\n \"id\": \"feat_abc123\"\n }\n ]\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.creem.io/v1/products")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 400,\n \"currency\": \"USD\",\n \"billing_type\": \"recurring\",\n \"image_url\": \"https://picsum.photos/200/300\",\n \"image_urls\": [\n \"https://picsum.photos/200/300\",\n \"https://picsum.photos/200/301\"\n ],\n \"billing_period\": \"every-month\",\n \"recurring_interval\": \"week\",\n \"recurring_interval_count\": 1,\n \"tax_mode\": \"inclusive\",\n \"business_net_pricing\": false,\n \"tax_category\": \"saas\",\n \"pay_what_you_want\": false,\n \"suggested_price\": 1500,\n \"trial_period_days\": 7,\n \"trial_price\": 100,\n \"default_success_url\": \"https://example.com/?status=successful\",\n \"custom_fields\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"custom_field\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"abandoned_cart_recovery_enabled\": false,\n \"usage_prices\": [\n {\n \"meter_id\": \"mtr_abc123\",\n \"unit_price\": 0.002,\n \"settlement_mode\": \"prepaid\",\n \"id\": \"price_abc123\",\n \"free_allowance\": 1000,\n \"cap\": 50000,\n \"target_account\": \"per_unit\",\n \"target_account_name\": \"images\",\n \"trial_usage_mode\": \"free\"\n }\n ],\n \"features\": [\n {\n \"type\": \"customerCredits\",\n \"description\": \"500 image credits\",\n \"customer_credits\": {\n \"amount\": \"100\",\n \"unit_label\": \"tokens\",\n \"bucket_name\": \"images\"\n },\n \"id\": \"feat_abc123\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creem.io/v1/products")
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\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 400,\n \"currency\": \"USD\",\n \"billing_type\": \"recurring\",\n \"image_url\": \"https://picsum.photos/200/300\",\n \"image_urls\": [\n \"https://picsum.photos/200/300\",\n \"https://picsum.photos/200/301\"\n ],\n \"billing_period\": \"every-month\",\n \"recurring_interval\": \"week\",\n \"recurring_interval_count\": 1,\n \"tax_mode\": \"inclusive\",\n \"business_net_pricing\": false,\n \"tax_category\": \"saas\",\n \"pay_what_you_want\": false,\n \"suggested_price\": 1500,\n \"trial_period_days\": 7,\n \"trial_price\": 100,\n \"default_success_url\": \"https://example.com/?status=successful\",\n \"custom_fields\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"custom_field\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"abandoned_cart_recovery_enabled\": false,\n \"usage_prices\": [\n {\n \"meter_id\": \"mtr_abc123\",\n \"unit_price\": 0.002,\n \"settlement_mode\": \"prepaid\",\n \"id\": \"price_abc123\",\n \"free_allowance\": 1000,\n \"cap\": 50000,\n \"target_account\": \"per_unit\",\n \"target_account_name\": \"images\",\n \"trial_usage_mode\": \"free\"\n }\n ],\n \"features\": [\n {\n \"type\": \"customerCredits\",\n \"description\": \"500 image credits\",\n \"customer_credits\": {\n \"amount\": \"100\",\n \"unit_label\": \"tokens\",\n \"bucket_name\": \"images\"\n },\n \"id\": \"feat_abc123\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"mode": "test",
"object": "<string>",
"name": "<string>",
"description": "This is a sample product description.",
"price": 400,
"currency": "USD",
"billing_type": "recurring",
"billing_period": "every-month",
"status": "active",
"tax_mode": "inclusive",
"tax_category": "saas",
"created_at": "2023-01-01T00:00:00Z",
"updated_at": "2023-01-01T00:00:00Z",
"image_url": "https://example.com/image.jpg",
"image_urls": [
"https://example.com/image.jpg"
],
"features": [
{
"id": "feat_abc123",
"type": "licenseKey",
"description": "Access to premium course materials.",
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images"
}
}
],
"usage_prices": [
{
"id": "price_abc123",
"meter_id": "mtr_abc123",
"unit_price": 0.002,
"free_allowance": 1000,
"settlement_mode": "prepaid",
"target_account": "per_unit",
"trial_usage_mode": "free",
"cap": 50000,
"target_account_name": "images"
}
],
"recurring_interval": "month",
"recurring_interval_count": 3,
"trial_period_days": 7,
"trial_price": 100,
"business_net_pricing": false,
"product_url": "https://creem.io/product/prod_123123123123",
"default_success_url": "https://example.com/?status=successful",
"custom_fields": [
{
"type": "text",
"key": "<string>",
"label": "<string>",
"optional": true,
"text": {
"max_length": 123,
"minimum_length": 123,
"value": "<string>"
},
"checkbox": {
"label": "<string>",
"value": true
}
}
]
}Creates a new product
Create a new product for one-time payments, including free products with a 0 price, or subscriptions. Configure pricing, billing cycles, and features.
curl --request POST \
--url https://api.creem.io/v1/products \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"price": 400,
"currency": "USD",
"billing_type": "recurring",
"image_url": "https://picsum.photos/200/300",
"image_urls": [
"https://picsum.photos/200/300",
"https://picsum.photos/200/301"
],
"billing_period": "every-month",
"recurring_interval": "week",
"recurring_interval_count": 1,
"tax_mode": "inclusive",
"business_net_pricing": false,
"tax_category": "saas",
"pay_what_you_want": false,
"suggested_price": 1500,
"trial_period_days": 7,
"trial_price": 100,
"default_success_url": "https://example.com/?status=successful",
"custom_fields": [
{
"type": "text",
"key": "companyName",
"label": "Company Name",
"optional": true,
"text": {
"max_length": 200,
"min_length": 1
},
"checkbox": {
"label": "I agree to the [terms and conditions](https://example.com/terms)"
}
}
],
"custom_field": [
{
"type": "text",
"key": "companyName",
"label": "Company Name",
"optional": true,
"text": {
"max_length": 200,
"min_length": 1
},
"checkbox": {
"label": "I agree to the [terms and conditions](https://example.com/terms)"
}
}
],
"abandoned_cart_recovery_enabled": false,
"usage_prices": [
{
"meter_id": "mtr_abc123",
"unit_price": 0.002,
"settlement_mode": "prepaid",
"id": "price_abc123",
"free_allowance": 1000,
"cap": 50000,
"target_account": "per_unit",
"target_account_name": "images",
"trial_usage_mode": "free"
}
],
"features": [
{
"type": "customerCredits",
"description": "500 image credits",
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images"
},
"id": "feat_abc123"
}
]
}
'import requests
url = "https://api.creem.io/v1/products"
payload = {
"name": "<string>",
"description": "<string>",
"price": 400,
"currency": "USD",
"billing_type": "recurring",
"image_url": "https://picsum.photos/200/300",
"image_urls": ["https://picsum.photos/200/300", "https://picsum.photos/200/301"],
"billing_period": "every-month",
"recurring_interval": "week",
"recurring_interval_count": 1,
"tax_mode": "inclusive",
"business_net_pricing": False,
"tax_category": "saas",
"pay_what_you_want": False,
"suggested_price": 1500,
"trial_period_days": 7,
"trial_price": 100,
"default_success_url": "https://example.com/?status=successful",
"custom_fields": [
{
"type": "text",
"key": "companyName",
"label": "Company Name",
"optional": True,
"text": {
"max_length": 200,
"min_length": 1
},
"checkbox": { "label": "I agree to the [terms and conditions](https://example.com/terms)" }
}
],
"custom_field": [
{
"type": "text",
"key": "companyName",
"label": "Company Name",
"optional": True,
"text": {
"max_length": 200,
"min_length": 1
},
"checkbox": { "label": "I agree to the [terms and conditions](https://example.com/terms)" }
}
],
"abandoned_cart_recovery_enabled": False,
"usage_prices": [
{
"meter_id": "mtr_abc123",
"unit_price": 0.002,
"settlement_mode": "prepaid",
"id": "price_abc123",
"free_allowance": 1000,
"cap": 50000,
"target_account": "per_unit",
"target_account_name": "images",
"trial_usage_mode": "free"
}
],
"features": [
{
"type": "customerCredits",
"description": "500 image credits",
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images"
},
"id": "feat_abc123"
}
]
}
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: '<string>',
description: '<string>',
price: 400,
currency: 'USD',
billing_type: 'recurring',
image_url: 'https://picsum.photos/200/300',
image_urls: ['https://picsum.photos/200/300', 'https://picsum.photos/200/301'],
billing_period: 'every-month',
recurring_interval: 'week',
recurring_interval_count: 1,
tax_mode: 'inclusive',
business_net_pricing: false,
tax_category: 'saas',
pay_what_you_want: false,
suggested_price: 1500,
trial_period_days: 7,
trial_price: 100,
default_success_url: 'https://example.com/?status=successful',
custom_fields: [
{
type: 'text',
key: 'companyName',
label: 'Company Name',
optional: true,
text: {max_length: 200, min_length: 1},
checkbox: {label: 'I agree to the [terms and conditions](https://example.com/terms)'}
}
],
custom_field: [
{
type: 'text',
key: 'companyName',
label: 'Company Name',
optional: true,
text: {max_length: 200, min_length: 1},
checkbox: {label: 'I agree to the [terms and conditions](https://example.com/terms)'}
}
],
abandoned_cart_recovery_enabled: false,
usage_prices: [
{
meter_id: 'mtr_abc123',
unit_price: 0.002,
settlement_mode: 'prepaid',
id: 'price_abc123',
free_allowance: 1000,
cap: 50000,
target_account: 'per_unit',
target_account_name: 'images',
trial_usage_mode: 'free'
}
],
features: [
{
type: 'customerCredits',
description: '500 image credits',
customer_credits: {amount: '100', unit_label: 'tokens', bucket_name: 'images'},
id: 'feat_abc123'
}
]
})
};
fetch('https://api.creem.io/v1/products', 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/products",
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' => '<string>',
'description' => '<string>',
'price' => 400,
'currency' => 'USD',
'billing_type' => 'recurring',
'image_url' => 'https://picsum.photos/200/300',
'image_urls' => [
'https://picsum.photos/200/300',
'https://picsum.photos/200/301'
],
'billing_period' => 'every-month',
'recurring_interval' => 'week',
'recurring_interval_count' => 1,
'tax_mode' => 'inclusive',
'business_net_pricing' => false,
'tax_category' => 'saas',
'pay_what_you_want' => false,
'suggested_price' => 1500,
'trial_period_days' => 7,
'trial_price' => 100,
'default_success_url' => 'https://example.com/?status=successful',
'custom_fields' => [
[
'type' => 'text',
'key' => 'companyName',
'label' => 'Company Name',
'optional' => true,
'text' => [
'max_length' => 200,
'min_length' => 1
],
'checkbox' => [
'label' => 'I agree to the [terms and conditions](https://example.com/terms)'
]
]
],
'custom_field' => [
[
'type' => 'text',
'key' => 'companyName',
'label' => 'Company Name',
'optional' => true,
'text' => [
'max_length' => 200,
'min_length' => 1
],
'checkbox' => [
'label' => 'I agree to the [terms and conditions](https://example.com/terms)'
]
]
],
'abandoned_cart_recovery_enabled' => false,
'usage_prices' => [
[
'meter_id' => 'mtr_abc123',
'unit_price' => 0.002,
'settlement_mode' => 'prepaid',
'id' => 'price_abc123',
'free_allowance' => 1000,
'cap' => 50000,
'target_account' => 'per_unit',
'target_account_name' => 'images',
'trial_usage_mode' => 'free'
]
],
'features' => [
[
'type' => 'customerCredits',
'description' => '500 image credits',
'customer_credits' => [
'amount' => '100',
'unit_label' => 'tokens',
'bucket_name' => 'images'
],
'id' => 'feat_abc123'
]
]
]),
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.creem.io/v1/products"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 400,\n \"currency\": \"USD\",\n \"billing_type\": \"recurring\",\n \"image_url\": \"https://picsum.photos/200/300\",\n \"image_urls\": [\n \"https://picsum.photos/200/300\",\n \"https://picsum.photos/200/301\"\n ],\n \"billing_period\": \"every-month\",\n \"recurring_interval\": \"week\",\n \"recurring_interval_count\": 1,\n \"tax_mode\": \"inclusive\",\n \"business_net_pricing\": false,\n \"tax_category\": \"saas\",\n \"pay_what_you_want\": false,\n \"suggested_price\": 1500,\n \"trial_period_days\": 7,\n \"trial_price\": 100,\n \"default_success_url\": \"https://example.com/?status=successful\",\n \"custom_fields\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"custom_field\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"abandoned_cart_recovery_enabled\": false,\n \"usage_prices\": [\n {\n \"meter_id\": \"mtr_abc123\",\n \"unit_price\": 0.002,\n \"settlement_mode\": \"prepaid\",\n \"id\": \"price_abc123\",\n \"free_allowance\": 1000,\n \"cap\": 50000,\n \"target_account\": \"per_unit\",\n \"target_account_name\": \"images\",\n \"trial_usage_mode\": \"free\"\n }\n ],\n \"features\": [\n {\n \"type\": \"customerCredits\",\n \"description\": \"500 image credits\",\n \"customer_credits\": {\n \"amount\": \"100\",\n \"unit_label\": \"tokens\",\n \"bucket_name\": \"images\"\n },\n \"id\": \"feat_abc123\"\n }\n ]\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.creem.io/v1/products")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 400,\n \"currency\": \"USD\",\n \"billing_type\": \"recurring\",\n \"image_url\": \"https://picsum.photos/200/300\",\n \"image_urls\": [\n \"https://picsum.photos/200/300\",\n \"https://picsum.photos/200/301\"\n ],\n \"billing_period\": \"every-month\",\n \"recurring_interval\": \"week\",\n \"recurring_interval_count\": 1,\n \"tax_mode\": \"inclusive\",\n \"business_net_pricing\": false,\n \"tax_category\": \"saas\",\n \"pay_what_you_want\": false,\n \"suggested_price\": 1500,\n \"trial_period_days\": 7,\n \"trial_price\": 100,\n \"default_success_url\": \"https://example.com/?status=successful\",\n \"custom_fields\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"custom_field\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"abandoned_cart_recovery_enabled\": false,\n \"usage_prices\": [\n {\n \"meter_id\": \"mtr_abc123\",\n \"unit_price\": 0.002,\n \"settlement_mode\": \"prepaid\",\n \"id\": \"price_abc123\",\n \"free_allowance\": 1000,\n \"cap\": 50000,\n \"target_account\": \"per_unit\",\n \"target_account_name\": \"images\",\n \"trial_usage_mode\": \"free\"\n }\n ],\n \"features\": [\n {\n \"type\": \"customerCredits\",\n \"description\": \"500 image credits\",\n \"customer_credits\": {\n \"amount\": \"100\",\n \"unit_label\": \"tokens\",\n \"bucket_name\": \"images\"\n },\n \"id\": \"feat_abc123\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.creem.io/v1/products")
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\": \"<string>\",\n \"description\": \"<string>\",\n \"price\": 400,\n \"currency\": \"USD\",\n \"billing_type\": \"recurring\",\n \"image_url\": \"https://picsum.photos/200/300\",\n \"image_urls\": [\n \"https://picsum.photos/200/300\",\n \"https://picsum.photos/200/301\"\n ],\n \"billing_period\": \"every-month\",\n \"recurring_interval\": \"week\",\n \"recurring_interval_count\": 1,\n \"tax_mode\": \"inclusive\",\n \"business_net_pricing\": false,\n \"tax_category\": \"saas\",\n \"pay_what_you_want\": false,\n \"suggested_price\": 1500,\n \"trial_period_days\": 7,\n \"trial_price\": 100,\n \"default_success_url\": \"https://example.com/?status=successful\",\n \"custom_fields\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"custom_field\": [\n {\n \"type\": \"text\",\n \"key\": \"companyName\",\n \"label\": \"Company Name\",\n \"optional\": true,\n \"text\": {\n \"max_length\": 200,\n \"min_length\": 1\n },\n \"checkbox\": {\n \"label\": \"I agree to the [terms and conditions](https://example.com/terms)\"\n }\n }\n ],\n \"abandoned_cart_recovery_enabled\": false,\n \"usage_prices\": [\n {\n \"meter_id\": \"mtr_abc123\",\n \"unit_price\": 0.002,\n \"settlement_mode\": \"prepaid\",\n \"id\": \"price_abc123\",\n \"free_allowance\": 1000,\n \"cap\": 50000,\n \"target_account\": \"per_unit\",\n \"target_account_name\": \"images\",\n \"trial_usage_mode\": \"free\"\n }\n ],\n \"features\": [\n {\n \"type\": \"customerCredits\",\n \"description\": \"500 image credits\",\n \"customer_credits\": {\n \"amount\": \"100\",\n \"unit_label\": \"tokens\",\n \"bucket_name\": \"images\"\n },\n \"id\": \"feat_abc123\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"mode": "test",
"object": "<string>",
"name": "<string>",
"description": "This is a sample product description.",
"price": 400,
"currency": "USD",
"billing_type": "recurring",
"billing_period": "every-month",
"status": "active",
"tax_mode": "inclusive",
"tax_category": "saas",
"created_at": "2023-01-01T00:00:00Z",
"updated_at": "2023-01-01T00:00:00Z",
"image_url": "https://example.com/image.jpg",
"image_urls": [
"https://example.com/image.jpg"
],
"features": [
{
"id": "feat_abc123",
"type": "licenseKey",
"description": "Access to premium course materials.",
"customer_credits": {
"amount": "100",
"unit_label": "tokens",
"bucket_name": "images"
}
}
],
"usage_prices": [
{
"id": "price_abc123",
"meter_id": "mtr_abc123",
"unit_price": 0.002,
"free_allowance": 1000,
"settlement_mode": "prepaid",
"target_account": "per_unit",
"trial_usage_mode": "free",
"cap": 50000,
"target_account_name": "images"
}
],
"recurring_interval": "month",
"recurring_interval_count": 3,
"trial_period_days": 7,
"trial_price": 100,
"business_net_pricing": false,
"product_url": "https://creem.io/product/prod_123123123123",
"default_success_url": "https://example.com/?status=successful",
"custom_fields": [
{
"type": "text",
"key": "<string>",
"label": "<string>",
"optional": true,
"text": {
"max_length": 123,
"minimum_length": 123,
"value": "<string>"
},
"checkbox": {
"label": "<string>",
"value": true
}
}
]
}Authorizations
API key for authentication. You can find your API key in the Creem dashboard under Settings > API Keys.
Headers
Optional key that makes retries return the originally created product instead of creating a duplicate.
Body
Product creation payload
Name of the product
Description of the product
The price of the product in cents. Must be 0 (free product) or at least 100 (one whole unit of the currency).
400
Three-letter uppercase ISO 4217 currency code. Must be one of Creem's supported currencies.
EUR, USD "USD"
Billing method for the product: recurring subscription or onetime payment.
recurring, onetime "recurring"
URL of the product image
"https://picsum.photos/200/300"
Ordered list of product image URLs (max 8). The first entry is the cover image; when provided it takes precedence over image_url.
[
"https://picsum.photos/200/300",
"https://picsum.photos/200/301"
]
Billing interval. Required when billing_type is recurring. Use a preset for the common cadences, or custom together with recurring_interval + recurring_interval_count for anything else (e.g. weekly).
once, every-day, every-month, every-three-months, every-six-months, every-year, custom "every-month"
Unit of a custom billing period. Required when billing_period is custom; must be omitted for preset billing periods.
day, week, month, year "week"
Number of recurring_interval units per billing cycle. Required when billing_period is custom. Bounds: day 1–365, week 1–52, month 1–24, year 1–3.
1
Specifies the tax calculation mode for the transaction. If set to "inclusive," the tax is included in the price. If set to "exclusive," the tax is added on top of the price.
inclusive, exclusive "inclusive"
When true, business customers whose valid VAT ID triggers reverse charge pay the price excluding VAT instead of the tax-inclusive price. Only supported for tax-inclusive one-time products; the merchant gives up the VAT portion on those sales. Defaults to false.
false
Categorizes the type of product or service for tax purposes. This helps determine the applicable tax rules based on the nature of the item or service.
saas, digital-goods-service, ebooks "saas"
Enable pay-what-you-want pricing: the customer chooses the amount at checkout. The price field acts as the minimum the customer must pay. Only supported for one-time payment products.
false
Suggested amount in cents, pre-filled at checkout when pay_what_you_want is enabled. Must be greater than or equal to price (the minimum). Ignored when pay_what_you_want is disabled.
1500
Length of the trial period in days. A whole number of days, at least 1. Only supported for recurring products. Omit for no trial.
7
Amount charged at checkout to start the trial, instead of a free card verification. In cents (100 = $1.00). Requires a trial period and must be at least 100 and lower than price; only supported on standard-priced recurring products without pay-what-you-want. Omit (or send 0) for a free trial.
100
The URL to which the user will be redirected after successfull payment.
"https://example.com/?status=successful"
Collect additional information from your customer using custom fields during checkout. Up to 3 fields are supported.
Show child attributes
Show child attributes
DEPRECATED: Use custom_fields instead. Collect additional information from your customer using custom fields during checkout. Up to 3 fields are supported.
Show child attributes
Show child attributes
Enable abandoned cart recovery for this product
Metered charges billed on top of the base price, one per meter. Recurring products only.
Show child attributes
Show child attributes
Features granted by purchase. Only customerCredits (a credit grant into one of the customer credit buckets) can be managed through the API.
Show child attributes
Show child attributes
Response
Successfully created a product
Unique identifier for the object.
String representing the environment.
test, prod, sandbox String representing the object's type. Objects of the same type share the same value.
The name of the product
A brief description of the product
"This is a sample product description."
The price of the product in cents. 1000 = $10.00
400
Three-letter ISO currency code, in uppercase. Must be a supported currency.
"USD"
Indicates the billing method for the customer. It can either be a recurring billing cycle or a onetime payment.
recurring, onetime "recurring"
Billing period
every-month, every-three-months, every-six-months, every-year, every-day, once, custom "every-month"
Lifecycle status of the product: active or archived.
active, archived "active"
Specifies the tax calculation mode for the transaction. If set to "inclusive," the tax is included in the price. If set to "exclusive," the tax is added on top of the price.
inclusive, exclusive "inclusive"
Categorizes the type of product or service for tax purposes. This helps determine the applicable tax rules based on the nature of the item or service.
saas, digital-goods-service, ebooks "saas"
Creation date of the product
"2023-01-01T00:00:00Z"
Last updated date of the product
"2023-01-01T00:00:00Z"
URL of the product image. Only png as jpg are supported
"https://example.com/image.jpg"
Ordered list of product image URLs. The first entry is the cover image (mirrored in image_url).
["https://example.com/image.jpg"]
Features of the product.
Show child attributes
Show child attributes
Metered charges billed on top of the base price, one per meter. Present on recurring products that meter usage.
Show child attributes
Show child attributes
The unit of the recurring billing interval (day, week, month, or year). Together with recurring_interval_count this is authoritative for renewal timing — a billing_period of custom cannot be interpreted without it. For presets it is derived from the cadence (e.g. every-three-months → month). null for one-time products.
"month"
The number of recurring_interval units per billing cycle (e.g. 3 with a month interval bills every three months). Together with recurring_interval this is authoritative for renewal timing. For presets it is derived from the cadence. null for one-time products.
3
Length of the trial period in days. A whole number of days, at least 1. Only supported for recurring products. null when the product has no trial.
7
Amount charged at checkout to start the trial, instead of a free card verification. In cents (100 = $1.00). Requires a trial period and must be at least 100 and lower than price; only supported on standard-priced recurring products without pay-what-you-want. null for a free trial and for products without a trial.
100
When true, business customers whose valid VAT ID triggers reverse charge pay the price excluding VAT instead of the tax-inclusive price. Only supported for tax-inclusive one-time products; the merchant gives up the VAT portion on those sales. Defaults to false.
false
The product page you can redirect your customers to for express checkout.
"https://creem.io/product/prod_123123123123"
The URL to which the user will be redirected after successfull payment.
"https://example.com/?status=successful"
Custom fields configured for the product. Collect additional information from your customer during checkout.
Show child attributes
Show child attributes