The coupon can be applied to the following objects - _ Subscription - All charges in the subscription are subject to the discount described in the coupon. To add a coupon to a subscription, first use Create Coupon. Then add the coupon ID to the coupon field of the subscription with Create Subscription or Update Subscription. _ Customer - The discount applies to all charges to the customer. To add a coupon to a customer, first use Create Coupon. Then add the coupon ID to the coupon field of the customer with Create Customer or Update Customer. * Order - The discount applies to a single order. To add a coupon to an order, first use Create Coupon. The duration field of the coupon must be set to repeating, and the duration_in_months and discount_duration_in_uses fields must be set to 1. Then add the coupon ID to the coupon field of the order with Create an Order or Update Order. A coupon can be applied to one or more customers or subscriptions. However, a subscription can have only one coupon, and the only way to assign two or more coupons to a customer is to assign them to separate subscriptions. If there is a coupon for the customer and another coupon for the customer's subscription, the subscription coupon takes precedence.
Properties
Name | Type | Required | Description |
---|---|---|---|
amount_off | float | ❌ | The amount of money to subtract from the payment. Decimal. Range: Positive decimal number, including the correct number of decimal places for the currency exponent, as defined in ISO 2417:2015. |
created | float | ❌ | When the coupon was created, in Unix time. Response only. |
currency | str | ❌ | |
description | str | ❌ | Description of the coupon. |
discount_duration_in_uses | float | ❌ | The number of times that the coupon can be redeemed by a specific customer or subscription. Relevant when duration is repeating and redeem_by is not set. |
discount_valid_until | float | ❌ | The final date that a discount can be used, in Unix time. Relevant when discount_validity_in_months is not set. |
discount_validity_in_months | float | ❌ | The number of months after the discount is created that it can be used. Relevant when discount_valid_until is not set. |
duration | Duration | ❌ | Determines how long the discount remains in effect. One of the following: _ forever _ repeating |
duration_in_months | float | ❌ | Determines the number of months that the coupon remains in effect after its creation. Integer. Required when duration is repeating. |
id_ | str | ❌ | Unique ID for this coupon. English alphanumeric characters with no special characters except underscore. If the merchant does not define an ID, Rapyd generates a string starting with coupon_. |
max_redemptions | float | ❌ | Determines the number of times the coupon can be redeemed. The number of customers, subscriptions or orders that the coupon is applied to cannot exceed this number. Integer. |
metadata | dict | ❌ | A JSON object defined by the client. |
percent_off | float | ❌ | Determines the size of the discount, measured in percent. Integer. Range: 1-100. |
redeem_by | float | ❌ | The last time at which the coupon can be redeemed, in Unix time. After the redeem_by date, the coupon can no longer be applied to new customers. 'redeem_by' takes precedence over the setting of discount_duration_in_uses and duration_in_months. |
times_redeemed | float | ❌ | Indicates the number of times the coupon has been applied to a customer, subscription or invoice. If the discount has been used more than one time by a customer, subscription or invoice, the number of redemptions after the first is also added to this value. Integer. When this value equals max_redemptions, the coupon becomes no longer valid. Response only. |
valid | bool | ❌ | Indicates whether the coupon can be redeemed. |
Determines how long the discount remains in effect. One of the following: _ forever _ repeating
Properties
Name | Type | Required | Description |
---|---|---|---|
FOREVER | str | ✅ | "forever" |
REPEATING | str | ✅ | "repeating" |