Apply changes to a subscription
Applies a delta (add, remove, update) on top of a source version. The API computes the new version, creates it, and publishes it unless draft: true is set. The effective field controls when the change takes effect (keyword or specific date). This is the high-level mutation endpoint. See the Updating a Subscription examples for concrete bodies covering price adjustments, plan swaps, bundle operations, and tier replacements.
curl --request POST \
--url https://api.alguna.io/subscriptions/{id}/changes \
--header 'Alguna-Version: <alguna-version>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"add": [
{
"bundle_id": "bun_abc123",
"items": [
{
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"description": "Q3 upgrade",
"draft": false,
"effective": "next_billing_period",
"plan_id": "pln_abc123",
"remove": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
],
"source_version_id": "subv_abc123",
"update": [
{
"add_items": [
{
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"adjust": {
"billing_direction": "arrears",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"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>"
}
]
},
"fee_type": "fixed",
"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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"fixed_fee": "5.00",
"percentage": "2.0",
"price_per_unit": "0.05"
}
},
"bundle_id": "bun_abc123",
"items": [
{
"product_id": "prod_abc123",
"adjust": {
"billing_direction": "arrears",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"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>"
}
]
},
"fee_type": "fixed",
"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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"fixed_fee": "5.00",
"percentage": "2.0",
"price_per_unit": "0.05"
}
},
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
}
}
],
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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",
"remove_items": [
{
"product_id": "prod_abc123"
}
]
}
]
}
'import requests
url = "https://api.alguna.io/subscriptions/{id}/changes"
payload = {
"add": [
{
"bundle_id": "bun_abc123",
"items": [
{
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"description": "Q3 upgrade",
"draft": False,
"effective": "next_billing_period",
"plan_id": "pln_abc123",
"remove": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
],
"source_version_id": "subv_abc123",
"update": [
{
"add_items": [
{
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"adjust": {
"billing_direction": "arrears",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"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>"
}
]
},
"fee_type": "fixed",
"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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"fixed_fee": "5.00",
"percentage": "2.0",
"price_per_unit": "0.05"
}
},
"bundle_id": "bun_abc123",
"items": [
{
"product_id": "prod_abc123",
"adjust": {
"billing_direction": "arrears",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"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>"
}
]
},
"fee_type": "fixed",
"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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"fixed_fee": "5.00",
"percentage": "2.0",
"price_per_unit": "0.05"
}
},
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
}
}
],
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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",
"remove_items": [{ "product_id": "prod_abc123" }]
}
]
}
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({
add: [
{
bundle_id: 'bun_abc123',
items: [
{
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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'
}
],
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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'
}
],
description: 'Q3 upgrade',
draft: false,
effective: 'next_billing_period',
plan_id: 'pln_abc123',
remove: [{bundle_id: 'bun_abc123', product_id: 'prod_abc123'}],
source_version_id: 'subv_abc123',
update: [
{
add_items: [
{
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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'
}
],
adjust: {
billing_direction: 'arrears',
billing_frequency: 'recurring',
billing_interval: 'monthly',
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>'}]
},
fee_type: 'fixed',
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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
units: 10
},
trial_period_days: 30,
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {fixed_fee: '5.00', percentage: '2.0', price_per_unit: '0.05'}
},
bundle_id: 'bun_abc123',
items: [
{
product_id: 'prod_abc123',
adjust: {
billing_direction: 'arrears',
billing_frequency: 'recurring',
billing_interval: 'monthly',
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>'}]
},
fee_type: 'fixed',
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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
units: 10
},
trial_period_days: 30,
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {fixed_fee: '5.00', percentage: '2.0', price_per_unit: '0.05'}
},
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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'}
}
}
],
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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',
remove_items: [{product_id: 'prod_abc123'}]
}
]
})
};
fetch('https://api.alguna.io/subscriptions/{id}/changes', 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.alguna.io/subscriptions/{id}/changes",
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([
'add' => [
[
'bundle_id' => 'bun_abc123',
'items' => [
[
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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'
]
],
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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'
]
],
'description' => 'Q3 upgrade',
'draft' => false,
'effective' => 'next_billing_period',
'plan_id' => 'pln_abc123',
'remove' => [
[
'bundle_id' => 'bun_abc123',
'product_id' => 'prod_abc123'
]
],
'source_version_id' => 'subv_abc123',
'update' => [
[
'add_items' => [
[
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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'
]
],
'adjust' => [
'billing_direction' => 'arrears',
'billing_frequency' => 'recurring',
'billing_interval' => 'monthly',
'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>'
]
]
],
'fee_type' => 'fixed',
'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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'units' => 10
],
'trial_period_days' => 30,
'unit_pricing_model' => [
'price_per_unit' => '0.05'
],
'volume_percentage_pricing_model' => [
'fixed_fee' => '5.00',
'percentage' => '2.0',
'price_per_unit' => '0.05'
]
],
'bundle_id' => 'bun_abc123',
'items' => [
[
'product_id' => 'prod_abc123',
'adjust' => [
'billing_direction' => 'arrears',
'billing_frequency' => 'recurring',
'billing_interval' => 'monthly',
'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>'
]
]
],
'fee_type' => 'fixed',
'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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'units' => 10
],
'trial_period_days' => 30,
'unit_pricing_model' => [
'price_per_unit' => '0.05'
],
'volume_percentage_pricing_model' => [
'fixed_fee' => '5.00',
'percentage' => '2.0',
'price_per_unit' => '0.05'
]
],
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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'
]
]
]
],
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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',
'remove_items' => [
[
'product_id' => 'prod_abc123'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Alguna-Version: <alguna-version>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.alguna.io/subscriptions/{id}/changes"
payload := strings.NewReader("{\n \"add\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"description\": \"Q3 upgrade\",\n \"draft\": false,\n \"effective\": \"next_billing_period\",\n \"plan_id\": \"pln_abc123\",\n \"remove\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"source_version_id\": \"subv_abc123\",\n \"update\": [\n {\n \"add_items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"product_id\": \"prod_abc123\",\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n }\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\",\n \"remove_items\": [\n {\n \"product_id\": \"prod_abc123\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Alguna-Version", "<alguna-version>")
req.Header.Add("Authorization", "Bearer <token>")
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.alguna.io/subscriptions/{id}/changes")
.header("Alguna-Version", "<alguna-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"add\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"description\": \"Q3 upgrade\",\n \"draft\": false,\n \"effective\": \"next_billing_period\",\n \"plan_id\": \"pln_abc123\",\n \"remove\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"source_version_id\": \"subv_abc123\",\n \"update\": [\n {\n \"add_items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"product_id\": \"prod_abc123\",\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n }\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\",\n \"remove_items\": [\n {\n \"product_id\": \"prod_abc123\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alguna.io/subscriptions/{id}/changes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Alguna-Version"] = '<alguna-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"add\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"description\": \"Q3 upgrade\",\n \"draft\": false,\n \"effective\": \"next_billing_period\",\n \"plan_id\": \"pln_abc123\",\n \"remove\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"source_version_id\": \"subv_abc123\",\n \"update\": [\n {\n \"add_items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"product_id\": \"prod_abc123\",\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n }\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\",\n \"remove_items\": [\n {\n \"product_id\": \"prod_abc123\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"changes_applied": {
"added": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
],
"removed": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
],
"updated": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
]
},
"is_new_version": true,
"source_version_id": "subv_abc123",
"version_id": "subv_abc123",
"version_status": "published",
"effective_at": "2027-01-01T00:00:00Z",
"end_date": "2027-06-01T00:00:00Z"
}{
"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"
Path Parameters
Unique identifier for the subscription
Body
Products or bundles to add
Show child attributes
Show child attributes
Human-readable audit note
"Q3 upgrade"
Create as draft (true) or auto-publish (false, default)
false
When the change takes effect. One of: 'immediate' (now), 'next_term_renewal' (contract end), 'next_billing_period' (start of the next invoicing cycle), an ISO 8601 date (YYYY-MM-DD), or an RFC3339 timestamp (e.g. 2027-01-01T14:30:00Z).
"next_billing_period"
Swap to a new plan (provides base item set)
"pln_abc123"
Products or bundles to remove
Show child attributes
Show child attributes
Version to compute deltas against (default: current active)
"subv_abc123"
Products or bundles to modify
Show child attributes
Show child attributes
Response
Success
Summary of changes applied
Show child attributes
Show child attributes
Whether a new version was created (false = draft replaced)
true
Version the delta was computed against
"subv_abc123"
Created or replaced version ID
"subv_abc123"
Version status
draft, published "published"
When the change takes effect
"2027-01-01T00:00:00Z"
When this version ends, if superseded by a later version. Callers should verify this matches expectations when inserting between existing versions.
"2027-06-01T00:00:00Z"
curl --request POST \
--url https://api.alguna.io/subscriptions/{id}/changes \
--header 'Alguna-Version: <alguna-version>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"add": [
{
"bundle_id": "bun_abc123",
"items": [
{
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"description": "Q3 upgrade",
"draft": false,
"effective": "next_billing_period",
"plan_id": "pln_abc123",
"remove": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
],
"source_version_id": "subv_abc123",
"update": [
{
"add_items": [
{
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"adjust": {
"billing_direction": "arrears",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"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>"
}
]
},
"fee_type": "fixed",
"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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"fixed_fee": "5.00",
"percentage": "2.0",
"price_per_unit": "0.05"
}
},
"bundle_id": "bun_abc123",
"items": [
{
"product_id": "prod_abc123",
"adjust": {
"billing_direction": "arrears",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"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>"
}
]
},
"fee_type": "fixed",
"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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": {
"price_per_unit": "0.05"
},
"volume_percentage_pricing_model": {
"fixed_fee": "5.00",
"percentage": "2.0",
"price_per_unit": "0.05"
}
},
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
}
}
],
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": [
"<string>"
],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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",
"remove_items": [
{
"product_id": "prod_abc123"
}
]
}
]
}
'import requests
url = "https://api.alguna.io/subscriptions/{id}/changes"
payload = {
"add": [
{
"bundle_id": "bun_abc123",
"items": [
{
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"description": "Q3 upgrade",
"draft": False,
"effective": "next_billing_period",
"plan_id": "pln_abc123",
"remove": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
],
"source_version_id": "subv_abc123",
"update": [
{
"add_items": [
{
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
],
"adjust": {
"billing_direction": "arrears",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"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>"
}
]
},
"fee_type": "fixed",
"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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"fixed_fee": "5.00",
"percentage": "2.0",
"price_per_unit": "0.05"
}
},
"bundle_id": "bun_abc123",
"items": [
{
"product_id": "prod_abc123",
"adjust": {
"billing_direction": "arrears",
"billing_frequency": "recurring",
"billing_interval": "monthly",
"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>"
}
]
},
"fee_type": "fixed",
"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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"units": 10
},
"trial_period_days": 30,
"unit_pricing_model": { "price_per_unit": "0.05" },
"volume_percentage_pricing_model": {
"fixed_fee": "5.00",
"percentage": "2.0",
"price_per_unit": "0.05"
}
},
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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"
}
}
}
],
"new_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"
}
],
"units": 10
},
"maximum_spend": {
"amount": "500.00",
"period": "monthly"
},
"metric_ids": ["<string>"],
"minimum_spend": {
"amount": "500.00",
"period": "monthly"
},
"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"
}
]
},
"prepaid_tiered_pricing_model": {
"prepaid_units": 50000,
"tiers": [
{
"min_units": 0,
"fixed_fee": "10.00",
"max_units": 10000,
"price_per_unit": "0.02"
}
]
},
"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"
}
],
"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",
"remove_items": [{ "product_id": "prod_abc123" }]
}
]
}
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({
add: [
{
bundle_id: 'bun_abc123',
items: [
{
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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'
}
],
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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'
}
],
description: 'Q3 upgrade',
draft: false,
effective: 'next_billing_period',
plan_id: 'pln_abc123',
remove: [{bundle_id: 'bun_abc123', product_id: 'prod_abc123'}],
source_version_id: 'subv_abc123',
update: [
{
add_items: [
{
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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'
}
],
adjust: {
billing_direction: 'arrears',
billing_frequency: 'recurring',
billing_interval: 'monthly',
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>'}]
},
fee_type: 'fixed',
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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
units: 10
},
trial_period_days: 30,
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {fixed_fee: '5.00', percentage: '2.0', price_per_unit: '0.05'}
},
bundle_id: 'bun_abc123',
items: [
{
product_id: 'prod_abc123',
adjust: {
billing_direction: 'arrears',
billing_frequency: 'recurring',
billing_interval: 'monthly',
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>'}]
},
fee_type: 'fixed',
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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
units: 10
},
trial_period_days: 30,
unit_pricing_model: {price_per_unit: '0.05'},
volume_percentage_pricing_model: {fixed_fee: '5.00', percentage: '2.0', price_per_unit: '0.05'}
},
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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'}
}
}
],
new_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'}],
units: 10
},
maximum_spend: {amount: '500.00', period: 'monthly'},
metric_ids: ['<string>'],
minimum_spend: {amount: '500.00', period: 'monthly'},
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'}]
},
prepaid_tiered_pricing_model: {
prepaid_units: 50000,
tiers: [{min_units: 0, fixed_fee: '10.00', max_units: 10000, price_per_unit: '0.02'}]
},
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'}],
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',
remove_items: [{product_id: 'prod_abc123'}]
}
]
})
};
fetch('https://api.alguna.io/subscriptions/{id}/changes', 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.alguna.io/subscriptions/{id}/changes",
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([
'add' => [
[
'bundle_id' => 'bun_abc123',
'items' => [
[
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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'
]
],
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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'
]
],
'description' => 'Q3 upgrade',
'draft' => false,
'effective' => 'next_billing_period',
'plan_id' => 'pln_abc123',
'remove' => [
[
'bundle_id' => 'bun_abc123',
'product_id' => 'prod_abc123'
]
],
'source_version_id' => 'subv_abc123',
'update' => [
[
'add_items' => [
[
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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'
]
],
'adjust' => [
'billing_direction' => 'arrears',
'billing_frequency' => 'recurring',
'billing_interval' => 'monthly',
'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>'
]
]
],
'fee_type' => 'fixed',
'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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'units' => 10
],
'trial_period_days' => 30,
'unit_pricing_model' => [
'price_per_unit' => '0.05'
],
'volume_percentage_pricing_model' => [
'fixed_fee' => '5.00',
'percentage' => '2.0',
'price_per_unit' => '0.05'
]
],
'bundle_id' => 'bun_abc123',
'items' => [
[
'product_id' => 'prod_abc123',
'adjust' => [
'billing_direction' => 'arrears',
'billing_frequency' => 'recurring',
'billing_interval' => 'monthly',
'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>'
]
]
],
'fee_type' => 'fixed',
'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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'units' => 10
],
'trial_period_days' => 30,
'unit_pricing_model' => [
'price_per_unit' => '0.05'
],
'volume_percentage_pricing_model' => [
'fixed_fee' => '5.00',
'percentage' => '2.0',
'price_per_unit' => '0.05'
]
],
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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'
]
]
]
],
'new_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'
]
],
'units' => 10
],
'maximum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'metric_ids' => [
'<string>'
],
'minimum_spend' => [
'amount' => '500.00',
'period' => 'monthly'
],
'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'
]
]
],
'prepaid_tiered_pricing_model' => [
'prepaid_units' => 50000,
'tiers' => [
[
'min_units' => 0,
'fixed_fee' => '10.00',
'max_units' => 10000,
'price_per_unit' => '0.02'
]
]
],
'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'
]
],
'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',
'remove_items' => [
[
'product_id' => 'prod_abc123'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Alguna-Version: <alguna-version>",
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.alguna.io/subscriptions/{id}/changes"
payload := strings.NewReader("{\n \"add\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"description\": \"Q3 upgrade\",\n \"draft\": false,\n \"effective\": \"next_billing_period\",\n \"plan_id\": \"pln_abc123\",\n \"remove\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"source_version_id\": \"subv_abc123\",\n \"update\": [\n {\n \"add_items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"product_id\": \"prod_abc123\",\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n }\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\",\n \"remove_items\": [\n {\n \"product_id\": \"prod_abc123\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Alguna-Version", "<alguna-version>")
req.Header.Add("Authorization", "Bearer <token>")
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.alguna.io/subscriptions/{id}/changes")
.header("Alguna-Version", "<alguna-version>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"add\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"description\": \"Q3 upgrade\",\n \"draft\": false,\n \"effective\": \"next_billing_period\",\n \"plan_id\": \"pln_abc123\",\n \"remove\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"source_version_id\": \"subv_abc123\",\n \"update\": [\n {\n \"add_items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"product_id\": \"prod_abc123\",\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n }\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\",\n \"remove_items\": [\n {\n \"product_id\": \"prod_abc123\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.alguna.io/subscriptions/{id}/changes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Alguna-Version"] = '<alguna-version>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"add\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"description\": \"Q3 upgrade\",\n \"draft\": false,\n \"effective\": \"next_billing_period\",\n \"plan_id\": \"pln_abc123\",\n \"remove\": [\n {\n \"bundle_id\": \"bun_abc123\",\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"source_version_id\": \"subv_abc123\",\n \"update\": [\n {\n \"add_items\": [\n {\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\"\n }\n ],\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"bundle_id\": \"bun_abc123\",\n \"items\": [\n {\n \"product_id\": \"prod_abc123\",\n \"adjust\": {\n \"billing_direction\": \"arrears\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fee_type\": \"fixed\",\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"fixed_fee\": \"5.00\",\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\"\n }\n },\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n }\n }\n ],\n \"new_price\": {\n \"billing_direction\": \"arrears\",\n \"fee_type\": \"fixed\",\n \"type\": \"fixed\",\n \"billing_frequency\": \"recurring\",\n \"billing_interval\": \"monthly\",\n \"billing_interval_count\": 3,\n \"billing_interval_unit\": \"month\",\n \"charge_on_contract_start\": false,\n \"discount\": {\n \"amount\": \"10\",\n \"duration_type\": \"fixed\",\n \"type\": \"percentage\",\n \"duration_unit\": \"months\",\n \"duration_value\": 6\n },\n \"display_order\": 1,\n \"expression_pricing_model\": {\n \"charges\": [\n {\n \"billing_direction\": \"arrears\",\n \"description\": \"API usage charge\",\n \"quantity_expression\": \"usage.api_calls\",\n \"unit_price_expression\": \"0.01\"\n }\n ],\n \"metric_bindings\": [\n {\n \"alias\": \"api_calls\",\n \"metric_id\": \"<string>\"\n }\n ]\n },\n \"fixed_pricing_model\": {\n \"price_per_unit\": \"500.00\",\n \"units\": 1\n },\n \"graduated_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"graduated_tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"maximum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"metric_ids\": [\n \"<string>\"\n ],\n \"minimum_spend\": {\n \"amount\": \"500.00\",\n \"period\": \"monthly\"\n },\n \"prepaid_fixed_tiered_pricing_model\": {\n \"overages_charge_interval\": \"monthly\",\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"prepaid_tiered_pricing_model\": {\n \"prepaid_units\": 50000,\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ]\n },\n \"recurring_instalment_interval_count\": 1,\n \"recurring_instalment_interval_unit\": \"month\",\n \"tiered_percentage_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"percentage\": \"2.5\"\n }\n ]\n },\n \"tiered_pricing_model\": {\n \"tiers\": [\n {\n \"min_units\": 0,\n \"fixed_fee\": \"10.00\",\n \"max_units\": 10000,\n \"price_per_unit\": \"0.02\"\n }\n ],\n \"units\": 10\n },\n \"trial_period_days\": 30,\n \"unit_pricing_model\": {\n \"price_per_unit\": \"0.05\"\n },\n \"volume_percentage_pricing_model\": {\n \"percentage\": \"2.0\",\n \"price_per_unit\": \"0.05\",\n \"fixed_fee\": \"5.00\"\n }\n },\n \"product_id\": \"prod_abc123\",\n \"remove_items\": [\n {\n \"product_id\": \"prod_abc123\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"changes_applied": {
"added": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
],
"removed": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
],
"updated": [
{
"bundle_id": "bun_abc123",
"product_id": "prod_abc123"
}
]
},
"is_new_version": true,
"source_version_id": "subv_abc123",
"version_id": "subv_abc123",
"version_status": "published",
"effective_at": "2027-01-01T00:00:00Z",
"end_date": "2027-06-01T00:00:00Z"
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}{
"detail": "<string>",
"status": 123
}