post
https://www.pelcro.com/api/v1/core/subscriptions/redeem
Redeem a gift subscription for a customer.
Overview
Redeem a gift subscription for a customer. This activates a gifted subscription that was purchased by another user. The gift can either create a new subscription or extend an existing subscription.
Example: A customer receives a gift code from a friend. Use this endpoint to activate the gift and create their subscription.
Conditional Requirements
| Condition | Required Fields |
|---|---|
| Always | gift_code, user_id |
| Gift subscription's product requires shipping address | address_id |
| Redeeming on top of existing subscription | subscription_id |
| Gift subscription | Must be paid and not already redeemed |
subscription_id provided | Parent subscription must be active, past_due, unpaid, or trialing |
subscription_id provided | Parent subscription cannot be agency-managed or a donated subscription |
| Product has country restrictions | address_id must be in an allowed country |
| Customer has existing currency | Gift plan currency must match customer's currency |
Behavior
New Subscription (without subscription_id)
subscription_id)- Creates a new subscription for the customer
- Applies a system gift coupon (100% discount)
- Sets subscription to cancel at period end
- Marks gift subscription as redeemed
Extend Existing Subscription (with subscription_id)
subscription_id)- Renews the parent subscription with the gift plan
- Cancels the parent subscription at period end
- Marks both subscriptions with gift metadata
- Marks gift subscription as redeemed
Related Endpoints
- Subscriptions - Overview of the subscriptions API
- Get Subscription - Get subscription details
