It doesn't work. The subscription was created successfully w/o the meta data.
Did I do it wrongly or hosted page API doesn't support meta_data?
1 Comment
N
Nandhini
said
almost 3 years ago
Hi Chao,
You're right, you wouldn't be able to use Chargebee's hosted pages API to pass in meta-data values.
Hosted pages API is used to create a link (URL) which will be sent to the customers, so that they can go through the checkout process to sign up for a new subscription.
You can pass on meta-data using Chargebee's create subscriptions API, where a subscription is created using API and the meta-data is passed within that API itself.
Also, meta-data can be passed even while updating a subscription. So, after the subscription is successfully signed-up by your customer, you can call update the subscription API to pass the metadata.
ChaoLiu
I tried to create a subscription with meta data. My request is like this:
https://XXX/api/v2/hosted_pages/checkout_new
billing_cycles:10000
customer[id]:YYYY
subscription[auto_collection]:on
subscription[meta_data]:[{"field1"["value1","value2"]}]
subscription[plan_id]:[ZZZZ]
subscription[plan_quantity]:2]
It doesn't work. The subscription was created successfully w/o the meta data.
Did I do it wrongly or hosted page API doesn't support meta_data?