Start a new topic
Answered

Hosted pages passthru content all the way to the webhook

- I want to use a hosted checkout page to let the user signup.

- I then want to use the webhook subscription_created to associate the Chargebee subscription with the user's account on my end.


Right now, to do this, it seems, I have to create the customer object in Chargebee manually, then store the Chargebee customer id in my database, then when I am receiving the webhook, I can look up the customer id in my database and activiate the subscription.


If the subscription_created event were to contain the id of the hosted page used to create the subscription, this would be much simpler; at this point, I can just use my own customer id as passthrough content, and when I receive the webhook, fetch the hosted page, and get the customer id on my side.


Best Answer

Hey Michael, 


From my understanding, the customer would already have an account at your end, with a customer ID, and their subscription would be activated post signup. Please correct me if that isn't the case. 


If this is the scenario, you can actually pass their customer ID directly to the hosted page so that their customer ID in Chargebee is the same as your own customer ID. To do this, please include the parameter customer[id]=<customer_id> along with the hosted pages URL. 


In this case, the Subscription Created webhook returned could be used to activate their subscription on your end, as it would also have the customer ID which will be same as the one in your end, enabling you to associate easily. 


Let me know if this helps. 


Answer

Hey Michael, 


From my understanding, the customer would already have an account at your end, with a customer ID, and their subscription would be activated post signup. Please correct me if that isn't the case. 


If this is the scenario, you can actually pass their customer ID directly to the hosted page so that their customer ID in Chargebee is the same as your own customer ID. To do this, please include the parameter customer[id]=<customer_id> along with the hosted pages URL. 


In this case, the Subscription Created webhook returned could be used to activate their subscription on your end, as it would also have the customer ID which will be same as the one in your end, enabling you to associate easily. 


Let me know if this helps. 

Thanks! It's a fair enough approach that I didn't think of.

Login or Signup to post a comment