| 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 CreditGrantCreateParams(RequestOptions): |
| 9 |
amount: "CreditGrantCreateParamsAmount" |
| 10 |
""" |
| 11 |
Amount of this credit grant. |
| 12 |
""" |
| 13 |
applicability_config: "CreditGrantCreateParamsApplicabilityConfig" |
| 14 |
""" |
| 15 |
Configuration specifying what this credit grant applies to. We currently only support `metered` prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. |
| 16 |
""" |
| 17 |
category: NotRequired[Literal["paid", "promotional"]] |
| 18 |
""" |
| 19 |
The category of this credit grant. It defaults to `paid` if not specified. |
| 20 |
""" |
| 21 |
customer: NotRequired[str] |
| 22 |
""" |
| 23 |
ID of the customer receiving the billing credits. |
| 24 |
""" |
| 25 |
customer_account: NotRequired[str] |
| 26 |
""" |
| 27 |
ID of the account representing the customer receiving the billing credits. |
| 28 |
""" |
| 29 |
effective_at: NotRequired[int] |
| 30 |
""" |
| 31 |
The time when the billing credits become effective-when they're eligible for use. It defaults to the current timestamp if not specified. |
| 32 |
""" |
| 33 |
expand: NotRequired[List[str]] |
| 34 |
""" |
| 35 |
Specifies which fields in the response should be expanded. |
| 36 |
""" |
| 37 |
expires_at: NotRequired[int] |
| 38 |
""" |
| 39 |
The time when the billing credits expire. If not specified, the billing credits don't expire. |
| 40 |
""" |
| 41 |
metadata: NotRequired[Dict[str, str]] |
| 42 |
""" |
| 43 |
Set of key-value pairs that you can attach to an object. You can use this to store additional information about the object (for example, cost basis) in a structured format. |
| 44 |
""" |
| 45 |
name: NotRequired[str] |
| 46 |
""" |
| 47 |
A descriptive name shown in the Dashboard. |
| 48 |
""" |
| 49 |
priority: NotRequired[int] |
| 50 |
""" |
| 51 |
The desired priority for applying this credit grant. If not specified, it will be set to the default value of 50. The highest priority is 0 and the lowest is 100. |
| 52 |
""" |
| 53 |
|
| 54 |
|
| 55 |
class CreditGrantCreateParamsAmount(TypedDict): |
| 56 |
monetary: NotRequired["CreditGrantCreateParamsAmountMonetary"] |
| 57 |
""" |
| 58 |
The monetary amount. |
| 59 |
""" |
| 60 |
type: Literal["monetary"] |
| 61 |
""" |
| 62 |
The type of this amount. We currently only support `monetary` billing credits. |
| 63 |
""" |
| 64 |
|
| 65 |
|
| 66 |
class CreditGrantCreateParamsAmountMonetary(TypedDict): |
| 67 |
currency: str |
| 68 |
""" |
| 69 |
Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `value` parameter. |
| 70 |
""" |
| 71 |
value: int |
| 72 |
""" |
| 73 |
A positive integer representing the amount of the credit grant. |
| 74 |
""" |
| 75 |
|
| 76 |
|
| 77 |
class CreditGrantCreateParamsApplicabilityConfig(TypedDict): |
| 78 |
scope: "CreditGrantCreateParamsApplicabilityConfigScope" |
| 79 |
""" |
| 80 |
Specify the scope of this applicability config. |
| 81 |
""" |
| 82 |
|
| 83 |
|
| 84 |
class CreditGrantCreateParamsApplicabilityConfigScope(TypedDict): |
| 85 |
price_type: NotRequired[Literal["metered"]] |
| 86 |
""" |
| 87 |
The price type that credit grants can apply to. We currently only support the `metered` price type. Cannot be used in combination with `prices`. |
| 88 |
""" |
| 89 |
prices: NotRequired[ |
| 90 |
List["CreditGrantCreateParamsApplicabilityConfigScopePrice"] |
| 91 |
] |
| 92 |
""" |
| 93 |
A list of prices that the credit grant can apply to. We currently only support the `metered` prices. Cannot be used in combination with `price_type`. |
| 94 |
""" |
| 95 |
|
| 96 |
|
| 97 |
class CreditGrantCreateParamsApplicabilityConfigScopePrice(TypedDict): |
| 98 |
id: str |
| 99 |
""" |
| 100 |
The price ID this credit grant should apply to. |
| 101 |
""" |