Existing customer with plan based URL in Latest Product Catalog - in-app layout checkout
This article also covers
Can I pass an existing customer on a plan-based URL in the Latest Product Catalog?
Can I create a checkout page with the plan-based URL syntax and pass an existing customer ID?
Solution
You can pass the customer[id] parameter only through the API. The plan-based URL does not support it. The plan-based URL works when you do not pass customer[id].
To create a subscription for an existing customer, authenticate the user in your application first. Then pass that user's customer[id] when you create the hosted page through the Hosted Pages API. Chargebee uses that ID to attach the subscription to the existing customer record. Chargebee does not authenticate the user. Do not pass a customer ID that the authenticated user is not authorized to use. If no customer with that ID exists in the business entity specified in the request, Chargebee creates a new customer with an autogenerated ID and attaches the subscription to it.
For Drop-In Script checkout, an email address alone does not guarantee the subscription links to an existing customer. Enable Checkout using Chargebee login, require the email field at checkout, and follow Returning User Management. Customers sign in with an OTP so Chargebee can match the email to an existing customer. If guest checkout is enabled, a customer can skip sign-in and Checkout may create a duplicate customer record.
You can use Chargebee.js cart customization to adjust cart contents. See Cart customization and the Cart API reference.