code: import stripe
  stripe.api_key = "sk_test_your_key"
  
  stripe.Coupon.create(
    percent_off=25.5,
    duration="repeating",
    duration_in_months=3,
  )
  '''Response {
    "id": "Z4OV52SU",
    "object": "coupon",
    "amount_off": null,
    "created": 1659519093,
    "currency": "usd",
    "duration": "repeating",
    "duration_in_months": 3,
    "livemode": false,
    "max_redemptions": null,
    "metadata": {},
    "name": "25.5% off",
    "percent_off": 25.5,
    "redeem_by": null,
    "times_redeemed": 0,
    "valid": true
  }'''
nl: Create a couponYou can create coupons easily via the coupon management page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.
  A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice’s subtotal. For example, an invoice with a subtotal of €100 will have a final total of €0 if a coupon with an amount_off of 20000 is applied to it and an invoice with a subtotal of €300 will have a final total of €100 if a coupon with an amount_off of 20000 is applied to it.Parameters amount_off optional A positive integer representing the amount to subtract from an invoice total (required if percent_off is not passed). currency optional Three-letter ISO code for the currency of the amount_off parameter (required if amount_off is passed). duration optional enum Specifies how long the discount will be in effect if used on a subscription. Can be forever, once, or repeating. Defaults to once.Possible enum valuesonce repeating forever  duration_in_months optional Required only if duration is repeating, in which case it must be a positive integer that specifies the number of months the discount will be in effect. metadata optional dictionary Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata. name optional Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the id is shown if name is not set. percent_off optional A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if amount_off is not passed).More parametersExpand all  id optional   applies_to optional dictionary   currency_options optional dictionary preview feature   max_redemptions optional   redeem_by optional ReturnsReturns the coupon object