Create a subscription
Creates a new subscription for a customer. Supports three creation patterns: raw pricing in the request body, from a plan, or from a plan with per-customer overrides. Subscriptions are created in draft status and must be activated unless auto_activate: true is set. See the Creating a Subscription examples for concrete request bodies and the bundle variants.
curl --request POST \
--url https://api.alguna.io/subscriptions \
--header 'Alguna-Version: <alguna-version>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "cust_abc123",
"auto_activate": false,
"billing": {
"auto_issue_invoices": true,
"auto_pay_invoices": false,
"first_billing_date": "2026-07-01",
"payment_terms": "net_30"
},
"contract": {
"duration_months": 12,
"period_type": "fixed",
"start_date": "2026-07-01"
},
"currency": "USD",
"items": [
{
"bundle_id": "bun_abc123",
"items": [
{
"price": {
"billing_direction": "arrears",
"fee_type": "fixed",
"type": "fixed",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"billing_interval_count": 3,
"billing_interval_unit": "month",
"charge_on_contract_start": false,
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"display_order": 1,
"expression_pricing_model": {
"charges": [
{
"billing_direction": "arrears",
"description": "API usage charge",
"quantity_expression": "usage.api_calls",
"unit_price_expression": "0.01"
}
],
"metric_bindings": [
{
"alias": "api_calls",
"metric_id": "<string>"
}
]
},
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"matrix_pricing_model": {
"dimensions": [
{
"key": "<string>",
"label": "<string>",
"values": [
"<string>"
]
}
],
"root": {
"fallback": "<unknown>",
"leaf": {
"cell_key": "<string>",
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"label": "<string>",
"tiered_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"splits": [
{
"branches": [
{
"child": "<unknown>",
"value": "<string>"
}
],
"dimension_key": "<string>",
"wildcard": "<unknown>"
}
]
},
"line_item_template": "<string>"
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"prepaid_fixed_tiered_pricing_model": {
"overages_charge_interval": "monthly",
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"recurring_instalment_interval_count": 1,
"recurring_instalment_interval_unit": "month",
"tiered_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"product_id": "prod_abc123"
}
],
"price": {
"billing_direction": "arrears",
"fee_type": "fixed",
"type": "fixed",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"billing_interval_count": 3,
"billing_interval_unit": "month",
"charge_on_contract_start": false,
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"display_order": 1,
"expression_pricing_model": {
"charges": [
{
"billing_direction": "arrears",
"description": "API usage charge",
"quantity_expression": "usage.api_calls",
"unit_price_expression": "0.01"
}
],
"metric_bindings": [
{
"alias": "api_calls",
"metric_id": "<string>"
}
]
},
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"matrix_pricing_model": {
"dimensions": [
{
"key": "<string>",
"label": "<string>",
"values": [
"<string>"
]
}
],
"root": {
"fallback": "<unknown>",
"leaf": {
"cell_key": "<string>",
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"label": "<string>",
"tiered_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"splits": [
{
"branches": [
{
"child": "<unknown>",
"value": "<string>"
}
],
"dimension_key": "<string>",
"wildcard": "<unknown>"
}
]
},
"line_item_template": "<string>"
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"prepaid_fixed_tiered_pricing_model": {
"overages_charge_interval": "monthly",
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"recurring_instalment_interval_count": 1,
"recurring_instalment_interval_unit": "month",
"tiered_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"product_id": "prod_abc123"
}
],
"metadata": {},
"name": "Acme Corp - Enterprise",
"plan_id": "pln_abc123",
"renewal": {
"auto_renew": true,
"duration_months": 12,
"period_type": "fixed"
}
}
'import requests
url = "https://api.alguna.io/subscriptions"
payload = {
"customer_id": "cust_abc123",
"auto_activate": False,
"billing": {
"auto_issue_invoices": True,
"auto_pay_invoices": False,
"first_billing_date": "2026-07-01",
"payment_terms": "net_30"
},
"contract": {
"duration_months": 12,
"period_type": "fixed",
"start_date": "2026-07-01"
},
"currency": "USD",
"items": [
{
"bundle_id": "bun_abc123",
"items": [
{
"price": {
"billing_direction": "arrears",
"fee_type": "fixed",
"type": "fixed",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"billing_interval_count": 3,
"billing_interval_unit": "month",
"charge_on_contract_start": False,
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"display_order": 1,
"expression_pricing_model": {
"charges": [
{
"billing_direction": "arrears",
"description": "API usage charge",
"quantity_expression": "usage.api_calls",
"unit_price_expression": "0.01"
}
],
"metric_bindings": [
{
"alias": "api_calls",
"metric_id": "<string>"
}
]
},
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"matrix_pricing_model": {
"dimensions": [
{
"key": "<string>",
"label": "<string>",
"values": ["<string>"]
}
],
"root": {
"fallback": "<unknown>",
"leaf": {
"cell_key": "<string>",
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"label": "<string>",
"tiered_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"splits": [
{
"branches": [
{
"child": "<unknown>",
"value": "<string>"
}
],
"dimension_key": "<string>",
"wildcard": "<unknown>"
}
]
},
"line_item_template": "<string>"
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"prepaid_fixed_tiered_pricing_model": {
"overages_charge_interval": "monthly",
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"recurring_instalment_interval_count": 1,
"recurring_instalment_interval_unit": "month",
"tiered_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"product_id": "prod_abc123"
}
],
"price": {
"billing_direction": "arrears",
"fee_type": "fixed",
"type": "fixed",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"billing_interval_count": 3,
"billing_interval_unit": "month",
"charge_on_contract_start": False,
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"display_order": 1,
"expression_pricing_model": {
"charges": [
{
"billing_direction": "arrears",
"description": "API usage charge",
"quantity_expression": "usage.api_calls",
"unit_price_expression": "0.01"
}
],
"metric_bindings": [
{
"alias": "api_calls",
"metric_id": "<string>"
}
]
},
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"matrix_pricing_model": {
"dimensions": [
{
"key": "<string>",
"label": "<string>",
"values": ["<string>"]
}
],
"root": {
"fallback": "<unknown>",
"leaf": {
"cell_key": "<string>",
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"label": "<string>",
"tiered_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"splits": [
{
"branches": [
{
"child": "<unknown>",
"value": "<string>"
}
],
"dimension_key": "<string>",
"wildcard": "<unknown>"
}
]
},
"line_item_template": "<string>"
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"prepaid_fixed_tiered_pricing_model": {
"overages_charge_interval": "monthly",
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"recurring_instalment_interval_count": 1,
"recurring_instalment_interval_unit": "month",
"tiered_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"product_id": "prod_abc123"
}
],
"metadata": {},
"name": "Acme Corp - Enterprise",
"plan_id": "pln_abc123",
"renewal": {
"auto_renew": True,
"duration_months": 12,
"period_type": "fixed"
}
}
headers = {
"Alguna-Version": "<alguna-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Alguna-Version': '<alguna-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: 'cust_abc123',
auto_activate: false,
billing: {
auto_issue_invoices: true,
auto_pay_invoices: false,
first_billing_date: '2026-07-01',
payment_terms: 'net_30'
},
contract: {duration_months: 12, period_type: 'fixed', start_date: '2026-07-01'},
currency: 'USD',
items: [
{
bundle_id: 'bun_abc123',
items: [
{
price: {
billing_direction: 'arrears',
fee_type: 'fixed',
type: 'fixed',
billing_frequency: 'recurring',
billing_interval: 'monthly',
billing_interval_count: 3,
billing_interval_unit: 'month',
charge_on_contract_start: false,
discount: {
amount: '10',
duration_type: 'fixed',
type: 'percentage',
duration_unit: 'months',
duration_value: 6
},
display_order: 1,
expression_pricing_model: {
charges: [
{
billing_direction: 'arrears',
description: 'API usage charge',
quantity_expression: 'usage.api_calls',
unit_price_expression: '0.01'
}
],
metric_bindings: [{alias: 'api_calls', metric_id: '<string>'}]
},
fixed_pricing_model: {price_per_unit: '500.00', units: 1},
graduated_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
graduated_tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
matrix_pricing_model: {
dimensions: [{key: '<string>', label: '<string>', values: ['<string>']}],
root: {
fallback: '<unknown>',
leaf: {
cell_key: '<string>',
fixed_pricing_model: {price_per_unit: '500.00', units: 1},
graduated_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
graduated_tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
label: '<string>',
tiered_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {percentage: '2.0', price_per_unit: '0.05', fixed_fee: '5.00'}
},
splits: [
{
branches: [{child: '<unknown>', value: '<string>'}],
dimension_key: '<string>',
wildcard: '<unknown>'
}
]
},
line_item_template: '<string>'
},
maximum_spend: {amount: '500.00', period: 'monthly', billing_direction: 'arrears'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly', billing_direction: 'arrears'},
prepaid_fixed_tiered_pricing_model: {
overages_charge_interval: 'monthly',
prepaid_units: 50000,
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
]
},
recurring_instalment_interval_count: 1,
recurring_instalment_interval_unit: 'month',
tiered_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
trial_period_days: 30,
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {percentage: '2.0', price_per_unit: '0.05', fixed_fee: '5.00'}
},
product_id: 'prod_abc123'
}
],
price: {
billing_direction: 'arrears',
fee_type: 'fixed',
type: 'fixed',
billing_frequency: 'recurring',
billing_interval: 'monthly',
billing_interval_count: 3,
billing_interval_unit: 'month',
charge_on_contract_start: false,
discount: {
amount: '10',
duration_type: 'fixed',
type: 'percentage',
duration_unit: 'months',
duration_value: 6
},
display_order: 1,
expression_pricing_model: {
charges: [
{
billing_direction: 'arrears',
description: 'API usage charge',
quantity_expression: 'usage.api_calls',
unit_price_expression: '0.01'
}
],
metric_bindings: [{alias: 'api_calls', metric_id: '<string>'}]
},
fixed_pricing_model: {price_per_unit: '500.00', units: 1},
graduated_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
graduated_tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
matrix_pricing_model: {
dimensions: [{key: '<string>', label: '<string>', values: ['<string>']}],
root: {
fallback: '<unknown>',
leaf: {
cell_key: '<string>',
fixed_pricing_model: {price_per_unit: '500.00', units: 1},
graduated_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
graduated_tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
label: '<string>',
tiered_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {percentage: '2.0', price_per_unit: '0.05', fixed_fee: '5.00'}
},
splits: [
{
branches: [{child: '<unknown>', value: '<string>'}],
dimension_key: '<string>',
wildcard: '<unknown>'
}
]
},
line_item_template: '<string>'
},
maximum_spend: {amount: '500.00', period: 'monthly', billing_direction: 'arrears'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly', billing_direction: 'arrears'},
prepaid_fixed_tiered_pricing_model: {
overages_charge_interval: 'monthly',
prepaid_units: 50000,
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
]
},
recurring_instalment_interval_count: 1,
recurring_instalment_interval_unit: 'month',
tiered_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
trial_period_days: 30,
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {percentage: '2.0', price_per_unit: '0.05', fixed_fee: '5.00'}
},
product_id: 'prod_abc123'
}
],
metadata: {},
name: 'Acme Corp - Enterprise',
plan_id: 'pln_abc123',
renewal: {auto_renew: true, duration_months: 12, period_type: 'fixed'}
})
};
fetch('https://api.alguna.io/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"billing": {
"auto_issue_invoices": true,
"auto_pay_invoices": false,
"first_billing_date": "2026-01-01T00:00:00Z",
"payment_terms": "net_30"
},
"contract": {
"period_type": "fixed",
"duration_months": 12,
"end_date": "2027-01-01T00:00:00Z",
"start_date": "2026-01-01T00:00:00Z"
},
"created_at": "2025-12-15T10:30:00Z",
"currency": "USD",
"customer_id": "cust_abc123",
"id": "sub_abc123",
"metadata": {},
"name": "Acme Corp - Enterprise",
"pending_changes": [
{
"status": "draft",
"version_id": "subv_abc123",
"description": "Q3 upgrade",
"effective_at": "2027-01-01T00:00:00Z"
}
],
"renewal": {
"auto_renew": true,
"duration_months": 12,
"period_type": "fixed"
},
"status": "active",
"updated_at": "2026-04-04T10:00:05Z",
"activated_at": "2026-01-01T00:00:00Z",
"current_version_id": "subv_abc123",
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"plan_id": "pln_abc123",
"price_escalation": {
"enabled": true,
"interval_months": 12,
"type": "percentage",
"escalate_metered_unit_rates": false,
"percentage": "5.00"
},
"trial_period_days": 30
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}Authorizations
API key authentication. Pass your API key as a Bearer token.
Headers
2026-04-01 A unique string used to ensure the request is processed exactly once. If you retry a request with the same idempotency key within 24 hours, the original response is returned without re-executing the operation.
255"ik_a1b2c3d4e5f6"
Body
Customer ID
"cust_abc123"
Auto-activate after creation
false
Billing configuration
Show child attributes
Show child attributes
Contract configuration
Show child attributes
Show child attributes
Currency code. Required when plan_id is not provided. When plan_id is set, defaults to the customer's currency.
"USD"
Items for the first subscription version. Without plan_id, this is the full set of items. With plan_id, items override matching plan items (by product_id or bundle_id) and non-matching items are appended.
Show child attributes
Show child attributes
Key-value metadata
Subscription name
"Acme Corp - Enterprise"
Plan ID to use as the base item set (optional)
"pln_abc123"
Renewal configuration
Show child attributes
Show child attributes
Response
Success
Billing configuration
Show child attributes
Show child attributes
Contract configuration
Show child attributes
Show child attributes
When the subscription was created
"2025-12-15T10:30:00Z"
ISO 4217 currency code
"USD"
Customer ID
"cust_abc123"
Unique identifier
"sub_abc123"
Key-value metadata
Subscription name
"Acme Corp - Enterprise"
Pending version changes
Show child attributes
Show child attributes
Renewal configuration
Show child attributes
Show child attributes
Subscription status
"active"
When the subscription was last updated
"2026-04-04T10:00:05Z"
When the subscription was activated
"2026-01-01T00:00:00Z"
Current active version ID
"subv_abc123"
Subscription-level discount
Show child attributes
Show child attributes
Maximum spend threshold
Show child attributes
Show child attributes
Minimum spend threshold
Show child attributes
Show child attributes
Plan ID
"pln_abc123"
Price escalation configuration
Show child attributes
Show child attributes
Trial period in days
30
curl --request POST \
--url https://api.alguna.io/subscriptions \
--header 'Alguna-Version: <alguna-version>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"customer_id": "cust_abc123",
"auto_activate": false,
"billing": {
"auto_issue_invoices": true,
"auto_pay_invoices": false,
"first_billing_date": "2026-07-01",
"payment_terms": "net_30"
},
"contract": {
"duration_months": 12,
"period_type": "fixed",
"start_date": "2026-07-01"
},
"currency": "USD",
"items": [
{
"bundle_id": "bun_abc123",
"items": [
{
"price": {
"billing_direction": "arrears",
"fee_type": "fixed",
"type": "fixed",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"billing_interval_count": 3,
"billing_interval_unit": "month",
"charge_on_contract_start": false,
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"display_order": 1,
"expression_pricing_model": {
"charges": [
{
"billing_direction": "arrears",
"description": "API usage charge",
"quantity_expression": "usage.api_calls",
"unit_price_expression": "0.01"
}
],
"metric_bindings": [
{
"alias": "api_calls",
"metric_id": "<string>"
}
]
},
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"matrix_pricing_model": {
"dimensions": [
{
"key": "<string>",
"label": "<string>",
"values": [
"<string>"
]
}
],
"root": {
"fallback": "<unknown>",
"leaf": {
"cell_key": "<string>",
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"label": "<string>",
"tiered_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"splits": [
{
"branches": [
{
"child": "<unknown>",
"value": "<string>"
}
],
"dimension_key": "<string>",
"wildcard": "<unknown>"
}
]
},
"line_item_template": "<string>"
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"prepaid_fixed_tiered_pricing_model": {
"overages_charge_interval": "monthly",
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"recurring_instalment_interval_count": 1,
"recurring_instalment_interval_unit": "month",
"tiered_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"product_id": "prod_abc123"
}
],
"price": {
"billing_direction": "arrears",
"fee_type": "fixed",
"type": "fixed",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"billing_interval_count": 3,
"billing_interval_unit": "month",
"charge_on_contract_start": false,
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"display_order": 1,
"expression_pricing_model": {
"charges": [
{
"billing_direction": "arrears",
"description": "API usage charge",
"quantity_expression": "usage.api_calls",
"unit_price_expression": "0.01"
}
],
"metric_bindings": [
{
"alias": "api_calls",
"metric_id": "<string>"
}
]
},
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"matrix_pricing_model": {
"dimensions": [
{
"key": "<string>",
"label": "<string>",
"values": [
"<string>"
]
}
],
"root": {
"fallback": "<unknown>",
"leaf": {
"cell_key": "<string>",
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"label": "<string>",
"tiered_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"splits": [
{
"branches": [
{
"child": "<unknown>",
"value": "<string>"
}
],
"dimension_key": "<string>",
"wildcard": "<unknown>"
}
]
},
"line_item_template": "<string>"
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"prepaid_fixed_tiered_pricing_model": {
"overages_charge_interval": "monthly",
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"recurring_instalment_interval_count": 1,
"recurring_instalment_interval_unit": "month",
"tiered_percentage_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
]
},
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"product_id": "prod_abc123"
}
],
"metadata": {},
"name": "Acme Corp - Enterprise",
"plan_id": "pln_abc123",
"renewal": {
"auto_renew": true,
"duration_months": 12,
"period_type": "fixed"
}
}
'import requests
url = "https://api.alguna.io/subscriptions"
payload = {
"customer_id": "cust_abc123",
"auto_activate": False,
"billing": {
"auto_issue_invoices": True,
"auto_pay_invoices": False,
"first_billing_date": "2026-07-01",
"payment_terms": "net_30"
},
"contract": {
"duration_months": 12,
"period_type": "fixed",
"start_date": "2026-07-01"
},
"currency": "USD",
"items": [
{
"bundle_id": "bun_abc123",
"items": [
{
"price": {
"billing_direction": "arrears",
"fee_type": "fixed",
"type": "fixed",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"billing_interval_count": 3,
"billing_interval_unit": "month",
"charge_on_contract_start": False,
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"display_order": 1,
"expression_pricing_model": {
"charges": [
{
"billing_direction": "arrears",
"description": "API usage charge",
"quantity_expression": "usage.api_calls",
"unit_price_expression": "0.01"
}
],
"metric_bindings": [
{
"alias": "api_calls",
"metric_id": "<string>"
}
]
},
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"matrix_pricing_model": {
"dimensions": [
{
"key": "<string>",
"label": "<string>",
"values": ["<string>"]
}
],
"root": {
"fallback": "<unknown>",
"leaf": {
"cell_key": "<string>",
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"label": "<string>",
"tiered_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"splits": [
{
"branches": [
{
"child": "<unknown>",
"value": "<string>"
}
],
"dimension_key": "<string>",
"wildcard": "<unknown>"
}
]
},
"line_item_template": "<string>"
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"prepaid_fixed_tiered_pricing_model": {
"overages_charge_interval": "monthly",
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"recurring_instalment_interval_count": 1,
"recurring_instalment_interval_unit": "month",
"tiered_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"product_id": "prod_abc123"
}
],
"price": {
"billing_direction": "arrears",
"fee_type": "fixed",
"type": "fixed",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"billing_interval_count": 3,
"billing_interval_unit": "month",
"charge_on_contract_start": False,
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"display_order": 1,
"expression_pricing_model": {
"charges": [
{
"billing_direction": "arrears",
"description": "API usage charge",
"quantity_expression": "usage.api_calls",
"unit_price_expression": "0.01"
}
],
"metric_bindings": [
{
"alias": "api_calls",
"metric_id": "<string>"
}
]
},
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"matrix_pricing_model": {
"dimensions": [
{
"key": "<string>",
"label": "<string>",
"values": ["<string>"]
}
],
"root": {
"fallback": "<unknown>",
"leaf": {
"cell_key": "<string>",
"fixed_pricing_model": {
"price_per_unit": "500.00",
"units": 1
},
"graduated_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"graduated_tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"label": "<string>",
"tiered_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"splits": [
{
"branches": [
{
"child": "<unknown>",
"value": "<string>"
}
],
"dimension_key": "<string>",
"wildcard": "<unknown>"
}
]
},
"line_item_template": "<string>"
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"prepaid_fixed_tiered_pricing_model": {
"overages_charge_interval": "monthly",
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
]
},
"recurring_instalment_interval_count": 1,
"recurring_instalment_interval_unit": "month",
"tiered_percentage_pricing_model": { "tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"percentage": "2.5"
}
] },
"tiered_pricing_model": {
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02",
"unit_price": "5.00"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"percentage": "2.0",
"price_per_unit": "0.05",
"fixed_fee": "5.00"
}
},
"product_id": "prod_abc123"
}
],
"metadata": {},
"name": "Acme Corp - Enterprise",
"plan_id": "pln_abc123",
"renewal": {
"auto_renew": True,
"duration_months": 12,
"period_type": "fixed"
}
}
headers = {
"Alguna-Version": "<alguna-version>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Alguna-Version': '<alguna-version>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
customer_id: 'cust_abc123',
auto_activate: false,
billing: {
auto_issue_invoices: true,
auto_pay_invoices: false,
first_billing_date: '2026-07-01',
payment_terms: 'net_30'
},
contract: {duration_months: 12, period_type: 'fixed', start_date: '2026-07-01'},
currency: 'USD',
items: [
{
bundle_id: 'bun_abc123',
items: [
{
price: {
billing_direction: 'arrears',
fee_type: 'fixed',
type: 'fixed',
billing_frequency: 'recurring',
billing_interval: 'monthly',
billing_interval_count: 3,
billing_interval_unit: 'month',
charge_on_contract_start: false,
discount: {
amount: '10',
duration_type: 'fixed',
type: 'percentage',
duration_unit: 'months',
duration_value: 6
},
display_order: 1,
expression_pricing_model: {
charges: [
{
billing_direction: 'arrears',
description: 'API usage charge',
quantity_expression: 'usage.api_calls',
unit_price_expression: '0.01'
}
],
metric_bindings: [{alias: 'api_calls', metric_id: '<string>'}]
},
fixed_pricing_model: {price_per_unit: '500.00', units: 1},
graduated_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
graduated_tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
matrix_pricing_model: {
dimensions: [{key: '<string>', label: '<string>', values: ['<string>']}],
root: {
fallback: '<unknown>',
leaf: {
cell_key: '<string>',
fixed_pricing_model: {price_per_unit: '500.00', units: 1},
graduated_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
graduated_tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
label: '<string>',
tiered_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {percentage: '2.0', price_per_unit: '0.05', fixed_fee: '5.00'}
},
splits: [
{
branches: [{child: '<unknown>', value: '<string>'}],
dimension_key: '<string>',
wildcard: '<unknown>'
}
]
},
line_item_template: '<string>'
},
maximum_spend: {amount: '500.00', period: 'monthly', billing_direction: 'arrears'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly', billing_direction: 'arrears'},
prepaid_fixed_tiered_pricing_model: {
overages_charge_interval: 'monthly',
prepaid_units: 50000,
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
]
},
recurring_instalment_interval_count: 1,
recurring_instalment_interval_unit: 'month',
tiered_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
trial_period_days: 30,
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {percentage: '2.0', price_per_unit: '0.05', fixed_fee: '5.00'}
},
product_id: 'prod_abc123'
}
],
price: {
billing_direction: 'arrears',
fee_type: 'fixed',
type: 'fixed',
billing_frequency: 'recurring',
billing_interval: 'monthly',
billing_interval_count: 3,
billing_interval_unit: 'month',
charge_on_contract_start: false,
discount: {
amount: '10',
duration_type: 'fixed',
type: 'percentage',
duration_unit: 'months',
duration_value: 6
},
display_order: 1,
expression_pricing_model: {
charges: [
{
billing_direction: 'arrears',
description: 'API usage charge',
quantity_expression: 'usage.api_calls',
unit_price_expression: '0.01'
}
],
metric_bindings: [{alias: 'api_calls', metric_id: '<string>'}]
},
fixed_pricing_model: {price_per_unit: '500.00', units: 1},
graduated_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
graduated_tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
matrix_pricing_model: {
dimensions: [{key: '<string>', label: '<string>', values: ['<string>']}],
root: {
fallback: '<unknown>',
leaf: {
cell_key: '<string>',
fixed_pricing_model: {price_per_unit: '500.00', units: 1},
graduated_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
graduated_tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
label: '<string>',
tiered_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {percentage: '2.0', price_per_unit: '0.05', fixed_fee: '5.00'}
},
splits: [
{
branches: [{child: '<unknown>', value: '<string>'}],
dimension_key: '<string>',
wildcard: '<unknown>'
}
]
},
line_item_template: '<string>'
},
maximum_spend: {amount: '500.00', period: 'monthly', billing_direction: 'arrears'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly', billing_direction: 'arrears'},
prepaid_fixed_tiered_pricing_model: {
overages_charge_interval: 'monthly',
prepaid_units: 50000,
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
]
},
recurring_instalment_interval_count: 1,
recurring_instalment_interval_unit: 'month',
tiered_percentage_pricing_model: {
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, percentage: '2.5'}]
},
tiered_pricing_model: {
tiers: [
{
min_units: 0,
fixed_fee: '10.00',
max_units: 10000,
price_per_unit: '0.02',
unit_price: '5.00'
}
],
units: 10
},
trial_period_days: 30,
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {percentage: '2.0', price_per_unit: '0.05', fixed_fee: '5.00'}
},
product_id: 'prod_abc123'
}
],
metadata: {},
name: 'Acme Corp - Enterprise',
plan_id: 'pln_abc123',
renewal: {auto_renew: true, duration_months: 12, period_type: 'fixed'}
})
};
fetch('https://api.alguna.io/subscriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"billing": {
"auto_issue_invoices": true,
"auto_pay_invoices": false,
"first_billing_date": "2026-01-01T00:00:00Z",
"payment_terms": "net_30"
},
"contract": {
"period_type": "fixed",
"duration_months": 12,
"end_date": "2027-01-01T00:00:00Z",
"start_date": "2026-01-01T00:00:00Z"
},
"created_at": "2025-12-15T10:30:00Z",
"currency": "USD",
"customer_id": "cust_abc123",
"id": "sub_abc123",
"metadata": {},
"name": "Acme Corp - Enterprise",
"pending_changes": [
{
"status": "draft",
"version_id": "subv_abc123",
"description": "Q3 upgrade",
"effective_at": "2027-01-01T00:00:00Z"
}
],
"renewal": {
"auto_renew": true,
"duration_months": 12,
"period_type": "fixed"
},
"status": "active",
"updated_at": "2026-04-04T10:00:05Z",
"activated_at": "2026-01-01T00:00:00Z",
"current_version_id": "subv_abc123",
"discount": {
"amount": "10",
"duration_type": "fixed",
"type": "percentage",
"duration_unit": "months",
"duration_value": 6
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"minimum_spend": {
"amount": "500.00",
"period": "monthly",
"billing_direction": "arrears"
},
"plan_id": "pln_abc123",
"price_escalation": {
"enabled": true,
"interval_months": 12,
"type": "percentage",
"escalate_metered_unit_rates": false,
"percentage": "5.00"
},
"trial_period_days": 30
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}