How to create a subscription with a future start date using a plan and a charge and invoice the charge alone on subscription creation using Hosted page URL?

Modified on: Tue, 23 May, 2023 at 3:11 PM

Scope

How to create a subscription with a future start date using plan and a charge and invoice the charge alone on subscription creation using Hosted page URL?

Solution
Here is our API docs to help you create a subscription using Hosted page URL.

In order to set a future start date, you can use the “subscription[start_date]” parameter and pass the UTC timestamp as the value to it, 

An example of the Hosted page URL with a future start date - 

 https://forxeroonly-test.chargebee.com/hosted_pages/checkout?subscription_items[item_price_id][0]=monthly1-USD-Monthly&subscription_items[item_price_id][1]=charge4-USD&subscription[start_date]=1684192976



Now, the above hosted page URL has 2 line items - 

a) A plan
b) A Charge

In order to invoice the charge on subscription creation itself, you can pass the 
subscription_items[charge_on_event][1]” with the value - “subscription_creation”. The 1 in subscription_items[charge_on_event][1]” indicates that the parameter is applicable to subscription_items[item_price_id][1] (the second line item -the Charge).



Here’s an example URL - 


The hosted page URL that I created in the video - 

https://forxeroonly-test.chargebee.com/hosted_pages/checkout?subscription_items[item_price_id][0]=monthly1-USD-Monthly&subscription_items[item_price_id][1]=charge4-USD&subscription[start_date]=1684192976&subscription_items[charge_on_option][1]=on_event&subscription_items[charge_on_event][1]=subscription_creation



Related articles and Documentation
Hosted pages API


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.
×