| 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 PromotionCodeCreateParams(RequestOptions): |
| 9 |
active: NotRequired[bool] |
| 10 |
""" |
| 11 |
Whether the promotion code is currently active. |
| 12 |
""" |
| 13 |
code: NotRequired[str] |
| 14 |
""" |
| 15 |
The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), digits (0-9), and dashes (-). |
| 16 |
|
| 17 |
If left blank, we will generate one automatically. |
| 18 |
""" |
| 19 |
customer: NotRequired[str] |
| 20 |
""" |
| 21 |
The customer who can use this promotion code. If not set, all customers can use the promotion code. |
| 22 |
""" |
| 23 |
customer_account: NotRequired[str] |
| 24 |
""" |
| 25 |
The account representing the customer who can use this promotion code. If not set, all customers can use the promotion code. |
| 26 |
""" |
| 27 |
expand: NotRequired[List[str]] |
| 28 |
""" |
| 29 |
Specifies which fields in the response should be expanded. |
| 30 |
""" |
| 31 |
expires_at: NotRequired[int] |
| 32 |
""" |
| 33 |
The timestamp at which this promotion code will expire. If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`. |
| 34 |
""" |
| 35 |
max_redemptions: NotRequired[int] |
| 36 |
""" |
| 37 |
A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`. |
| 38 |
""" |
| 39 |
metadata: NotRequired[Dict[str, str]] |
| 40 |
""" |
| 41 |
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`. |
| 42 |
""" |
| 43 |
promotion: "PromotionCodeCreateParamsPromotion" |
| 44 |
""" |
| 45 |
The promotion referenced by this promotion code. |
| 46 |
""" |
| 47 |
restrictions: NotRequired["PromotionCodeCreateParamsRestrictions"] |
| 48 |
""" |
| 49 |
Settings that restrict the redemption of the promotion code. |
| 50 |
""" |
| 51 |
|
| 52 |
|
| 53 |
class PromotionCodeCreateParamsPromotion(TypedDict): |
| 54 |
coupon: NotRequired[str] |
| 55 |
""" |
| 56 |
If promotion `type` is `coupon`, the coupon for this promotion code. |
| 57 |
""" |
| 58 |
type: Literal["coupon"] |
| 59 |
""" |
| 60 |
Specifies the type of promotion. |
| 61 |
""" |
| 62 |
|
| 63 |
|
| 64 |
class PromotionCodeCreateParamsRestrictions(TypedDict): |
| 65 |
currency_options: NotRequired[ |
| 66 |
Dict[str, "PromotionCodeCreateParamsRestrictionsCurrencyOptions"] |
| 67 |
] |
| 68 |
""" |
| 69 |
Promotion codes defined in each available currency option. 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). |
| 70 |
""" |
| 71 |
first_time_transaction: NotRequired[bool] |
| 72 |
""" |
| 73 |
A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices |
| 74 |
""" |
| 75 |
minimum_amount: NotRequired[int] |
| 76 |
""" |
| 77 |
Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). |
| 78 |
""" |
| 79 |
minimum_amount_currency: NotRequired[str] |
| 80 |
""" |
| 81 |
Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount |
| 82 |
""" |
| 83 |
|
| 84 |
|
| 85 |
class PromotionCodeCreateParamsRestrictionsCurrencyOptions(TypedDict): |
| 86 |
minimum_amount: NotRequired[int] |
| 87 |
""" |
| 88 |
Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). |
| 89 |
""" |