Skip to content
Proud to collaborate with Microsoft for Startups

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 ​

PropertyValue
Workflow typeAtomic
LibraryApp-stripe
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
cloud_connection_uuiduuidYes—Org-scoped Stripe connection (customer's own account)
durationstringYes—once
percent_offintegerNo—Percentage off, 1-100 (exclusive with amount_off)
amount_offintegerNo—Fixed amount off in the smallest currency unit (requires currency)
currencystringNo—Three-letter ISO currency, required with amount_off
duration_in_monthsintegerNo—Months to repeat, required when duration=repeating
namestringNo—Name shown to the customer
max_redemptionsintegerNo—Total number of times this coupon can be used

Output Schema ​

FieldTypeRequiredDefaultDescription
coupon_idstringNo——
namestringNo——
percent_offintegerNo——
amount_offintegerNo——
durationstringNo——
validbooleanNo——
cloud_connection_uuiduuidNo——
currencystringNo——
duration_in_monthsintegerNo——
max_redemptionsintegerNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
errorstringNo——
error_typestringNo——
failed_layerintegerNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—execute—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

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"
  }
}