ChargebeeAPI

Create a gift

Idempotency Supported

Note: This operation optionally supports 3DS verification flow. To achieve the same, create the Payment Intent and pass it as input parameter to this API.

Creates a gift subscription with the gifter and receiver. Only plans marked as gift plans can be used to create gift subscription. It may also have addons and coupons. A gift is initially created in 'scheduled' state and the gift subscription will be created in 'future' state and invoiced immediately.

Term start and term end dates are determined based on whether the gift is claimed. Before claim, term start date is the subscription start date. Term end date occurs at the end of the plan's frequency. Once the gift is claimed, the gift claim date becomes the term start date and the term end date will be set as the end of the plan's frequency.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/gifts

Input Parameters

scheduled_at
optional, timestamp(UTC) in seconds

Indicates the date on which the gift notification is sent to the receiver. If not passed, the receiver is notified immediately.

auto_claim
optional, boolean, default=false

When true , the claim happens automatically. When not passed, the default value in the site settings is used.

no_expiry
optional, boolean

When true , indicates that the gift does not expire. Do not pass or pass as false when auto_claim is set. .

claim_expiry_date
optional, timestamp(UTC) in seconds

The date until which the gift can be claimed. Must be set to a value after scheduled_at. If the gift is not claimed within claim_expiry_date , it will expire and the subscription will move to cancelled state. When not passed, the value specified in the site settings will be used. Pass as NULL or do not pass when auto_claim or no_expiry are set.

coupon_ids
optional, string

List of coupons to be applied to this subscription. You can provide coupon ids or coupon codes.

gifter
optional, string

Parameters for gifter

gift_receiver
optional, string

Parameters for gift_receiver

payment_intent
optional, string

Parameters for payment_intent

shipping_address
optional, string

Parameters for shipping_address

subscription
optional, string

Parameters for subscription

addons
optional, string

Parameters for addons

Returns

giftGift object

Resource object representing gift

subscriptionSubscription object

Resource object representing subscription

invoiceInvoice object

Resource object representing invoice