Answered

additional data for plan

I would like to add additional json data to a plan, so that our application can read this data during a webhook event. This data should not be visible in the customer portal. Is this possible?


Best Answer


@Christian,


We've released support for adding JSON content to different objects in Chargebee. You can use this to add JSON data to your plans.


Here's more on that: https://apidocs.chargebee.com/docs/api#meta_data


Please try it out and let us know if you have questions.


Hey Christian,


We're currently working on supporting json data addition to a plan/subscription. This will be released in the next couple of weeks and we'll keep you updated on the same. 

Thanks.

Answer


@Christian,


We've released support for adding JSON content to different objects in Chargebee. You can use this to add JSON data to your plans.


Here's more on that: https://apidocs.chargebee.com/docs/api#meta_data


Please try it out and let us know if you have questions.

Hi all,


I'm trying to use the meta_data field both in the customer and in the subscription object, but I can't make it work.


I'm using a hosted page embedded in my webpage. First I use checkout_new to get the hosted page id and that's when I provide the options for the subscription (and the customer), including the meta_data field. Everything goes well after the subscription is submitted in the hosted page, I even get redirected to the correct page, though when I check the customer details and the subscription details, there's no meta data there. I even tried to make the content of the field a string. Doesn't work either.

Attached are some screenshots.


I wonder if anyone can help me.


Thanks!

Sara

Hey Sara, 


Unfortunately, there is no option to pass meta data as a parameter when using hosted page APIs. However, you could use the hidden custom fields at the customer/subscription level or use the pass_thru_content parameter to pass the meta data to the hosted pages. 


Kindly let us know if you’ve any queries.


1 person likes this

Ok, thanks for the insight! 


I've managed to make it work for the customer using the custom fields, but not for the subscription, where I'm doing exactly the same thing.


Any ideas of what can be happening?


Thanks!

Hey there,


Appologies for missing your message.


To pass the subscription level custom fields with the checkout page URLs, you can use this format : https://domain.chargebee.com/hosted_pages/plans/plan-id?subscription[cf_custom_field_id]=“value.


Say for example you have a custom field named Vat, you can set it’s value in the URL as shown here:

https://vaishnavi-test.chargebee.com/hosted_pages/plans/test-1year?subscription[cf_vat]=“testing”.  When customers sign up via this url the custom field will be visible at the Subscription level.

Login or Signup to post a comment
×