Debian Codegraph @

stripe/params/_source_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 SourceCreateParams(RequestOptions):
9 amount: NotRequired[int]
10 """
11 Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land.
12 """
13 currency: NotRequired[str]
14 """
15 Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready.
16 """
17 customer: NotRequired[str]
18 """
19 The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`).
20 """
21 expand: NotRequired[List[str]]
22 """
23 Specifies which fields in the response should be expanded.
24 """
25 flow: NotRequired[
26 Literal["code_verification", "none", "receiver", "redirect"]
27 ]
28 """
29 The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows.
30 """
31 mandate: NotRequired["SourceCreateParamsMandate"]
32 """
33 Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status.
34 """
35 metadata: NotRequired[Dict[str, str]]
36 original_source: NotRequired[str]
37 """
38 The source to share.
39 """
40 owner: NotRequired["SourceCreateParamsOwner"]
41 """
42 Information about the owner of the payment instrument that may be used or required by particular source types.
43 """
44 receiver: NotRequired["SourceCreateParamsReceiver"]
45 """
46 Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`).
47 """
48 redirect: NotRequired["SourceCreateParamsRedirect"]
49 """
50 Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`).
51 """
52 source_order: NotRequired["SourceCreateParamsSourceOrder"]
53 """
54 Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it.
55 """
56 statement_descriptor: NotRequired[str]
57 """
58 An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all.
59 """
60 token: NotRequired[str]
61 """
62 An optional token used to create the source. When passed, token properties will override source parameters.
63 """
64 type: NotRequired[str]
65 """
66 The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://docs.stripe.com/sources/connect#cloning-card-sources) guide)
67 """
68 usage: NotRequired[Literal["reusable", "single_use"]]
69
70
71 class SourceCreateParamsMandate(TypedDict):
72 acceptance: NotRequired["SourceCreateParamsMandateAcceptance"]
73 """
74 The parameters required to notify Stripe of a mandate acceptance or refusal by the customer.
75 """
76 amount: NotRequired["Literal['']|int"]
77 """
78 The amount specified by the mandate. (Leave null for a mandate covering all amounts)
79 """
80 currency: NotRequired[str]
81 """
82 The currency specified by the mandate. (Must match `currency` of the source)
83 """
84 interval: NotRequired[Literal["one_time", "scheduled", "variable"]]
85 """
86 The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency)
87 """
88 notification_method: NotRequired[
89 Literal["deprecated_none", "email", "manual", "none", "stripe_email"]
90 ]
91 """
92 The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification).
93 """
94
95
96 class SourceCreateParamsMandateAcceptance(TypedDict):
97 date: NotRequired[int]
98 """
99 The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer.
100 """
101 ip: NotRequired[str]
102 """
103 The IP address from which the mandate was accepted or refused by the customer.
104 """
105 offline: NotRequired["SourceCreateParamsMandateAcceptanceOffline"]
106 """
107 The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline`
108 """
109 online: NotRequired["SourceCreateParamsMandateAcceptanceOnline"]
110 """
111 The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online`
112 """
113 status: Literal["accepted", "pending", "refused", "revoked"]
114 """
115 The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused).
116 """
117 type: NotRequired[Literal["offline", "online"]]
118 """
119 The type of acceptance information included with the mandate. Either `online` or `offline`
120 """
121 user_agent: NotRequired[str]
122 """
123 The user agent of the browser from which the mandate was accepted or refused by the customer.
124 """
125
126
127 class SourceCreateParamsMandateAcceptanceOffline(TypedDict):
128 contact_email: str
129 """
130 An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`.
131 """
132
133
134 class SourceCreateParamsMandateAcceptanceOnline(TypedDict):
135 date: NotRequired[int]
136 """
137 The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer.
138 """
139 ip: NotRequired[str]
140 """
141 The IP address from which the mandate was accepted or refused by the customer.
142 """
143 user_agent: NotRequired[str]
144 """
145 The user agent of the browser from which the mandate was accepted or refused by the customer.
146 """
147
148
149 class SourceCreateParamsOwner(TypedDict):
150 address: NotRequired["SourceCreateParamsOwnerAddress"]
151 """
152 Owner's address.
153 """
154 email: NotRequired[str]
155 """
156 Owner's email address.
157 """
158 name: NotRequired[str]
159 """
160 Owner's full name.
161 """
162 phone: NotRequired[str]
163 """
164 Owner's phone number.
165 """
166
167
168 class SourceCreateParamsOwnerAddress(TypedDict):
169 city: NotRequired[str]
170 """
171 City, district, suburb, town, or village.
172 """
173 country: NotRequired[str]
174 """
175 Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
176 """
177 line1: NotRequired[str]
178 """
179 Address line 1, such as the street, PO Box, or company name.
180 """
181 line2: NotRequired[str]
182 """
183 Address line 2, such as the apartment, suite, unit, or building.
184 """
185 postal_code: NotRequired[str]
186 """
187 ZIP or postal code.
188 """
189 state: NotRequired[str]
190 """
191 State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
192 """
193
194
195 class SourceCreateParamsReceiver(TypedDict):
196 refund_attributes_method: NotRequired[Literal["email", "manual", "none"]]
197 """
198 The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required.
199 """
200
201
202 class SourceCreateParamsRedirect(TypedDict):
203 return_url: str
204 """
205 The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application.
206 """
207
208
209 class SourceCreateParamsSourceOrder(TypedDict):
210 items: NotRequired[List["SourceCreateParamsSourceOrderItem"]]
211 """
212 List of items constituting the order.
213 """
214 shipping: NotRequired["SourceCreateParamsSourceOrderShipping"]
215 """
216 Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true.
217 """
218
219
220 class SourceCreateParamsSourceOrderItem(TypedDict):
221 amount: NotRequired[int]
222 currency: NotRequired[str]
223 description: NotRequired[str]
224 parent: NotRequired[str]
225 """
226 The ID of the SKU being ordered.
227 """
228 quantity: NotRequired[int]
229 """
230 The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered.
231 """
232 type: NotRequired[Literal["discount", "shipping", "sku", "tax"]]
233
234
235 class SourceCreateParamsSourceOrderShipping(TypedDict):
236 address: "SourceCreateParamsSourceOrderShippingAddress"
237 """
238 Shipping address.
239 """
240 carrier: NotRequired[str]
241 """
242 The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.
243 """
244 name: NotRequired[str]
245 """
246 Recipient name.
247 """
248 phone: NotRequired[str]
249 """
250 Recipient phone (including extension).
251 """
252 tracking_number: NotRequired[str]
253 """
254 The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.
255 """
256
257
258 class SourceCreateParamsSourceOrderShippingAddress(TypedDict):
259 city: NotRequired[str]
260 """
261 City, district, suburb, town, or village.
262 """
263 country: NotRequired[str]
264 """
265 Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
266 """
267 line1: str
268 """
269 Address line 1, such as the street, PO Box, or company name.
270 """
271 line2: NotRequired[str]
272 """
273 Address line 2, such as the apartment, suite, unit, or building.
274 """
275 postal_code: NotRequired[str]
276 """
277 ZIP or postal code.
278 """
279 state: NotRequired[str]
280 """
281 State, county, province, or region ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)).
282 """