stripe.coupons.create_coupon ​
Create a Stripe discount coupon
Create a coupon. Supply exactly one of percent_off or amount_off (+ currency).
A coupon is the discount itself; the string a shopper types at checkout is a promotion code pointing at it — see stripe.promotion_codes.create_code.
Acts on the CUSTOMER'S OWN Stripe account, authenticated via the org-scoped Stripe connection selected by cloud_connection_uuid.
Inputs:
- cloud_connection_uuid: Org-scoped Stripe connection (customer's own account).
- duration: once | repeating | forever.
- percent_off: Percentage off, 1-100 (exclusive with amount_off) (optional).
- amount_off: Fixed amount off in the smallest currency unit (requires currency) (optional).
- currency: Three-letter ISO currency, required with amount_off (optional).
- duration_in_months: Months to repeat, required when duration=repeating (optional).
- name: Name shown to the customer (optional).
- max_redemptions: Total number of times this coupon can be used (optional).
Outputs (terminal state_data):
- coupon_id: str
- name: str
- percent_off: int
- amount_off: int
- duration: str
- valid: bool
Connection required: cloud_connection_uuid — the organization's own Stripe account credentials; there is no platform-key fallback.
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-stripe |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
cloud_connection_uuid | uuid | Yes | — | Org-scoped Stripe connection (customer's own account) |
duration | string | Yes | — | once |
percent_off | integer | No | — | Percentage off, 1-100 (exclusive with amount_off) |
amount_off | integer | No | — | Fixed amount off in the smallest currency unit (requires currency) |
currency | string | No | — | Three-letter ISO currency, required with amount_off |
duration_in_months | integer | No | — | Months to repeat, required when duration=repeating |
name | string | No | — | Name shown to the customer |
max_redemptions | integer | No | — | Total number of times this coupon can be used |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
coupon_id | string | No | — | — |
name | string | No | — | — |
percent_off | integer | No | — | — |
amount_off | integer | No | — | — |
duration | string | No | — | — |
valid | boolean | No | — | — |
cloud_connection_uuid | uuid | No | — | — |
currency | string | No | — | — |
duration_in_months | integer | No | — | — |
max_redemptions | integer | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
failed_layer | integer | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "stripe.coupons.create_coupon",
"initial_data": {
"cloud_connection_uuid": "value",
"duration": "value"
}
}