Preview new subscription timeline
Preview the billing timeline of a subscription before creating it: from the payload POST /v2/subscriptions takes, its future lifecycle events — activation, renewals and phase changes — in chronological order, each with the invoice document(s) it would issue, plus why the projection stopped. Nothing is created and the customer is not updated. Pass customer to preview it for another customer profile (country, type, tax ID). Amounts are best-effort estimates (metered usage is assumed to be 0), taxed at one rate resolved for the customer. A cancel_at with a charge or refund cancellation_strategy ends the timeline without its closing charge or credit note.
curl --request POST \
--url https://api.hyperline.co/v1/subscriptions/preview-timeline \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscription": {
"customer_id": "cus_QalW2vTAdkR6IY",
"activation_strategy": "start_date",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"catalog_version_id": "pcv_9x8v7u6t5s4r",
"price_configuration_id": "prc_8f3kXODIM1sBwB",
"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": 20,
"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,
"bill_usage_difference": false,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": false,
"credits_balance_auto_creation_enabled": true
}
],
"coupons": [
{
"id": "<string>",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": [
"<string>"
]
}
],
"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,
"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",
"payment_method_id": "pm_abc123",
"bank_account_id": "bac_abc123",
"shipping_address_id": "cad_abc123",
"display_shipping_details": true,
"cancel_at": "2024-12-20T16:04:11Z",
"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,
"invoice_custom_note": "<string>",
"plan_id": "plan_zHmjoDee4ZRmQV",
"template_id": "subt_7gdusOkqr5L0B8",
"template_configuration_id": "subtc_7mHWOlPStUogvp",
"payment_method_strategy": "current",
"available_payment_method_types": [],
"create_setup_phase": true,
"checkout_session": {
"redirect_url": "<string>",
"cancelled_redirect_url": "<string>"
}
},
"customer": {
"country": "DE",
"zip": "10115",
"state": "CA",
"type": "corporate",
"tax_id": "DE811907980"
},
"max_events": 12,
"until": "2024-12-20T16:04:11Z",
"starts_at": "2024-12-20T16:04:11Z"
}
'import requests
url = "https://api.hyperline.co/v1/subscriptions/preview-timeline"
payload = {
"subscription": {
"customer_id": "cus_QalW2vTAdkR6IY",
"activation_strategy": "start_date",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"catalog_version_id": "pcv_9x8v7u6t5s4r",
"price_configuration_id": "prc_8f3kXODIM1sBwB",
"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": None
},
{
"type": "volume",
"from": 20,
"to": None,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": None
}
],
"count": 2,
"unit_name": "user",
"min_committed_count": 2,
"min_amount": 123,
"max_amount": 123,
"bill_usage_difference": False,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": False,
"credits_balance_auto_creation_enabled": True
}
],
"coupons": [
{
"id": "<string>",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": ["<string>"]
}
],
"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,
"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",
"payment_method_id": "pm_abc123",
"bank_account_id": "bac_abc123",
"shipping_address_id": "cad_abc123",
"display_shipping_details": True,
"cancel_at": "2024-12-20T16:04:11Z",
"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,
"invoice_custom_note": "<string>",
"plan_id": "plan_zHmjoDee4ZRmQV",
"template_id": "subt_7gdusOkqr5L0B8",
"template_configuration_id": "subtc_7mHWOlPStUogvp",
"payment_method_strategy": "current",
"available_payment_method_types": [],
"create_setup_phase": True,
"checkout_session": {
"redirect_url": "<string>",
"cancelled_redirect_url": "<string>"
}
},
"customer": {
"country": "DE",
"zip": "10115",
"state": "CA",
"type": "corporate",
"tax_id": "DE811907980"
},
"max_events": 12,
"until": "2024-12-20T16:04:11Z",
"starts_at": "2024-12-20T16:04:11Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscription: {
customer_id: 'cus_QalW2vTAdkR6IY',
activation_strategy: 'start_date',
products: [
{
id: 'itm_FJKlqUb8COXw55',
catalog_version_id: 'pcv_9x8v7u6t5s4r',
price_configuration_id: 'prc_8f3kXODIM1sBwB',
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: 20,
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,
bill_usage_difference: false,
credits_expiration_in_days: 123,
expire_credits_at_end_of_period: false,
credits_balance_auto_creation_enabled: true
}
],
coupons: [
{
id: '<string>',
duration_count: 123,
expires_at: '2024-12-20T16:04:11Z',
apply_at: '2024-12-20T16:04:11Z',
product_ids: ['<string>']
}
],
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,
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',
payment_method_id: 'pm_abc123',
bank_account_id: 'bac_abc123',
shipping_address_id: 'cad_abc123',
display_shipping_details: true,
cancel_at: '2024-12-20T16:04:11Z',
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,
invoice_custom_note: '<string>',
plan_id: 'plan_zHmjoDee4ZRmQV',
template_id: 'subt_7gdusOkqr5L0B8',
template_configuration_id: 'subtc_7mHWOlPStUogvp',
payment_method_strategy: 'current',
available_payment_method_types: [],
create_setup_phase: true,
checkout_session: {redirect_url: '<string>', cancelled_redirect_url: '<string>'}
},
customer: {
country: 'DE',
zip: '10115',
state: 'CA',
type: 'corporate',
tax_id: 'DE811907980'
},
max_events: 12,
until: '2024-12-20T16:04:11Z',
starts_at: '2024-12-20T16:04:11Z'
})
};
fetch('https://api.hyperline.co/v1/subscriptions/preview-timeline', 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.hyperline.co/v1/subscriptions/preview-timeline",
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([
'subscription' => [
'customer_id' => 'cus_QalW2vTAdkR6IY',
'activation_strategy' => 'start_date',
'products' => [
[
'id' => 'itm_FJKlqUb8COXw55',
'catalog_version_id' => 'pcv_9x8v7u6t5s4r',
'price_configuration_id' => 'prc_8f3kXODIM1sBwB',
'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' => 20,
'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,
'bill_usage_difference' => false,
'credits_expiration_in_days' => 123,
'expire_credits_at_end_of_period' => false,
'credits_balance_auto_creation_enabled' => true
]
],
'coupons' => [
[
'id' => '<string>',
'duration_count' => 123,
'expires_at' => '2024-12-20T16:04:11Z',
'apply_at' => '2024-12-20T16:04:11Z',
'product_ids' => [
'<string>'
]
]
],
'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,
'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',
'payment_method_id' => 'pm_abc123',
'bank_account_id' => 'bac_abc123',
'shipping_address_id' => 'cad_abc123',
'display_shipping_details' => true,
'cancel_at' => '2024-12-20T16:04:11Z',
'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,
'invoice_custom_note' => '<string>',
'plan_id' => 'plan_zHmjoDee4ZRmQV',
'template_id' => 'subt_7gdusOkqr5L0B8',
'template_configuration_id' => 'subtc_7mHWOlPStUogvp',
'payment_method_strategy' => 'current',
'available_payment_method_types' => [
],
'create_setup_phase' => true,
'checkout_session' => [
'redirect_url' => '<string>',
'cancelled_redirect_url' => '<string>'
]
],
'customer' => [
'country' => 'DE',
'zip' => '10115',
'state' => 'CA',
'type' => 'corporate',
'tax_id' => 'DE811907980'
],
'max_events' => 12,
'until' => '2024-12-20T16:04:11Z',
'starts_at' => '2024-12-20T16:04:11Z'
]),
CURLOPT_HTTPHEADER => [
"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.hyperline.co/v1/subscriptions/preview-timeline"
payload := strings.NewReader("{\n \"subscription\": {\n \"customer_id\": \"cus_QalW2vTAdkR6IY\",\n \"activation_strategy\": \"start_date\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"catalog_version_id\": \"pcv_9x8v7u6t5s4r\",\n \"price_configuration_id\": \"prc_8f3kXODIM1sBwB\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false,\n \"credits_balance_auto_creation_enabled\": true\n }\n ],\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\",\n \"purchase_order\": \"<string>\",\n \"invoicing_entity_id\": \"ive_jerrb484RHn\",\n \"crm_opportunity_id\": \"<string>\",\n \"commitment_interval\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"renew_automatically\": true,\n \"renew_for\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"minimum_invoice_fee\": 250,\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"contract_start\": \"2024-01-15T00:00:00Z\",\n \"contract_end\": \"2025-01-15T00:00:00Z\",\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"payment_method_id\": \"pm_abc123\",\n \"bank_account_id\": \"bac_abc123\",\n \"shipping_address_id\": \"cad_abc123\",\n \"display_shipping_details\": true,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"cancellation_amount\": 123,\n \"properties\": {},\n \"custom_properties\": {},\n \"tax_only\": true,\n \"generate_draft_invoices\": true,\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"do_not_charge_subscription\": true,\n \"invoice_custom_note\": \"<string>\",\n \"plan_id\": \"plan_zHmjoDee4ZRmQV\",\n \"template_id\": \"subt_7gdusOkqr5L0B8\",\n \"template_configuration_id\": \"subtc_7mHWOlPStUogvp\",\n \"payment_method_strategy\": \"current\",\n \"available_payment_method_types\": [],\n \"create_setup_phase\": true,\n \"checkout_session\": {\n \"redirect_url\": \"<string>\",\n \"cancelled_redirect_url\": \"<string>\"\n }\n },\n \"customer\": {\n \"country\": \"DE\",\n \"zip\": \"10115\",\n \"state\": \"CA\",\n \"type\": \"corporate\",\n \"tax_id\": \"DE811907980\"\n },\n \"max_events\": 12,\n \"until\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.hyperline.co/v1/subscriptions/preview-timeline")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subscription\": {\n \"customer_id\": \"cus_QalW2vTAdkR6IY\",\n \"activation_strategy\": \"start_date\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"catalog_version_id\": \"pcv_9x8v7u6t5s4r\",\n \"price_configuration_id\": \"prc_8f3kXODIM1sBwB\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false,\n \"credits_balance_auto_creation_enabled\": true\n }\n ],\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\",\n \"purchase_order\": \"<string>\",\n \"invoicing_entity_id\": \"ive_jerrb484RHn\",\n \"crm_opportunity_id\": \"<string>\",\n \"commitment_interval\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"renew_automatically\": true,\n \"renew_for\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"minimum_invoice_fee\": 250,\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"contract_start\": \"2024-01-15T00:00:00Z\",\n \"contract_end\": \"2025-01-15T00:00:00Z\",\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"payment_method_id\": \"pm_abc123\",\n \"bank_account_id\": \"bac_abc123\",\n \"shipping_address_id\": \"cad_abc123\",\n \"display_shipping_details\": true,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"cancellation_amount\": 123,\n \"properties\": {},\n \"custom_properties\": {},\n \"tax_only\": true,\n \"generate_draft_invoices\": true,\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"do_not_charge_subscription\": true,\n \"invoice_custom_note\": \"<string>\",\n \"plan_id\": \"plan_zHmjoDee4ZRmQV\",\n \"template_id\": \"subt_7gdusOkqr5L0B8\",\n \"template_configuration_id\": \"subtc_7mHWOlPStUogvp\",\n \"payment_method_strategy\": \"current\",\n \"available_payment_method_types\": [],\n \"create_setup_phase\": true,\n \"checkout_session\": {\n \"redirect_url\": \"<string>\",\n \"cancelled_redirect_url\": \"<string>\"\n }\n },\n \"customer\": {\n \"country\": \"DE\",\n \"zip\": \"10115\",\n \"state\": \"CA\",\n \"type\": \"corporate\",\n \"tax_id\": \"DE811907980\"\n },\n \"max_events\": 12,\n \"until\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/subscriptions/preview-timeline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscription\": {\n \"customer_id\": \"cus_QalW2vTAdkR6IY\",\n \"activation_strategy\": \"start_date\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"catalog_version_id\": \"pcv_9x8v7u6t5s4r\",\n \"price_configuration_id\": \"prc_8f3kXODIM1sBwB\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false,\n \"credits_balance_auto_creation_enabled\": true\n }\n ],\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\",\n \"purchase_order\": \"<string>\",\n \"invoicing_entity_id\": \"ive_jerrb484RHn\",\n \"crm_opportunity_id\": \"<string>\",\n \"commitment_interval\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"renew_automatically\": true,\n \"renew_for\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"minimum_invoice_fee\": 250,\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"contract_start\": \"2024-01-15T00:00:00Z\",\n \"contract_end\": \"2025-01-15T00:00:00Z\",\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"payment_method_id\": \"pm_abc123\",\n \"bank_account_id\": \"bac_abc123\",\n \"shipping_address_id\": \"cad_abc123\",\n \"display_shipping_details\": true,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"cancellation_amount\": 123,\n \"properties\": {},\n \"custom_properties\": {},\n \"tax_only\": true,\n \"generate_draft_invoices\": true,\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"do_not_charge_subscription\": true,\n \"invoice_custom_note\": \"<string>\",\n \"plan_id\": \"plan_zHmjoDee4ZRmQV\",\n \"template_id\": \"subt_7gdusOkqr5L0B8\",\n \"template_configuration_id\": \"subtc_7mHWOlPStUogvp\",\n \"payment_method_strategy\": \"current\",\n \"available_payment_method_types\": [],\n \"create_setup_phase\": true,\n \"checkout_session\": {\n \"redirect_url\": \"<string>\",\n \"cancelled_redirect_url\": \"<string>\"\n }\n },\n \"customer\": {\n \"country\": \"DE\",\n \"zip\": \"10115\",\n \"state\": \"CA\",\n \"type\": \"corporate\",\n \"tax_id\": \"DE811907980\"\n },\n \"max_events\": 12,\n \"until\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\"\n}"
response = http.request(request)
puts response.read_body{
"events": [
{
"type": "activation",
"date": "2024-12-20T16:04:11Z",
"invoices": [
{
"id": "inv_1eTaiytfA0i2Va",
"number": "INV-35",
"type": "invoice",
"document_name": null,
"status": "paid",
"reference": "V0KAHOU6J3",
"purchase_order": "PO-12345",
"currency": "EUR",
"source": "hyperline",
"origin": "subscription",
"total_amount": 24000,
"amount_due": 0,
"amount_paid": 24000,
"amount_fixed": 20000,
"amount_excluding_tax": 20000,
"tax_rate": 123,
"tax_amount": 4000,
"tax_scheme": "standard",
"discount_amount": 0,
"conversion_rate": 1,
"converted_amount": 24000,
"converted_at": "2026-10-13T02:00:00.000Z",
"payment_method_id": "pm_1ryTrMj4TTAT1N",
"bank_account_id": "bac_KJyPrMA1toAqRG",
"custom_note": "Thank you for your purchase!",
"additional_info": "This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.",
"footer": "ACME (Acme SAS) is a company registered in France | SIREN N°123456",
"customer": {
"id": "cus_Typ0px2W0aiEtl",
"name": "Acme",
"email": "billing@acme.com",
"external_id": null,
"vat_number": "<string>",
"tax_id": "FR123456789",
"local_tax_number": "12/345/67890",
"registration_number": "36252187900034",
"address": {
"name": "Acme",
"line1": "5 rue de Paradis",
"line2": null,
"city": "Paris",
"zip": "75010",
"state": "CA",
"country": "FR"
}
},
"seller": {
"id": "ive_47484fjdhy5",
"name": "Name of the invoicing entity",
"tax_id": "FR5878986578",
"registration_number": "87898657800016",
"address": {
"name": "Acme",
"line1": "5 rue de Paradis",
"line2": null,
"city": "Paris",
"zip": "75010",
"state": "CA",
"country": "FR"
}
},
"subscription_id": "sub_amiaWZ3lzDIWaoT",
"period_starts_at": "2026-10-13T00:00:00.000Z",
"period_ends_at": "2026-11-13T00:00:00.000Z",
"emitted_at": "2026-10-13T00:00:00.000Z",
"due_at": "2026-11-12T00:00:00.000Z",
"issuing_method": "manual",
"refunded_at": null,
"grace_period_ended_at": null,
"settled_at": "2026-10-15T14:01:56.000Z",
"created_at": "2026-10-12T09:30:00.000Z",
"updated_at": "2026-10-15T14:01:56.000Z",
"properties": null,
"custom_properties": null,
"additional_display_fields": null,
"original_invoice_id": null,
"original_invoice_number": null,
"line_items": [
{
"id": "ili_0FACNpeoEFkGu3",
"name": "Platform access",
"entry_type": "debit",
"product_id": "itm_KbLcWt2qm5p1S2",
"price_configuration_id": "pcf_monthly",
"product_type": "flat_fee",
"units_count": 1,
"unit_amount": 24000,
"amount": 24000,
"amount_excluding_tax": 20000,
"tax_rate": 20,
"tax_rate_id": null,
"tax_amount": 4000,
"discount_amount": 0,
"discount_percent": 123,
"period_starts_at": "2026-10-13T00:00:00.000Z",
"period_ends_at": "2026-11-13T00:00:00.000Z",
"revenue_type": "recurring",
"revenue_interval_count": 1,
"revenue_interval_period": "months",
"display_unit_amount": true,
"display_service_period": true,
"subscription_id": "sub_amiaWZ3lzDIWaoT",
"original_line_item_id": null
}
],
"coupons": [
{
"id": "cou_DKL4Xcb5VSa8CQ",
"name": "Partner discount",
"subscription_coupon_id": "coos_d9pVekhjoGppuX",
"discount_amount": 2000,
"discount_percent": null,
"line_item_ids": [
"ili_0FACNpeoEFkGu3"
]
}
],
"transactions": [
{
"id": "tra_2QdJDDUej969ev",
"type": "subscription",
"amount": 31500,
"currency": "EUR",
"customer_id": "cus_QalW2vTAdkR6IY",
"provider_id": "<string>",
"process_at": "2024-11-12T07:38:39.222Z",
"settled_at": "2024-11-12T07:38:39.222Z",
"created_at": "2026-11-12T10:00:00.000Z",
"updated_at": "2026-11-12T11:00:00.000Z",
"refunded_at": null,
"original_transaction_id": null,
"reversed_at": null,
"last_refreshed_at": null,
"provider_fee": null,
"chargeback": null,
"integrations": [
{
"entity_id": "123456789",
"provider_name": "stripe",
"provider_account_id": "acc_1234567890"
}
],
"payment_method_type": "card",
"payment_method": {
"id": "pm_1xMpj5bwRqN7LM",
"status": "active",
"type": "card",
"last_4_digits": 2718,
"expiration_date": "2027-11",
"brand": "visa"
},
"status": "settled"
}
],
"public_url": "<string>",
"integrations": [
{
"entity_id": "123456789",
"provider_name": "stripe",
"provider_account_id": "acc_1234567890"
}
],
"allocations": [
{
"invoice_id": "inv_2QdJDDUej969ev",
"amount": 780000
}
]
}
]
}
],
"stopped_because": {
"kind": "bounded"
}
}{
"message": "<string>"
}Authorizations
Body
Not subscription.starts_at: the instant to assume the subscription starts when it would wait for an activation event (a manual activation, checkout, quote signature, or a manually-started contract). Ignored when the subscription has a start date.
"2024-12-20T16:04:11Z"
Response
Projected timeline of the subscription.
Was this page helpful?
curl --request POST \
--url https://api.hyperline.co/v1/subscriptions/preview-timeline \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"subscription": {
"customer_id": "cus_QalW2vTAdkR6IY",
"activation_strategy": "start_date",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"catalog_version_id": "pcv_9x8v7u6t5s4r",
"price_configuration_id": "prc_8f3kXODIM1sBwB",
"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": 20,
"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,
"bill_usage_difference": false,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": false,
"credits_balance_auto_creation_enabled": true
}
],
"coupons": [
{
"id": "<string>",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": [
"<string>"
]
}
],
"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,
"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",
"payment_method_id": "pm_abc123",
"bank_account_id": "bac_abc123",
"shipping_address_id": "cad_abc123",
"display_shipping_details": true,
"cancel_at": "2024-12-20T16:04:11Z",
"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,
"invoice_custom_note": "<string>",
"plan_id": "plan_zHmjoDee4ZRmQV",
"template_id": "subt_7gdusOkqr5L0B8",
"template_configuration_id": "subtc_7mHWOlPStUogvp",
"payment_method_strategy": "current",
"available_payment_method_types": [],
"create_setup_phase": true,
"checkout_session": {
"redirect_url": "<string>",
"cancelled_redirect_url": "<string>"
}
},
"customer": {
"country": "DE",
"zip": "10115",
"state": "CA",
"type": "corporate",
"tax_id": "DE811907980"
},
"max_events": 12,
"until": "2024-12-20T16:04:11Z",
"starts_at": "2024-12-20T16:04:11Z"
}
'import requests
url = "https://api.hyperline.co/v1/subscriptions/preview-timeline"
payload = {
"subscription": {
"customer_id": "cus_QalW2vTAdkR6IY",
"activation_strategy": "start_date",
"products": [
{
"id": "itm_FJKlqUb8COXw55",
"catalog_version_id": "pcv_9x8v7u6t5s4r",
"price_configuration_id": "prc_8f3kXODIM1sBwB",
"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": None
},
{
"type": "volume",
"from": 20,
"to": None,
"amount": 150,
"unit_count": 1,
"on_tier_incomplete": None
}
],
"count": 2,
"unit_name": "user",
"min_committed_count": 2,
"min_amount": 123,
"max_amount": 123,
"bill_usage_difference": False,
"credits_expiration_in_days": 123,
"expire_credits_at_end_of_period": False,
"credits_balance_auto_creation_enabled": True
}
],
"coupons": [
{
"id": "<string>",
"duration_count": 123,
"expires_at": "2024-12-20T16:04:11Z",
"apply_at": "2024-12-20T16:04:11Z",
"product_ids": ["<string>"]
}
],
"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,
"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",
"payment_method_id": "pm_abc123",
"bank_account_id": "bac_abc123",
"shipping_address_id": "cad_abc123",
"display_shipping_details": True,
"cancel_at": "2024-12-20T16:04:11Z",
"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,
"invoice_custom_note": "<string>",
"plan_id": "plan_zHmjoDee4ZRmQV",
"template_id": "subt_7gdusOkqr5L0B8",
"template_configuration_id": "subtc_7mHWOlPStUogvp",
"payment_method_strategy": "current",
"available_payment_method_types": [],
"create_setup_phase": True,
"checkout_session": {
"redirect_url": "<string>",
"cancelled_redirect_url": "<string>"
}
},
"customer": {
"country": "DE",
"zip": "10115",
"state": "CA",
"type": "corporate",
"tax_id": "DE811907980"
},
"max_events": 12,
"until": "2024-12-20T16:04:11Z",
"starts_at": "2024-12-20T16:04:11Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscription: {
customer_id: 'cus_QalW2vTAdkR6IY',
activation_strategy: 'start_date',
products: [
{
id: 'itm_FJKlqUb8COXw55',
catalog_version_id: 'pcv_9x8v7u6t5s4r',
price_configuration_id: 'prc_8f3kXODIM1sBwB',
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: 20,
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,
bill_usage_difference: false,
credits_expiration_in_days: 123,
expire_credits_at_end_of_period: false,
credits_balance_auto_creation_enabled: true
}
],
coupons: [
{
id: '<string>',
duration_count: 123,
expires_at: '2024-12-20T16:04:11Z',
apply_at: '2024-12-20T16:04:11Z',
product_ids: ['<string>']
}
],
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,
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',
payment_method_id: 'pm_abc123',
bank_account_id: 'bac_abc123',
shipping_address_id: 'cad_abc123',
display_shipping_details: true,
cancel_at: '2024-12-20T16:04:11Z',
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,
invoice_custom_note: '<string>',
plan_id: 'plan_zHmjoDee4ZRmQV',
template_id: 'subt_7gdusOkqr5L0B8',
template_configuration_id: 'subtc_7mHWOlPStUogvp',
payment_method_strategy: 'current',
available_payment_method_types: [],
create_setup_phase: true,
checkout_session: {redirect_url: '<string>', cancelled_redirect_url: '<string>'}
},
customer: {
country: 'DE',
zip: '10115',
state: 'CA',
type: 'corporate',
tax_id: 'DE811907980'
},
max_events: 12,
until: '2024-12-20T16:04:11Z',
starts_at: '2024-12-20T16:04:11Z'
})
};
fetch('https://api.hyperline.co/v1/subscriptions/preview-timeline', 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.hyperline.co/v1/subscriptions/preview-timeline",
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([
'subscription' => [
'customer_id' => 'cus_QalW2vTAdkR6IY',
'activation_strategy' => 'start_date',
'products' => [
[
'id' => 'itm_FJKlqUb8COXw55',
'catalog_version_id' => 'pcv_9x8v7u6t5s4r',
'price_configuration_id' => 'prc_8f3kXODIM1sBwB',
'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' => 20,
'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,
'bill_usage_difference' => false,
'credits_expiration_in_days' => 123,
'expire_credits_at_end_of_period' => false,
'credits_balance_auto_creation_enabled' => true
]
],
'coupons' => [
[
'id' => '<string>',
'duration_count' => 123,
'expires_at' => '2024-12-20T16:04:11Z',
'apply_at' => '2024-12-20T16:04:11Z',
'product_ids' => [
'<string>'
]
]
],
'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,
'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',
'payment_method_id' => 'pm_abc123',
'bank_account_id' => 'bac_abc123',
'shipping_address_id' => 'cad_abc123',
'display_shipping_details' => true,
'cancel_at' => '2024-12-20T16:04:11Z',
'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,
'invoice_custom_note' => '<string>',
'plan_id' => 'plan_zHmjoDee4ZRmQV',
'template_id' => 'subt_7gdusOkqr5L0B8',
'template_configuration_id' => 'subtc_7mHWOlPStUogvp',
'payment_method_strategy' => 'current',
'available_payment_method_types' => [
],
'create_setup_phase' => true,
'checkout_session' => [
'redirect_url' => '<string>',
'cancelled_redirect_url' => '<string>'
]
],
'customer' => [
'country' => 'DE',
'zip' => '10115',
'state' => 'CA',
'type' => 'corporate',
'tax_id' => 'DE811907980'
],
'max_events' => 12,
'until' => '2024-12-20T16:04:11Z',
'starts_at' => '2024-12-20T16:04:11Z'
]),
CURLOPT_HTTPHEADER => [
"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.hyperline.co/v1/subscriptions/preview-timeline"
payload := strings.NewReader("{\n \"subscription\": {\n \"customer_id\": \"cus_QalW2vTAdkR6IY\",\n \"activation_strategy\": \"start_date\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"catalog_version_id\": \"pcv_9x8v7u6t5s4r\",\n \"price_configuration_id\": \"prc_8f3kXODIM1sBwB\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false,\n \"credits_balance_auto_creation_enabled\": true\n }\n ],\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\",\n \"purchase_order\": \"<string>\",\n \"invoicing_entity_id\": \"ive_jerrb484RHn\",\n \"crm_opportunity_id\": \"<string>\",\n \"commitment_interval\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"renew_automatically\": true,\n \"renew_for\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"minimum_invoice_fee\": 250,\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"contract_start\": \"2024-01-15T00:00:00Z\",\n \"contract_end\": \"2025-01-15T00:00:00Z\",\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"payment_method_id\": \"pm_abc123\",\n \"bank_account_id\": \"bac_abc123\",\n \"shipping_address_id\": \"cad_abc123\",\n \"display_shipping_details\": true,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"cancellation_amount\": 123,\n \"properties\": {},\n \"custom_properties\": {},\n \"tax_only\": true,\n \"generate_draft_invoices\": true,\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"do_not_charge_subscription\": true,\n \"invoice_custom_note\": \"<string>\",\n \"plan_id\": \"plan_zHmjoDee4ZRmQV\",\n \"template_id\": \"subt_7gdusOkqr5L0B8\",\n \"template_configuration_id\": \"subtc_7mHWOlPStUogvp\",\n \"payment_method_strategy\": \"current\",\n \"available_payment_method_types\": [],\n \"create_setup_phase\": true,\n \"checkout_session\": {\n \"redirect_url\": \"<string>\",\n \"cancelled_redirect_url\": \"<string>\"\n }\n },\n \"customer\": {\n \"country\": \"DE\",\n \"zip\": \"10115\",\n \"state\": \"CA\",\n \"type\": \"corporate\",\n \"tax_id\": \"DE811907980\"\n },\n \"max_events\": 12,\n \"until\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.hyperline.co/v1/subscriptions/preview-timeline")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"subscription\": {\n \"customer_id\": \"cus_QalW2vTAdkR6IY\",\n \"activation_strategy\": \"start_date\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"catalog_version_id\": \"pcv_9x8v7u6t5s4r\",\n \"price_configuration_id\": \"prc_8f3kXODIM1sBwB\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false,\n \"credits_balance_auto_creation_enabled\": true\n }\n ],\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\",\n \"purchase_order\": \"<string>\",\n \"invoicing_entity_id\": \"ive_jerrb484RHn\",\n \"crm_opportunity_id\": \"<string>\",\n \"commitment_interval\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"renew_automatically\": true,\n \"renew_for\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"minimum_invoice_fee\": 250,\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"contract_start\": \"2024-01-15T00:00:00Z\",\n \"contract_end\": \"2025-01-15T00:00:00Z\",\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"payment_method_id\": \"pm_abc123\",\n \"bank_account_id\": \"bac_abc123\",\n \"shipping_address_id\": \"cad_abc123\",\n \"display_shipping_details\": true,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"cancellation_amount\": 123,\n \"properties\": {},\n \"custom_properties\": {},\n \"tax_only\": true,\n \"generate_draft_invoices\": true,\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"do_not_charge_subscription\": true,\n \"invoice_custom_note\": \"<string>\",\n \"plan_id\": \"plan_zHmjoDee4ZRmQV\",\n \"template_id\": \"subt_7gdusOkqr5L0B8\",\n \"template_configuration_id\": \"subtc_7mHWOlPStUogvp\",\n \"payment_method_strategy\": \"current\",\n \"available_payment_method_types\": [],\n \"create_setup_phase\": true,\n \"checkout_session\": {\n \"redirect_url\": \"<string>\",\n \"cancelled_redirect_url\": \"<string>\"\n }\n },\n \"customer\": {\n \"country\": \"DE\",\n \"zip\": \"10115\",\n \"state\": \"CA\",\n \"type\": \"corporate\",\n \"tax_id\": \"DE811907980\"\n },\n \"max_events\": 12,\n \"until\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hyperline.co/v1/subscriptions/preview-timeline")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscription\": {\n \"customer_id\": \"cus_QalW2vTAdkR6IY\",\n \"activation_strategy\": \"start_date\",\n \"products\": [\n {\n \"id\": \"itm_FJKlqUb8COXw55\",\n \"catalog_version_id\": \"pcv_9x8v7u6t5s4r\",\n \"price_configuration_id\": \"prc_8f3kXODIM1sBwB\",\n \"name\": \"Product name\",\n \"description\": \"A description of the product.\",\n \"description_display_interval_dates\": false,\n \"payment_interval\": {\n \"period\": \"once\"\n },\n \"payment_schedule\": \"start\",\n \"price\": {\n \"type\": \"fee\",\n \"amount\": 200\n },\n \"prices\": [\n {\n \"type\": \"volume\",\n \"from\": 0,\n \"to\": 20,\n \"amount\": 200,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n },\n {\n \"type\": \"volume\",\n \"from\": 20,\n \"to\": null,\n \"amount\": 150,\n \"unit_count\": 1,\n \"on_tier_incomplete\": null\n }\n ],\n \"count\": 2,\n \"unit_name\": \"user\",\n \"min_committed_count\": 2,\n \"min_amount\": 123,\n \"max_amount\": 123,\n \"bill_usage_difference\": false,\n \"credits_expiration_in_days\": 123,\n \"expire_credits_at_end_of_period\": false,\n \"credits_balance_auto_creation_enabled\": true\n }\n ],\n \"coupons\": [\n {\n \"id\": \"<string>\",\n \"duration_count\": 123,\n \"expires_at\": \"2024-12-20T16:04:11Z\",\n \"apply_at\": \"2024-12-20T16:04:11Z\",\n \"product_ids\": [\n \"<string>\"\n ]\n }\n ],\n \"name\": \"<string>\",\n \"purchase_order\": \"<string>\",\n \"invoicing_entity_id\": \"ive_jerrb484RHn\",\n \"crm_opportunity_id\": \"<string>\",\n \"commitment_interval\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"renew_automatically\": true,\n \"renew_for\": {\n \"period\": \"years\",\n \"count\": 1\n },\n \"minimum_invoice_fee\": 250,\n \"starts_at\": \"2024-12-20T16:04:11Z\",\n \"contract_start\": \"2024-01-15T00:00:00Z\",\n \"contract_end\": \"2025-01-15T00:00:00Z\",\n \"initial_billing_at\": \"2024-12-20T16:04:11Z\",\n \"payment_method_id\": \"pm_abc123\",\n \"bank_account_id\": \"bac_abc123\",\n \"shipping_address_id\": \"cad_abc123\",\n \"display_shipping_details\": true,\n \"cancel_at\": \"2024-12-20T16:04:11Z\",\n \"cancellation_amount\": 123,\n \"properties\": {},\n \"custom_properties\": {},\n \"tax_only\": true,\n \"generate_draft_invoices\": true,\n \"generate_document\": true,\n \"document_name\": \"<string>\",\n \"add_tax_to_document\": true,\n \"do_not_charge_subscription\": true,\n \"invoice_custom_note\": \"<string>\",\n \"plan_id\": \"plan_zHmjoDee4ZRmQV\",\n \"template_id\": \"subt_7gdusOkqr5L0B8\",\n \"template_configuration_id\": \"subtc_7mHWOlPStUogvp\",\n \"payment_method_strategy\": \"current\",\n \"available_payment_method_types\": [],\n \"create_setup_phase\": true,\n \"checkout_session\": {\n \"redirect_url\": \"<string>\",\n \"cancelled_redirect_url\": \"<string>\"\n }\n },\n \"customer\": {\n \"country\": \"DE\",\n \"zip\": \"10115\",\n \"state\": \"CA\",\n \"type\": \"corporate\",\n \"tax_id\": \"DE811907980\"\n },\n \"max_events\": 12,\n \"until\": \"2024-12-20T16:04:11Z\",\n \"starts_at\": \"2024-12-20T16:04:11Z\"\n}"
response = http.request(request)
puts response.read_body{
"events": [
{
"type": "activation",
"date": "2024-12-20T16:04:11Z",
"invoices": [
{
"id": "inv_1eTaiytfA0i2Va",
"number": "INV-35",
"type": "invoice",
"document_name": null,
"status": "paid",
"reference": "V0KAHOU6J3",
"purchase_order": "PO-12345",
"currency": "EUR",
"source": "hyperline",
"origin": "subscription",
"total_amount": 24000,
"amount_due": 0,
"amount_paid": 24000,
"amount_fixed": 20000,
"amount_excluding_tax": 20000,
"tax_rate": 123,
"tax_amount": 4000,
"tax_scheme": "standard",
"discount_amount": 0,
"conversion_rate": 1,
"converted_amount": 24000,
"converted_at": "2026-10-13T02:00:00.000Z",
"payment_method_id": "pm_1ryTrMj4TTAT1N",
"bank_account_id": "bac_KJyPrMA1toAqRG",
"custom_note": "Thank you for your purchase!",
"additional_info": "This invoice must be paid within the payment delay indicated. After this period a late payment penalty of 10% will be applied.",
"footer": "ACME (Acme SAS) is a company registered in France | SIREN N°123456",
"customer": {
"id": "cus_Typ0px2W0aiEtl",
"name": "Acme",
"email": "billing@acme.com",
"external_id": null,
"vat_number": "<string>",
"tax_id": "FR123456789",
"local_tax_number": "12/345/67890",
"registration_number": "36252187900034",
"address": {
"name": "Acme",
"line1": "5 rue de Paradis",
"line2": null,
"city": "Paris",
"zip": "75010",
"state": "CA",
"country": "FR"
}
},
"seller": {
"id": "ive_47484fjdhy5",
"name": "Name of the invoicing entity",
"tax_id": "FR5878986578",
"registration_number": "87898657800016",
"address": {
"name": "Acme",
"line1": "5 rue de Paradis",
"line2": null,
"city": "Paris",
"zip": "75010",
"state": "CA",
"country": "FR"
}
},
"subscription_id": "sub_amiaWZ3lzDIWaoT",
"period_starts_at": "2026-10-13T00:00:00.000Z",
"period_ends_at": "2026-11-13T00:00:00.000Z",
"emitted_at": "2026-10-13T00:00:00.000Z",
"due_at": "2026-11-12T00:00:00.000Z",
"issuing_method": "manual",
"refunded_at": null,
"grace_period_ended_at": null,
"settled_at": "2026-10-15T14:01:56.000Z",
"created_at": "2026-10-12T09:30:00.000Z",
"updated_at": "2026-10-15T14:01:56.000Z",
"properties": null,
"custom_properties": null,
"additional_display_fields": null,
"original_invoice_id": null,
"original_invoice_number": null,
"line_items": [
{
"id": "ili_0FACNpeoEFkGu3",
"name": "Platform access",
"entry_type": "debit",
"product_id": "itm_KbLcWt2qm5p1S2",
"price_configuration_id": "pcf_monthly",
"product_type": "flat_fee",
"units_count": 1,
"unit_amount": 24000,
"amount": 24000,
"amount_excluding_tax": 20000,
"tax_rate": 20,
"tax_rate_id": null,
"tax_amount": 4000,
"discount_amount": 0,
"discount_percent": 123,
"period_starts_at": "2026-10-13T00:00:00.000Z",
"period_ends_at": "2026-11-13T00:00:00.000Z",
"revenue_type": "recurring",
"revenue_interval_count": 1,
"revenue_interval_period": "months",
"display_unit_amount": true,
"display_service_period": true,
"subscription_id": "sub_amiaWZ3lzDIWaoT",
"original_line_item_id": null
}
],
"coupons": [
{
"id": "cou_DKL4Xcb5VSa8CQ",
"name": "Partner discount",
"subscription_coupon_id": "coos_d9pVekhjoGppuX",
"discount_amount": 2000,
"discount_percent": null,
"line_item_ids": [
"ili_0FACNpeoEFkGu3"
]
}
],
"transactions": [
{
"id": "tra_2QdJDDUej969ev",
"type": "subscription",
"amount": 31500,
"currency": "EUR",
"customer_id": "cus_QalW2vTAdkR6IY",
"provider_id": "<string>",
"process_at": "2024-11-12T07:38:39.222Z",
"settled_at": "2024-11-12T07:38:39.222Z",
"created_at": "2026-11-12T10:00:00.000Z",
"updated_at": "2026-11-12T11:00:00.000Z",
"refunded_at": null,
"original_transaction_id": null,
"reversed_at": null,
"last_refreshed_at": null,
"provider_fee": null,
"chargeback": null,
"integrations": [
{
"entity_id": "123456789",
"provider_name": "stripe",
"provider_account_id": "acc_1234567890"
}
],
"payment_method_type": "card",
"payment_method": {
"id": "pm_1xMpj5bwRqN7LM",
"status": "active",
"type": "card",
"last_4_digits": 2718,
"expiration_date": "2027-11",
"brand": "visa"
},
"status": "settled"
}
],
"public_url": "<string>",
"integrations": [
{
"entity_id": "123456789",
"provider_name": "stripe",
"provider_account_id": "acc_1234567890"
}
],
"allocations": [
{
"invoice_id": "inv_2QdJDDUej969ev",
"amount": 780000
}
]
}
]
}
],
"stopped_because": {
"kind": "bounded"
}
}{
"message": "<string>"
}
