| 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 CreditNotePreviewParams(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 |
expand: NotRequired[List[str]] |
| 26 |
""" |
| 27 |
Specifies which fields in the response should be expanded. |
| 28 |
""" |
| 29 |
invoice: str |
| 30 |
""" |
| 31 |
ID of the invoice. |
| 32 |
""" |
| 33 |
lines: NotRequired[List["CreditNotePreviewParamsLine"]] |
| 34 |
""" |
| 35 |
Line items that make up the credit note. One of `amount`, `lines`, or `shipping_cost` must be provided. |
| 36 |
""" |
| 37 |
memo: NotRequired[str] |
| 38 |
""" |
| 39 |
The credit note's memo appears on the credit note PDF. |
| 40 |
""" |
| 41 |
metadata: NotRequired[Dict[str, str]] |
| 42 |
""" |
| 43 |
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`. |
| 44 |
""" |
| 45 |
out_of_band_amount: NotRequired[int] |
| 46 |
""" |
| 47 |
The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. |
| 48 |
""" |
| 49 |
reason: NotRequired[ |
| 50 |
Literal[ |
| 51 |
"duplicate", "fraudulent", "order_change", "product_unsatisfactory" |
| 52 |
] |
| 53 |
] |
| 54 |
""" |
| 55 |
Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` |
| 56 |
""" |
| 57 |
refund_amount: NotRequired[int] |
| 58 |
""" |
| 59 |
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. |
| 60 |
""" |
| 61 |
refunds: NotRequired[List["CreditNotePreviewParamsRefund"]] |
| 62 |
""" |
| 63 |
Refunds to link to this credit note. |
| 64 |
""" |
| 65 |
shipping_cost: NotRequired["CreditNotePreviewParamsShippingCost"] |
| 66 |
""" |
| 67 |
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. |
| 68 |
""" |
| 69 |
|
| 70 |
|
| 71 |
class CreditNotePreviewParamsLine(TypedDict): |
| 72 |
amount: NotRequired[int] |
| 73 |
""" |
| 74 |
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 |
| 75 |
""" |
| 76 |
description: NotRequired[str] |
| 77 |
""" |
| 78 |
The description of the credit note line item. Only valid when the `type` is `custom_line_item`. |
| 79 |
""" |
| 80 |
invoice_line_item: NotRequired[str] |
| 81 |
""" |
| 82 |
The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. |
| 83 |
""" |
| 84 |
quantity: NotRequired[int] |
| 85 |
""" |
| 86 |
The line item quantity to credit. |
| 87 |
""" |
| 88 |
tax_amounts: NotRequired[ |
| 89 |
"Literal['']|List[CreditNotePreviewParamsLineTaxAmount]" |
| 90 |
] |
| 91 |
""" |
| 92 |
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`. |
| 93 |
""" |
| 94 |
tax_rates: NotRequired["Literal['']|List[str]"] |
| 95 |
""" |
| 96 |
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. |
| 97 |
""" |
| 98 |
type: Literal["custom_line_item", "invoice_line_item"] |
| 99 |
""" |
| 100 |
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`. |
| 101 |
""" |
| 102 |
unit_amount: NotRequired[int] |
| 103 |
""" |
| 104 |
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`. |
| 105 |
""" |
| 106 |
unit_amount_decimal: NotRequired[str] |
| 107 |
""" |
| 108 |
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. |
| 109 |
""" |
| 110 |
|
| 111 |
|
| 112 |
class CreditNotePreviewParamsLineTaxAmount(TypedDict): |
| 113 |
amount: int |
| 114 |
""" |
| 115 |
The amount, in cents (or local equivalent), of the tax. |
| 116 |
""" |
| 117 |
tax_rate: str |
| 118 |
""" |
| 119 |
The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. |
| 120 |
""" |
| 121 |
taxable_amount: int |
| 122 |
""" |
| 123 |
The amount on which tax is calculated, in cents (or local equivalent). |
| 124 |
""" |
| 125 |
|
| 126 |
|
| 127 |
class CreditNotePreviewParamsRefund(TypedDict): |
| 128 |
amount_refunded: NotRequired[int] |
| 129 |
""" |
| 130 |
Amount of the refund that applies to this credit note, in cents (or local equivalent). Defaults to the entire refund amount. |
| 131 |
""" |
| 132 |
payment_record_refund: NotRequired[ |
| 133 |
"CreditNotePreviewParamsRefundPaymentRecordRefund" |
| 134 |
] |
| 135 |
""" |
| 136 |
The PaymentRecord refund details to link to this credit note. Required when `type` is `payment_record_refund`. |
| 137 |
""" |
| 138 |
refund: NotRequired[str] |
| 139 |
""" |
| 140 |
ID of an existing refund to link this credit note to. Required when `type` is `refund`. |
| 141 |
""" |
| 142 |
type: NotRequired[Literal["payment_record_refund", "refund"]] |
| 143 |
""" |
| 144 |
Type of the refund, one of `refund` or `payment_record_refund`. Defaults to `refund`. |
| 145 |
""" |
| 146 |
|
| 147 |
|
| 148 |
class CreditNotePreviewParamsRefundPaymentRecordRefund(TypedDict): |
| 149 |
payment_record: str |
| 150 |
""" |
| 151 |
The ID of the PaymentRecord with the refund to link to this credit note. |
| 152 |
""" |
| 153 |
refund_group: str |
| 154 |
""" |
| 155 |
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. |
| 156 |
""" |
| 157 |
|
| 158 |
|
| 159 |
class CreditNotePreviewParamsShippingCost(TypedDict): |
| 160 |
shipping_rate: NotRequired[str] |
| 161 |
""" |
| 162 |
The ID of the shipping rate to use for this order. |
| 163 |
""" |