Skip to main content

Create a Subscription

Prerequisites

Step 1: Create a Product

curl -X POST https://api.ikawaari.com/v1/products \
-H "Authorization: Bearer ik_test_your_key" \
-H "Content-Type: application/json" \
-d '{ "name": "Premium Plan", "description": "Full access to all features" }'

Step 2: Create a Price

curl -X POST https://api.ikawaari.com/v1/prices \
-H "Authorization: Bearer ik_test_your_key" \
-H "Content-Type: application/json" \
-d '{
"product": "prod_abc123",
"unit_amount": 50000,
"currency": "XOF",
"recurring": { "interval": "month" }
}'

Step 3: Create the Subscription

curl -X POST https://api.ikawaari.com/v1/subscriptions \
-H "Authorization: Bearer ik_test_your_key" \
-H "Content-Type: application/json" \
-d '{
"customer": "cus_abc123",
"items": [{ "price": "price_abc123" }]
}'

With a Free Trial

{
"customer": "cus_abc123",
"items": [{ "price": "price_abc123" }],
"trial_period_days": 14
}