Debian Codegraph @

stripe/params/_coupon_create_params.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from stripe._request_options import RequestOptions
4 from typing import Dict, List
5 from typing_extensions import Literal, NotRequired, TypedDict
6
7
8 class CouponCreateParams(RequestOptions):
9 amount_off: NotRequired[int]
10 """
11 A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed).
12 """
13 applies_to: NotRequired["CouponCreateParamsAppliesTo"]
14 """
15 A hash containing directions for what this Coupon will apply discounts to.
16 """
17 currency: NotRequired[str]
18 """
19 Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed).
20 """
21 currency_options: NotRequired[
22 Dict[str, "CouponCreateParamsCurrencyOptions"]
23 ]
24 """
25 Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
26 """
27 duration: NotRequired[Literal["forever", "once", "repeating"]]
28 """
29 Specifies how long the discount will be in effect if used on a subscription. Defaults to `once`.
30 """
31 duration_in_months: NotRequired[int]
32 """
33 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.
34 """
35 expand: NotRequired[List[str]]
36 """
37 Specifies which fields in the response should be expanded.
38 """
39 id: NotRequired[str]
40 """
41 Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you.
42 """
43 max_redemptions: NotRequired[int]
44 """
45 A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use.
46 """
47 metadata: NotRequired["Literal['']|Dict[str, str]"]
48 """
49 Set of [key-value pairs](https://docs.stripe.com/api/metadata) 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`.
50 """
51 name: NotRequired[str]
52 """
53 Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set.
54 """
55 percent_off: NotRequired[float]
56 """
57 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).
58 """
59 redeem_by: NotRequired[int]
60 """
61 Unix timestamp specifying the last time at which the coupon can be redeemed (cannot be set to more than 5 years in the future). After the redeem_by date, the coupon can no longer be applied to new customers.
62 """
63
64
65 class CouponCreateParamsAppliesTo(TypedDict):
66 products: NotRequired[List[str]]
67 """
68 An array of Product IDs that this Coupon will apply to.
69 """
70
71
72 class CouponCreateParamsCurrencyOptions(TypedDict):
73 amount_off: int
74 """
75 A positive integer representing the amount to subtract from an invoice total.
76 """