curl --request POST \
--url https://api.hyperline.co/v2/subscriptions/transitions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_subscription_id": "<string>",
"application_schedule": "scheduled",
"target_subscription": {
"name": "<string>",
"purchase_order": "<string>",
"invoicing_entity_id": "ive_jerrb484RHn",
"crm_opportunity_id": "<string>",
"commitment_interval": {
"period": "years",
"count": 1
},
"renew_automatically": true,
"renew_for": {
"period": "years",
"count": 1
},
"minimum_invoice_fee": 250,
"contract_terms": {
"activation_strategy": "start_date",
"end_strategy": "duration",
"starts_at": "2024-12-20T16:04:11Z",
"ends_at": "2024-12-20T16:04:11Z",
"duration": {
"count": 6,
"period": "months"
},
"renew_automatically": true,
"renew_for_duration": {
"count": 1,
"period": "years"
}
},
"starts_at": "2024-12-20T16:04:11Z",
"contract_start": "2024-01-15T00:00:00Z",
"contract_end": "2025-01-15T00:00:00Z",
"initial_billing_at": "2024-12-20T16:04:11Z",
"display_shipping_details": true,
"cancel_at": "2024-12-20T16:04:11Z",
"cancellation_strategy": "refund_prorata",
"cancellation_amount": 123,
"properties": {},
"custom_properties": {},
"tax_only": true,
"generate_draft_invoices": true,
"generate_document": true,
"document_name": "<string>",
"add_tax_to_document": true,
"do_not_charge_subscription": true,
"plan_id": "plan_zHmjoDee4ZRmQV",
"template_id": "subt_7gdusOkqr5L0B8",
"template_configuration_id": "subtc_7mHWOlPStUogvp",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"name": "Product name",
"description": "A description of the product.",
"description_display_interval_dates": false,
"payment_interval": {
"period": "once"
},
"payment_schedule": "start",
"price": {
"type": "fee",
"amount": 200
},
"prices": [
{
"type": "volume",
"from": 0,
"to": 20,
"amount": 200,
"unit_count": 1,
"on_tier_incomplete": null
},
{
"type": "volume",
"from": 21,
"to": null,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": null
}
],
"count": 2,
"unit_name": "user",
"min_committed_count": 2,
"min_amount": 123,
"max_amount": 123,
"metering_interval_type": "subscription_commitment",
"bill_usage_difference": false,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": false
}
],
"coupons": [
{
"id": "<string>",
"repeat": "once",
"duration_period": "days",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": [
"<string>"
]
}
],
"trial": {
"end_strategy": "manual",
"starts_at": "2024-12-20T16:04:11Z",
"ends_at": "2024-12-20T16:04:11Z",
"duration": {
"period": "days",
"count": 2
}
}
},
"name": "<string>",
"calculation_method": "do_not_charge",
"billing_cycle_transition_method": "keep_current_billing_cycle",
"transition_date": "2024-12-20T16:04:11Z"
}
'{
"id": "<string>",
"customer_id": "<string>",
"base_subscription_id": "<string>",
"source_subscription_id": "<string>",
"target_subscription_id": "<string>",
"status": "scheduled",
"transitioned_at": "2023-12-25",
"name": "<string>",
"transition_date": "2023-12-25",
"application_schedule": "immediately",
"billing_cycle_transition_method": "keep_current_billing_cycle",
"calculation_method": "do_not_charge"
}Transition a subscription to another subscription, configured from a subscription, a plan or a template. If the application_schedule is immediately, the transition is applied right away.
curl --request POST \
--url https://api.hyperline.co/v2/subscriptions/transitions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_subscription_id": "<string>",
"application_schedule": "scheduled",
"target_subscription": {
"name": "<string>",
"purchase_order": "<string>",
"invoicing_entity_id": "ive_jerrb484RHn",
"crm_opportunity_id": "<string>",
"commitment_interval": {
"period": "years",
"count": 1
},
"renew_automatically": true,
"renew_for": {
"period": "years",
"count": 1
},
"minimum_invoice_fee": 250,
"contract_terms": {
"activation_strategy": "start_date",
"end_strategy": "duration",
"starts_at": "2024-12-20T16:04:11Z",
"ends_at": "2024-12-20T16:04:11Z",
"duration": {
"count": 6,
"period": "months"
},
"renew_automatically": true,
"renew_for_duration": {
"count": 1,
"period": "years"
}
},
"starts_at": "2024-12-20T16:04:11Z",
"contract_start": "2024-01-15T00:00:00Z",
"contract_end": "2025-01-15T00:00:00Z",
"initial_billing_at": "2024-12-20T16:04:11Z",
"display_shipping_details": true,
"cancel_at": "2024-12-20T16:04:11Z",
"cancellation_strategy": "refund_prorata",
"cancellation_amount": 123,
"properties": {},
"custom_properties": {},
"tax_only": true,
"generate_draft_invoices": true,
"generate_document": true,
"document_name": "<string>",
"add_tax_to_document": true,
"do_not_charge_subscription": true,
"plan_id": "plan_zHmjoDee4ZRmQV",
"template_id": "subt_7gdusOkqr5L0B8",
"template_configuration_id": "subtc_7mHWOlPStUogvp",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"name": "Product name",
"description": "A description of the product.",
"description_display_interval_dates": false,
"payment_interval": {
"period": "once"
},
"payment_schedule": "start",
"price": {
"type": "fee",
"amount": 200
},
"prices": [
{
"type": "volume",
"from": 0,
"to": 20,
"amount": 200,
"unit_count": 1,
"on_tier_incomplete": null
},
{
"type": "volume",
"from": 21,
"to": null,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": null
}
],
"count": 2,
"unit_name": "user",
"min_committed_count": 2,
"min_amount": 123,
"max_amount": 123,
"metering_interval_type": "subscription_commitment",
"bill_usage_difference": false,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": false
}
],
"coupons": [
{
"id": "<string>",
"repeat": "once",
"duration_period": "days",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": [
"<string>"
]
}
],
"trial": {
"end_strategy": "manual",
"starts_at": "2024-12-20T16:04:11Z",
"ends_at": "2024-12-20T16:04:11Z",
"duration": {
"period": "days",
"count": 2
}
}
},
"name": "<string>",
"calculation_method": "do_not_charge",
"billing_cycle_transition_method": "keep_current_billing_cycle",
"transition_date": "2024-12-20T16:04:11Z"
}
'{
"id": "<string>",
"customer_id": "<string>",
"base_subscription_id": "<string>",
"source_subscription_id": "<string>",
"target_subscription_id": "<string>",
"status": "scheduled",
"transitioned_at": "2023-12-25",
"name": "<string>",
"transition_date": "2023-12-25",
"application_schedule": "immediately",
"billing_cycle_transition_method": "keep_current_billing_cycle",
"calculation_method": "do_not_charge"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID of the subscription to transition from
Whether the transition should be applied 'immediately' or 'scheduled' for a future date.
scheduled, immediately The configuration of the subscription to transition to
Show child attributes
Subscription custom name.
Reference to the purchase order.
ID of the invoicing entity attached to the subscription.
"ive_jerrb484RHn"
ID of the related opportunity/deal in the connected CRM.
Deprecated field, please use contract_terms.
{ "period": "years", "count": 1 }Deprecated field, please use contract_terms.
true
Minimum fee applied to each invoice outside of one time payments.
250
Contract terms linked to the subscription.
Show child attributes
Activation strategy of the contract.
immediately: The contract will be activated immediately.manual: The contract will be activated when a user manually activates it.start_date: The contract will be activated on a specified date.quote_signature: The contract will be activated when the subscription quote is signed.checkout: The contract will be activated when the subscription checkout is completed.start_date, immediately, manual, quote_signature, checkout "start_date"
End strategy of contract.
manual: The contract ends when a user manually stops it.end_date: The contract ends on a specified date.duration: The contract ends after a specific relative duration, unless renew_automatically is true.end_date, duration, manual "duration"
Interval over which the contract initially spans. Only applies to duration end strategy.
{ "count": 6, "period": "months" }Indicates if the contract should be renewed automatically.
true: The contract will be renewed automatically.false: The contract will not be renewed automatically.true
Interval over which the contract will be renewed. Only applies if renew_automatically is true.
{ "count": 1, "period": "years" }Deprecated field, please use contract_terms.
"2024-01-15T00:00:00Z"
Deprecated field, please use contract_terms.
"2025-01-15T00:00:00Z"
Indicates if the shipping details should be displayed on the subscription's invoices.
Strategy used to cancel the subscription. If not specified do_nothing is used.
charge_prorata: Will charge the customer the unpaid amount for the prorated period up to the end of the current period.charge_custom: Will charge the customer a custom amount.refund_prorata: Will refund to the customer the overpaid subscription amount using prorated calculations on the cancellation date.refund_custom: Will refund to the customer a custom amount.end_of_period: Will cancel the subscription at the end date of the current billing period.do_nothing: Will only cease the subscription without any additional actions.refund_prorata, refund_custom, charge_prorata, charge_custom, end_of_period, do_nothing Custom amount used when cancelling the subscription. Only applies to the charge_custom or the refund_custom cancellation strategy.
Only tax will be charged on this subscription.
Generate draft invoices for the subscription. Each invoice will need to be reviewed and validated manually before being sent
Generate non-legal documents instead of invoices.
If generate_document is turned on, allows you to give a name to your document.
If generate_document is turned on, will add taxes to document.
Subscription will be invoiced but not charged (invoices/documents will be settled directly).
ID of the plan that the subscription is linked to.
"plan_zHmjoDee4ZRmQV"
ID of the template that the subscription is linked to.
"subt_7gdusOkqr5L0B8"
ID of the template configuration that the subscription is linked to.
"subtc_7mHWOlPStUogvp"
Products that make up the subscription.
Show child attributes
Product ID.
"itm_FJKlqUb8COXw55"
Product name. This will appear on the final invoices.
"Product name"
Product description. This will appear on the final invoices.
"A description of the product."
Indicates if the dates of the interval should be automatically added in the product description on the invoices.
Interval on which the product is billed. This interval can be different between products and can differ from the subscription commitment interval.
Show child attributes
once { "period": "once" }Indicates if the product should be billed at the start or the end of the payment interval.
start, end "start"
Similar to prices, allow to apply a single fee price more easily.
{ "type": "fee", "amount": 200 }Prices of the product. If not specified, the matching prices (depending on the currency, interval, etc) of the product defined in the products catalog/plan are used.
[
{
"type": "volume",
"from": 0,
"to": 20,
"amount": 200,
"unit_count": 1,
"on_tier_incomplete": null
},
{
"type": "volume",
"from": 21,
"to": null,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": null
}
]Number of product units. Only applies to products of type flat_fee, seat or credit.
x >= 12
Product name. This will appear on the final invoices. Only applies to products of type seat or usage.
"user"
Minimum of units committed. If usage is less than this number, then this value will be used. Only applies to products of type usage.
x >= 1Minimum amount billed. If the final computed amount from the usage for this product is less than this amount, then this value will be used. Only applies to products of type usage.
Maximum amount billed. If the final computed amount from the usage for this product is greater than this amount, then this value will be used. Only applies to products of type usage.
Indicates on which type of interval the usage should be aggregated.
subscription_commitment: For the usage contained within the subscription commitment period.payment_interval: For the usage contained within the payment interval of the product.full_database: For all the usage we ingested for this product, no matter the period.
Only applies to products of type usage.subscription_commitment, payment_interval, full_database Only bill the usage difference comparing to the previous period (i.e. actual amount minus last invoice amount). Doesn't apply to payment_interval metering interval type. Only applies to products of type usage.
Validity in days for credits that will be topped-up automatically. Once the period has passed, they'll expire.
Automatically set the expiration date to the end of the next period for each topup. Takes priority on creditsExpirationInDays
Show child attributes
Coupon ID.
Coupon frequency.
once: Will apply the coupon only to the first one invoice.forever: Will apply the coupon to all invoices.custom: Will apply to coupon until a specified expiration date.duration: Will apply the coupon for a specific duration (e.g., 3 months).once, forever, custom, duration Period of time for which the coupon will be applied. Only applies to the duration coupon frequency.
days, weeks, months, years Number of periods for which the coupon will be applied. Only applies to the duration coupon frequency.
Product IDs to which the coupon will be applied.
Create a free trial phase based on the plan configuration. Only applies if a plan_id is provided.
Show child attributes
Defines how the free trial will end.
manual, end_date, duration Show child attributes
Free trial duration period. Only applies if the end strategy is duration.
days, weeks, months, years Free trial duration count. Only applies if the end strategy is duration.
x >= 1An optional name for the transition
The calculation method to use for the transition. 'do_not_charge' will not generate any transition invoice. 'pro_rata' will generate a prorated invoice for the remaining period.
do_not_charge, pro_rata The billing cycle transition method to use. 'keep_current_billing_cycle' will keep the current billing cycle dates if possible. 'align_to_new_billing_cycle' will align the billing cycle to the transition date.
keep_current_billing_cycle, align_to_new_billing_cycle The unique identifier of the subscription transition
The ID of the customer associated with the transition
The ID of the original subscription from which this transition is derived. It references the last active version of the subscription.
The ID of the subscription to transition from
The ID of the subscription to transition to
The current status of the subscription transition. Possible values are 'scheduled', 'completed', 'failed', and 'draft'.
scheduled, completed, failed, draft An optional name for the transition
Whether the transition should be applied 'immediately' or 'scheduled' for a future date.
immediately, scheduled The billing cycle transition method to use. 'keep_current_billing_cycle' will keep the current billing cycle dates if possible. 'align_to_new_billing_cycle' will align the billing cycle to the transition date.
keep_current_billing_cycle, align_to_new_billing_cycle The calculation method to use for the transition. 'do_not_charge' will not generate any transition invoice. 'pro_rata' will generate a prorated invoice for the remaining period.
do_not_charge, pro_rata Was this page helpful?