Menu
Create Coupon
Create a new coupon
/couponsUse it in a workflow
- Add a step and choose the Recurly connector.
- Pick the Create Coupon action (under coupon).
- Fill in the fields below, then reference the result from later steps as
{{createCoupon.response.data}}.
Fields
baseUrlstringThe API host this action calls. Choose one, or pick Custom to enter your own.
One ofhttps://v3.recurly.comhttps://v3.eu.recurly.com__custom__Default "https://v3.recurly.com"
baseUrlCustomstringbodystringThe request body content (for POST, PUT, PATCH requests).
forwardAllHeadersbooleanIf enabled, all headers from the incoming request will be forwarded. Additional headers below will override forwarded ones.
Default false
headerskeyvalueExtra HTTP headers to include, beyond what this action already declares. These override forwarded or declared headers with the same name.
queryParamskeyvalueExtra URL query parameters to include, beyond what this action already declares. These override declared query parameters with the same name.
Response
Returns 201 with an object. Read it in later steps with {{createCoupon.response.data.<field>}}.
idstringobjectstringcodestringThe code the customer enters to redeem the coupon.
namestringThe internal name for the coupon.
statestringIndicates if the coupon is redeemable, and if it is not, why.
One ofexpiredmaxed_outredeemable
max_redemptionsintegerA maximum number of redemptions for the coupon. The coupon will expire when it hits its maximum redemptions.
max_redemptions_per_accountintegerRedemptions per account is the number of times a specific account can redeem the coupon. Set redemptions per account to `1` if you want to keep customers from gaming the system and getting more than one discount from the coupon campaign.
unique_coupon_codes_countintegerWhen this number reaches `max_redemptions` the coupon will no longer be redeemable.
unique_code_templatestringOn a bulk coupon, the template from which unique coupon codes are generated.
unique_coupon_codeobjectWill be populated when the Coupon being returned is a `UniqueCouponCode`.
durationstring- "single_use" coupons applies to the first invoice only. - "temporal" coupons will apply to invoices for the duration determined by the `temporal_unit` and `temporal_amount` attributes.
One offoreversingle_usetemporalbilling_periods
temporal_amountintegerIf `duration` is "temporal" than `temporal_amount` is an integer which is multiplied by `temporal_unit` to define the duration that the coupon will be applied to invoices for. When `temporal_unit` is "billing_period", this is the number of complete billing cycles.
temporal_unitstringThe temporal unit for the coupon's duration. Used with temporal_amount to define how long the coupon applies. When temporal_unit is billing_period, the coupon applies for temporal_amount complete billing cycles rather than a fixed calendar duration. billing_period requires redemption_resource=subscription.
One ofdaymonthweekyearbilling_period
free_trial_unitstringDescription of the unit of time the coupon is for. Used with `free_trial_amount` to determine the duration of time the coupon is for.
One ofdaymonthweekbilling_period
free_trial_amountintegerSets the duration of time the `free_trial_unit` is for.
applies_to_all_plansbooleanThe coupon is valid for all plans if true. If false then `plans` will list the applicable plans.
Default true
applies_to_all_itemsbooleanThe coupon is valid for all items if true. If false then `items` will list the applicable items.
Default false
applies_to_non_plan_chargesbooleanThe coupon is valid for one-time, non-plan charges if true.
Default false
plansarray<object>A list of plans for which this coupon applies. This will be `null` if `applies_to_all_plans=true`.
idstringobjectstringcodestringUnique code to identify the plan. This is used in Hosted Payment Page URLs and in the invoice exports.
namestringThis name describes your plan and will appear on the Hosted Payment Page and the subscriber's invoice.
itemsarray<object>A list of items for which this coupon applies. This will be `null` if `applies_to_all_items=true`.
idstringobjectstringcodestringUnique code to identify the item.
statestringThe current state of the item.
One ofactiveinactive
namestringThis name describes your item and will appear on the invoice when it's purchased on a one time basis.
descriptionstringOptional, description.
redemption_resourcestringWhether the discount is for all eligible charges on the account, or only a specific subscription.
One ofaccountsubscriptionDefault "account"
discountobjectDetails of the discount a coupon applies. Will contain a `type` property and one of the following properties: `percent`, `fixed`, `trial`.
typestringOne offixedfree_trialpercent
percentintegerThis is only present when `type=percent`.
currenciesarray<object>2 fieldsThis is only present when `type=fixed`.
trialobject2 fieldsThis is only present when `type=free_trial`.
coupon_typestringWhether the coupon is "single_code" or "bulk". Bulk coupons will require a `unique_code_template` and will generate unique codes through the `/generate` endpoint.
One ofbulksingle_code
hosted_page_descriptionstringThis description will show up when a customer redeems a coupon on your Hosted Payment Pages, or if you choose to show the description on your own checkout page.
invoice_descriptionstringDescription of the coupon on the invoice.
redeem_bystring (date-time)The date and time the coupon will expire and can no longer be redeemed. Time is always 11:59:59, the end-of-day Pacific time.
created_atstring (date-time)updated_atstring (date-time)expired_atstring (date-time)The date and time the coupon was expired early or reached its `max_redemptions`.
{
"id": "string",
"object": "string",
"code": "string",
"name": "string",
"state": "expired",
"max_redemptions": 0,
"max_redemptions_per_account": 0,
"unique_coupon_codes_count": 0,
"unique_code_template": "string",
"unique_coupon_code": {},
"duration": "forever",
"temporal_amount": 0
}
Need more? See the Recurly guide for connection setup and behaviour shared by every action.