Start a new topic

`Next billing at` not working

Hey there. We using your api to create a subscription. I tried to change next billing at field and it's not working for me.


My timestamp was "1506604080". Here is a code sample.


if price:
subscription = chargebee.Subscription.create_for_customer(customer_id, {
"plan_id" : plan_id,
"plan_unit_price": int(price) * 100,
"cf_order_number": order.id,
"cf_customer_number": company.id,
"next_billing_at": int(next_billing_at.strftime('%s'))
}).subscription
else:
subscription = chargebee.Subscription.create_for_customer(customer_id, {
"plan_id": plan_id,
"cf_order_number": order.id,
"cf_customer_number": company.id,
"next_billing_at": int(next_billing_at.strftime('%s'))
}).subscription



Hi there


The next_billing_at is not available as an input parameter while creating the subscription. You'll receive this parameter in the response which mentions the renewal date of the subscriptions. Note that the renewal dates can be changed only after creating the subscription and not upon creating. You can use the Change Term End API to change the renewal date after creating the subscription.


Any reason why you'd like to change the next billing date while creating the subscriptions? If you're looking to align all the subscriptions of your site to renew on a common billing date, you can use our Calendar Billing feature.

What we need to do is set the subscription start date to any date in future. Just like you can do it in Chargebee dashboard when creating a subscription. 


When you create new subscription via dashboard, you can set the start date. Or if start date is blank, system will take “today’s” date. 


So, we need to do the same thing - provide the start date via API.

While using the create subscription API, you can pass the future date along with the start_date parameter.

Login or Signup to post a comment