| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from typing import Dict, List |
| 4 |
from typing_extensions import Literal, NotRequired, TypedDict |
| 5 |
|
| 6 |
|
| 7 |
class CreditNotePreviewLinesListParams(TypedDict): |
| 8 |
amount: NotRequired[int] |
| 9 |
""" |
| 10 |
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. |
| 11 |
""" |
| 12 |
credit_amount: NotRequired[int] |
| 13 |
""" |
| 14 |
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. |
| 15 |
""" |
| 16 |
effective_at: NotRequired[int] |
| 17 |
""" |
| 18 |
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. |
| 19 |
""" |
| 20 |
email_type: NotRequired[Literal["credit_note", "none"]] |
| 21 |
""" |
| 22 |
Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. |
| 23 |
""" |
| 24 |
ending_before: NotRequired[str] |
| 25 |
""" |
| 26 |
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. |
| 27 |
""" |
| 28 |
expand: NotRequired[List[str]] |
| 29 |
""" |
| 30 |
Specifies which fields in the response should be expanded. |
| 31 |
""" |
| 32 |
invoice: str |
| 33 |
""" |
| 34 |
ID of the invoice. |
| 35 |
""" |
| 36 |
limit: NotRequired[int] |
| 37 |
""" |
| 38 |
A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. |
| 39 |
""" |
| 40 |
lines: NotRequired[List["CreditNotePreviewLinesListParamsLine"]] |
| 41 |
""" |
| 42 |
Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. |
| 43 |
""" |
| 44 |
memo: NotRequired[str] |
| 45 |
""" |
| 46 |
The credit note's memo appears on the credit note PDF. |
| 47 |
""" |
| 48 |
metadata: NotRequired[Dict[str, str]] |
| 49 |
""" |
| 50 |
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`. |
| 51 |
""" |
| 52 |
out_of_band_amount: NotRequired[int] |
| 53 |
""" |
| 54 |
The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. |
| 55 |
""" |
| 56 |
reason: NotRequired[ |
| 57 |
Literal[ |
| 58 |
"duplicate", "fraudulent", "order_change", "product_unsatisfactory" |
| 59 |
] |
| 60 |
] |
| 61 |
""" |
| 62 |
Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` |
| 63 |
""" |
| 64 |
refund_amount: NotRequired[int] |
| 65 |
""" |
| 66 |
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. |
| 67 |
""" |
| 68 |
refunds: NotRequired[List["CreditNotePreviewLinesListParamsRefund"]] |
| 69 |
""" |
| 70 |
Refunds to link to this credit note. |
| 71 |
""" |
| 72 |
shipping_cost: NotRequired["CreditNotePreviewLinesListParamsShippingCost"] |
| 73 |
""" |
| 74 |
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. |
| 75 |
""" |
| 76 |
starting_after: NotRequired[str] |
| 77 |
""" |
| 78 |
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. |
| 79 |
""" |
| 80 |
|
| 81 |
|
| 82 |
class CreditNotePreviewLinesListParamsLine(TypedDict): |
| 83 |
amount: NotRequired[int] |
| 84 |
""" |
| 85 |
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 |
| 86 |
""" |
| 87 |
description: NotRequired[str] |
| 88 |
""" |
| 89 |
The description of the credit note line item. Only valid when the `type` is `custom_line_item`. |
| 90 |
""" |
| 91 |
invoice_line_item: NotRequired[str] |
| 92 |
""" |
| 93 |
The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. |
| 94 |
""" |
| 95 |
quantity: NotRequired[int] |
| 96 |
""" |
| 97 |
The line item quantity to credit. |
| 98 |
""" |
| 99 |
tax_amounts: NotRequired[ |
| 100 |
"Literal['']|List[CreditNotePreviewLinesListParamsLineTaxAmount]" |
| 101 |
] |
| 102 |
""" |
| 103 |
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`. |
| 104 |
""" |
| 105 |
tax_rates: NotRequired["Literal['']|List[str]"] |
| 106 |
""" |
| 107 |
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. |
| 108 |
""" |
| 109 |
type: Literal["custom_line_item", "invoice_line_item"] |
| 110 |
""" |
| 111 |
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`. |
| 112 |
""" |
| 113 |
unit_amount: NotRequired[int] |
| 114 |
""" |
| 115 |
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`. |
| 116 |
""" |
| 117 |
unit_amount_decimal: NotRequired[str] |
| 118 |
""" |
| 119 |
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. |
| 120 |
""" |
| 121 |
|
| 122 |
|
| 123 |
class CreditNotePreviewLinesListParamsLineTaxAmount(TypedDict): |
| 124 |
amount: int |
| 125 |
""" |
| 126 |
The amount, in cents (or local equivalent), of the tax. |
| 127 |
""" |
| 128 |
tax_rate: str |
| 129 |
""" |
| 130 |
The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. |
| 131 |
""" |
| 132 |
taxable_amount: int |
| 133 |
""" |
| 134 |
The amount on which tax is calculated, in cents (or local equivalent). |
| 135 |
""" |
| 136 |
|
| 137 |
|
| 138 |
class CreditNotePreviewLinesListParamsRefund(TypedDict): |
| 139 |
amount_refunded: NotRequired[int] |
| 140 |
""" |
| 141 |
Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount. |
| 142 |
""" |
| 143 |
payment_record_refund: NotRequired[ |
| 144 |
"CreditNotePreviewLinesListParamsRefundPaymentRecordRefund" |
| 145 |
] |
| 146 |
""" |
| 147 |
The PaymentRecord refund details to link to this credit note. Required when `type` is `payment_record_refund`. |
| 148 |
""" |
| 149 |
refund: NotRequired[str] |
| 150 |
""" |
| 151 |
ID of an existing refund to link this credit note to. Required when `type` is `refund`. |
| 152 |
""" |
| 153 |
type: NotRequired[Literal["payment_record_refund", "refund"]] |
| 154 |
""" |
| 155 |
Type of the refund, one of `refund` or `payment_record_refund`. Defaults to `refund`. |
| 156 |
""" |
| 157 |
|
| 158 |
|
| 159 |
class CreditNotePreviewLinesListParamsRefundPaymentRecordRefund(TypedDict): |
| 160 |
payment_record: str |
| 161 |
""" |
| 162 |
The ID of the PaymentRecord with the refund to link to this credit note. |
| 163 |
""" |
| 164 |
refund_group: str |
| 165 |
""" |
| 166 |
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. |
| 167 |
""" |
| 168 |
|
| 169 |
|
| 170 |
class CreditNotePreviewLinesListParamsShippingCost(TypedDict): |
| 171 |
shipping_rate: NotRequired[str] |
| 172 |
""" |
| 173 |
The ID of the shipping rate to use for this order. |
| 174 |
""" |