Create Coupon
stripe.create_coupon
ActionBusiness appsconnection required
Calls the Stripe API with the connection's secret key.
Create a percentage or fixed-amount discount coupon in Stripe.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- API key
- Providers
- Stripe
- Secret shape
- the Stripe secret key (sk_...)
- Resolved by
- config.connection_id, else node.connection_id
Configuration
11 fields, none required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
percent_off Percentage to take off, above 0 and up to 100. Give this or 'amount_off', not both. | number | No | — | 0–100 | 25 |
amount_off Fixed amount to take off an invoice total, in the currency's minor unit (500 = 5.00 USD). Needs 'currency'. | number | No | — | ≥ 1 | — |
currency Three-letter lowercase ISO currency code of 'amount_off'. | string | Conditional | — | 3–3 characters; only with amount_off | — |
duration How long the discount keeps applying to a subscription. | string | No | once | one of "forever", "once", "repeating" | — |
duration_in_months How many months a repeating coupon applies for. | number | Conditional | — | ≥ 1; only with duration | — |
coupon_id Choose the coupon's id yourself. Leave blank and Stripe generates one. | string | No | — | — | — |
name Name shown to customers on invoices and receipts. | string | No | — | ≤ 40 characters | — |
max_redemptions How many times in total the coupon may be redeemed. | number | No | — | ≥ 1 | — |
redeem_by Last moment the coupon can be redeemed, as a Unix timestamp in seconds. At most five years out. | number | No | — | ≥ 0 | — |
metadata Key/value pairs stored on the coupon and returned on every read. | object | No | — | — | — |
idempotency_key Overrides the key this node derives from the step. Set it to a business identifier (an order id, say) when the same write must not repeat across runs; leave it blank and a retry of this step reuses the step's own key. | string | No | — | ≤ 255 characters | — |
- At least one of percent_off, amount_off must be set.
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"duration": "once",
"percent_off": 25
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
id The coupon id, which is also the code applied to a customer. | string | — |
name The name customers see on invoices, or null. | string | — |
percent_off Percentage taken off, when the coupon is percentage-based. | number | — |
amount_off Amount taken off, in the currency's minor unit. | number | — |
currency The currency of amount_off, or null for a percentage coupon. | string | — |
duration forever, once or repeating. | string | — |
duration_in_months How many months a repeating coupon applies for. | number | — |
max_redemptions How many times the coupon may be redeemed, or null. | number | — |
times_redeemed How many times it has been redeemed so far. | number | — |
redeem_by Last moment it can be redeemed, Unix seconds, or null. | number | — |
valid True while the coupon can still be applied. | boolean | — |
created Creation time, as a Unix timestamp in seconds. | number | — |
{
"amount_off": 0,
"created": 0,
"currency": "",
"duration": "",
"duration_in_months": 0,
"id": "",
"max_redemptions": 0,
"name": "",
"percent_off": 0,
"redeem_by": 0,
"times_redeemed": 0,
"valid": false
}See Create Coupon run in a workflow.
In a technical demo we add the Stripe connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.