Creates a hosted page for a customer (called the gifter) to gift a subscription to another customer (called the receiver).
Gifter customer resource lookup and creation
When gifter[customer_id] is provided, it is looked up in Chargebee when the gifter completes the hosted page checkout. If not found, a new customer resource is created with this ID.
Multiple business entities
If multiple business entities are created for the site, the lookup and creation of the gifter customer resource happen within the context of the business entity specified in this API call. If no business entity is specified, the customer resource lookup is performed within the site context, and if not found, the resource is created for the default business entity of the site.
Gift receiver customer resource lookup and creation
Once the gifter checks out using the hosted page returned by this endpoint, Chargebee checks if a customer resource with the receiver's email address exists. The first such customer record is considered the receiver's customer resource. A new customer resource is created for the receiver if none are found.
Multiple business entities
If multiple business entities are created for the site, the lookup and creation of the gift receiver's customer resource happen within the context of the business entity of the gifter
Sample Request
Sample Result[JSON]
URL Format
Input Parameters
Sets the context for this operation to the business entity specified. Applicable only when multiple business entities have been created for the site. When this parameter is provided, the operation is able to read/write data associated only to the business entity specified. When not provided, the operation can read/write data for the entire site.
Note
An alternative way of passing this parameter is by means of a custom HTTP header.
See also
Gifter customer resource lookup and creation.
The customers will be redirected to this URL upon successful checkout. The hosted page id and state will be passed as parameters to this URL.
Note :
- Although the customer will be redirected to the
redirect_urlafter successful checkout, we do not recommend relying on it for completing critical post-checkout actions. This is because redirection may not happen due to unforeseen reasons such as user closing the tab, or exiting the browser, and so on. If there is any synchronization that you are doing after the redirection, you will have to have a backup. Chargebee recommends listening to appropriate webhooks such assubscription_createdorinvoice_generatedto verify a successful checkout. - Redirect URL configured in Settings > Hosted Pages Settings would be overriden by this redirect URL.
- Eg : http://yoursite.com?id=**&state=succeeded
- This parameter is not applicable for iframe messaging.
List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes .