POST /hosted_pages/checkout_gift_for_items
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 {#gifter_lookup}
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 {#receiver_lookup}
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
Servers
- {protocol}://{site}.{environment}:{port}/api/v2
- {protocol}://{site}-test.{environment}:{port}/api/v2
Request headers
Name | Type | Required | Description |
---|---|---|---|
chargebee-request-origin-device |
String | No |
The device from which the customer has made the request |
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/x-www-form-urlencoded" |
chargebee-event-webhook |
String | No |
skip only webhooks Possible values:
|
chargebee-business-entity-id |
String | No |
If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation. |
chargebee-event-actions |
String | No |
skip all actions to be done on the events Possible values:
|
chargebee-request-origin-user |
String | No |
The email address of your customer/user. Use this when the email address has only ASCII characters. |
chargebee-request-origin-ip |
String | No |
The IP address of the customer where the request originated |
chargebee-request-origin-user-encoded |
String | No |
The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header |
chargebee-event-email |
String | No |
skip only emails Possible values:
|
Request body fields
Name | Type | Required | Description |
---|---|---|---|
redirect_url |
String | No |
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 :
|
gifter |
Object | No |
Parameters for gifter |
gifter.customer_id |
String | No |
The customer ID of the gifter. If not provided, the gifter customer resource is created with an autogenerated ID on checkout. Gifter customer resource lookup and creation |
gifter.locale |
String | No |
Determines which region-specific language Chargebee uses to communicate with the customer. In the absence of the locale attribute, Chargebee will use your site's default language for customer communication. |
business_entity_id |
String | No |
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. An alternative way of passing this parameter is by means of a custom HTTP header. Gifter customer resource lookup and creation. |
subscription_items |
Object | No |
Parameters for subscription_items |
subscription_items.item_price_id[] |
Array | No |
The unique identifier of the item price. |
subscription_items.quantity[] |
Array | No |
The quantity of the item purchased |
subscription_items.quantity_in_decimal[] |
Array | No |
The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when multi-decimal pricing is enabled. |
coupon_ids[] |
Array | No |
List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes. |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.