ChargebeeAPI

Gifts

Gift represents a subscription of a customer(recipient) to a 'gift plan' which has been gifted by another customer(gifter). It may also have addons and coupons. Gift will be created only on immediate successful payment collection from the gifter's payment method.

Gift is initially created in 'scheduled' state. The gift can be scheduled to be notified on a particular date to the recipient by passing 'scheduled_at'. If not, the recipient is notified immediately. Gift will be moved to 'unclaimed' state on the date of notification. If you pass auto_claim as true, gift status will be moved to 'claimed' immediately, otherwise, the gift will remain 'unclaimed' till the recipient claims the gift.

If the gift is not claimed before the claim_expiry_date, it will be moved to the 'expired' state.

GIFT SUBSCRIPTION

Gift subscriptions will be created in 'future' state. Once the gift is claimed, the subscription will be moved to 'non-renewing' state.

INVOICE

Gift subscriptions will be invoiced immediately. The invoice created has is_gifted as 'true' and term_finalized as 'false'. This is because initially the invoice term_start and term_end are set as the subscription's start_date till the end of the plan period. Once the gift is claimed, the invoice's term_finalized will be marked as 'true'. The term_start will be changed to the actual invoice's term, which is the gift-claim date and the term_end will be changed till plan's period.

API Index URL

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

Sample GiftJSON

Gifts attributes

id
required, string, max chars=150

Uniquely identifies a gift

status
required, enumerated string

Status of the gift.

Possible Enum Values
scheduled

Gift has been scheduled.

unclaimed

Gift is not yet claimed and is ready to be claimed.

claimed

Gift is claimed.

cancelled

Gift is cancelled.

expired

Gift is expired.

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
required, boolean, default=false

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

no_expiry
required, 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.

resource_version
optional, long

Version number of this resource. The resource_version is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.

updated_at
optional, timestamp(UTC) in seconds

Timestamp indicating when this gift resource was last updated.

gifter
required, gifter

Gifter details

gift_receiver
required, gift_receiver

Receiver details

gift_timelines
optional, list of gift_timeline

Gift timeline details