Debian Codegraph @

stripe/params/_credit_note_preview_lines_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 CreditNotePreviewLinesParams(RequestOptions):
9 amount: NotRequired[int]
10 """
11 The integer amount in cents (or local equivalent) representing the total amount of the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
12 """
13 credit_amount: NotRequired[int]
14 """
15 The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice.
16 """
17 effective_at: NotRequired[int]
18 """
19 The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF.
20 """
21 email_type: NotRequired[Literal["credit_note", "none"]]
22 """
23 Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`.
24 """
25 ending_before: NotRequired[str]
26 """
27 A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.
28 """
29 expand: NotRequired[List[str]]
30 """
31 Specifies which fields in the response should be expanded.
32 """
33 invoice: str
34 """
35 ID of the invoice.
36 """
37 limit: NotRequired[int]
38 """
39 A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
40 """
41 lines: NotRequired[List["CreditNotePreviewLinesParamsLine"]]
42 """
43 Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
44 """
45 memo: NotRequired[str]
46 """
47 The credit note's memo appears on the credit note PDF.
48 """
49 metadata: NotRequired[Dict[str, str]]
50 """
51 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`.
52 """
53 out_of_band_amount: NotRequired[int]
54 """
55 The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe.
56 """
57 reason: NotRequired[
58 Literal[
59 "duplicate", "fraudulent", "order_change", "product_unsatisfactory"
60 ]
61 ]
62 """
63 Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`
64 """
65 refund_amount: NotRequired[int]
66 """
67 The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice.
68 """
69 refunds: NotRequired[List["CreditNotePreviewLinesParamsRefund"]]
70 """
71 Refunds to link to this credit note.
72 """
73 shipping_cost: NotRequired["CreditNotePreviewLinesParamsShippingCost"]
74 """
75 When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided.
76 """
77 starting_after: NotRequired[str]
78 """
79 A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.
80 """
81
82
83 class CreditNotePreviewLinesParamsLine(TypedDict):
84 amount: NotRequired[int]
85 """
86 The line item amount to credit. Only valid when `type` is `invoice_line_item`. If invoice is set up with `automatic_tax[enabled]=true`, this amount is tax exclusive
87 """
88 description: NotRequired[str]
89 """
90 The description of the credit note line item. Only valid when the `type` is `custom_line_item`.
91 """
92 invoice_line_item: NotRequired[str]
93 """
94 The invoice line item to credit. Only valid when the `type` is `invoice_line_item`.
95 """
96 quantity: NotRequired[int]
97 """
98 The line item quantity to credit.
99 """
100 tax_amounts: NotRequired[
101 "Literal['']|List[CreditNotePreviewLinesParamsLineTaxAmount]"
102 ]
103 """
104 A list of up to 10 tax amounts for the credit note line item. Not valid when `tax_rates` is used or if invoice is set up with `automatic_tax[enabled]=true`.
105 """
106 tax_rates: NotRequired["Literal['']|List[str]"]
107 """
108 The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and `tax_amounts` is not used.
109 """
110 type: Literal["custom_line_item", "invoice_line_item"]
111 """
112 Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. `custom_line_item` is not valid when the invoice is set up with `automatic_tax[enabled]=true`.
113 """
114 unit_amount: NotRequired[int]
115 """
116 The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`.
117 """
118 unit_amount_decimal: NotRequired[str]
119 """
120 Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.
121 """
122
123
124 class CreditNotePreviewLinesParamsLineTaxAmount(TypedDict):
125 amount: int
126 """
127 The amount, in cents (or local equivalent), of the tax.
128 """
129 tax_rate: str
130 """
131 The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe.
132 """
133 taxable_amount: int
134 """
135 The amount on which tax is calculated, in cents (or local equivalent).
136 """
137
138
139 class CreditNotePreviewLinesParamsRefund(TypedDict):
140 amount_refunded: NotRequired[int]
141 """
142 Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount.
143 """
144 payment_record_refund: NotRequired[
145 "CreditNotePreviewLinesParamsRefundPaymentRecordRefund"
146 ]
147 """
148 The PaymentRecord refund details to link to this credit note. Required when `type` is `payment_record_refund`.
149 """
150 refund: NotRequired[str]
151 """
152 ID of an existing refund to link this credit note to. Required when `type` is `refund`.
153 """
154 type: NotRequired[Literal["payment_record_refund", "refund"]]
155 """
156 Type of the refund, one of `refund` or `payment_record_refund`. Defaults to `refund`.
157 """
158
159
160 class CreditNotePreviewLinesParamsRefundPaymentRecordRefund(TypedDict):
161 payment_record: str
162 """
163 The ID of the PaymentRecord with the refund to link to this credit note.
164 """
165 refund_group: str
166 """
167 The PaymentRecord refund group to link to this credit note. For refunds processed off-Stripe, this will correspond to the `processor_details.custom.refund_reference` field provided when reporting the refund on the PaymentRecord.
168 """
169
170
171 class CreditNotePreviewLinesParamsShippingCost(TypedDict):
172 shipping_rate: NotRequired[str]
173 """
174 The ID of the shipping rate to use for this order.
175 """