github.com/stripe/stripe-go/v76@v76.25.0/tax_transaction.go (about) 1 // 2 // 3 // File generated from our OpenAPI spec 4 // 5 // 6 7 package stripe 8 9 // The type of customer address provided. 10 type TaxTransactionCustomerDetailsAddressSource string 11 12 // List of values that TaxTransactionCustomerDetailsAddressSource can take 13 const ( 14 TaxTransactionCustomerDetailsAddressSourceBilling TaxTransactionCustomerDetailsAddressSource = "billing" 15 TaxTransactionCustomerDetailsAddressSourceShipping TaxTransactionCustomerDetailsAddressSource = "shipping" 16 ) 17 18 // The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` 19 type TaxTransactionCustomerDetailsTaxIDType string 20 21 // List of values that TaxTransactionCustomerDetailsTaxIDType can take 22 const ( 23 TaxTransactionCustomerDetailsTaxIDTypeADNRT TaxTransactionCustomerDetailsTaxIDType = "ad_nrt" 24 TaxTransactionCustomerDetailsTaxIDTypeAETRN TaxTransactionCustomerDetailsTaxIDType = "ae_trn" 25 TaxTransactionCustomerDetailsTaxIDTypeARCUIT TaxTransactionCustomerDetailsTaxIDType = "ar_cuit" 26 TaxTransactionCustomerDetailsTaxIDTypeAUABN TaxTransactionCustomerDetailsTaxIDType = "au_abn" 27 TaxTransactionCustomerDetailsTaxIDTypeAUARN TaxTransactionCustomerDetailsTaxIDType = "au_arn" 28 TaxTransactionCustomerDetailsTaxIDTypeBGUIC TaxTransactionCustomerDetailsTaxIDType = "bg_uic" 29 TaxTransactionCustomerDetailsTaxIDTypeBOTIN TaxTransactionCustomerDetailsTaxIDType = "bo_tin" 30 TaxTransactionCustomerDetailsTaxIDTypeBRCNPJ TaxTransactionCustomerDetailsTaxIDType = "br_cnpj" 31 TaxTransactionCustomerDetailsTaxIDTypeBRCPF TaxTransactionCustomerDetailsTaxIDType = "br_cpf" 32 TaxTransactionCustomerDetailsTaxIDTypeCABN TaxTransactionCustomerDetailsTaxIDType = "ca_bn" 33 TaxTransactionCustomerDetailsTaxIDTypeCAGSTHST TaxTransactionCustomerDetailsTaxIDType = "ca_gst_hst" 34 TaxTransactionCustomerDetailsTaxIDTypeCAPSTBC TaxTransactionCustomerDetailsTaxIDType = "ca_pst_bc" 35 TaxTransactionCustomerDetailsTaxIDTypeCAPSTMB TaxTransactionCustomerDetailsTaxIDType = "ca_pst_mb" 36 TaxTransactionCustomerDetailsTaxIDTypeCAPSTSK TaxTransactionCustomerDetailsTaxIDType = "ca_pst_sk" 37 TaxTransactionCustomerDetailsTaxIDTypeCAQST TaxTransactionCustomerDetailsTaxIDType = "ca_qst" 38 TaxTransactionCustomerDetailsTaxIDTypeCHVAT TaxTransactionCustomerDetailsTaxIDType = "ch_vat" 39 TaxTransactionCustomerDetailsTaxIDTypeCLTIN TaxTransactionCustomerDetailsTaxIDType = "cl_tin" 40 TaxTransactionCustomerDetailsTaxIDTypeCNTIN TaxTransactionCustomerDetailsTaxIDType = "cn_tin" 41 TaxTransactionCustomerDetailsTaxIDTypeCONIT TaxTransactionCustomerDetailsTaxIDType = "co_nit" 42 TaxTransactionCustomerDetailsTaxIDTypeCRTIN TaxTransactionCustomerDetailsTaxIDType = "cr_tin" 43 TaxTransactionCustomerDetailsTaxIDTypeDORCN TaxTransactionCustomerDetailsTaxIDType = "do_rcn" 44 TaxTransactionCustomerDetailsTaxIDTypeECRUC TaxTransactionCustomerDetailsTaxIDType = "ec_ruc" 45 TaxTransactionCustomerDetailsTaxIDTypeEGTIN TaxTransactionCustomerDetailsTaxIDType = "eg_tin" 46 TaxTransactionCustomerDetailsTaxIDTypeESCIF TaxTransactionCustomerDetailsTaxIDType = "es_cif" 47 TaxTransactionCustomerDetailsTaxIDTypeEUOSSVAT TaxTransactionCustomerDetailsTaxIDType = "eu_oss_vat" 48 TaxTransactionCustomerDetailsTaxIDTypeEUVAT TaxTransactionCustomerDetailsTaxIDType = "eu_vat" 49 TaxTransactionCustomerDetailsTaxIDTypeGBVAT TaxTransactionCustomerDetailsTaxIDType = "gb_vat" 50 TaxTransactionCustomerDetailsTaxIDTypeGEVAT TaxTransactionCustomerDetailsTaxIDType = "ge_vat" 51 TaxTransactionCustomerDetailsTaxIDTypeHKBR TaxTransactionCustomerDetailsTaxIDType = "hk_br" 52 TaxTransactionCustomerDetailsTaxIDTypeHUTIN TaxTransactionCustomerDetailsTaxIDType = "hu_tin" 53 TaxTransactionCustomerDetailsTaxIDTypeIDNPWP TaxTransactionCustomerDetailsTaxIDType = "id_npwp" 54 TaxTransactionCustomerDetailsTaxIDTypeILVAT TaxTransactionCustomerDetailsTaxIDType = "il_vat" 55 TaxTransactionCustomerDetailsTaxIDTypeINGST TaxTransactionCustomerDetailsTaxIDType = "in_gst" 56 TaxTransactionCustomerDetailsTaxIDTypeISVAT TaxTransactionCustomerDetailsTaxIDType = "is_vat" 57 TaxTransactionCustomerDetailsTaxIDTypeJPCN TaxTransactionCustomerDetailsTaxIDType = "jp_cn" 58 TaxTransactionCustomerDetailsTaxIDTypeJPRN TaxTransactionCustomerDetailsTaxIDType = "jp_rn" 59 TaxTransactionCustomerDetailsTaxIDTypeJPTRN TaxTransactionCustomerDetailsTaxIDType = "jp_trn" 60 TaxTransactionCustomerDetailsTaxIDTypeKEPIN TaxTransactionCustomerDetailsTaxIDType = "ke_pin" 61 TaxTransactionCustomerDetailsTaxIDTypeKRBRN TaxTransactionCustomerDetailsTaxIDType = "kr_brn" 62 TaxTransactionCustomerDetailsTaxIDTypeLIUID TaxTransactionCustomerDetailsTaxIDType = "li_uid" 63 TaxTransactionCustomerDetailsTaxIDTypeMXRFC TaxTransactionCustomerDetailsTaxIDType = "mx_rfc" 64 TaxTransactionCustomerDetailsTaxIDTypeMYFRP TaxTransactionCustomerDetailsTaxIDType = "my_frp" 65 TaxTransactionCustomerDetailsTaxIDTypeMYITN TaxTransactionCustomerDetailsTaxIDType = "my_itn" 66 TaxTransactionCustomerDetailsTaxIDTypeMYSST TaxTransactionCustomerDetailsTaxIDType = "my_sst" 67 TaxTransactionCustomerDetailsTaxIDTypeNOVAT TaxTransactionCustomerDetailsTaxIDType = "no_vat" 68 TaxTransactionCustomerDetailsTaxIDTypeNOVOEC TaxTransactionCustomerDetailsTaxIDType = "no_voec" 69 TaxTransactionCustomerDetailsTaxIDTypeNZGST TaxTransactionCustomerDetailsTaxIDType = "nz_gst" 70 TaxTransactionCustomerDetailsTaxIDTypePERUC TaxTransactionCustomerDetailsTaxIDType = "pe_ruc" 71 TaxTransactionCustomerDetailsTaxIDTypePHTIN TaxTransactionCustomerDetailsTaxIDType = "ph_tin" 72 TaxTransactionCustomerDetailsTaxIDTypeROTIN TaxTransactionCustomerDetailsTaxIDType = "ro_tin" 73 TaxTransactionCustomerDetailsTaxIDTypeRSPIB TaxTransactionCustomerDetailsTaxIDType = "rs_pib" 74 TaxTransactionCustomerDetailsTaxIDTypeRUINN TaxTransactionCustomerDetailsTaxIDType = "ru_inn" 75 TaxTransactionCustomerDetailsTaxIDTypeRUKPP TaxTransactionCustomerDetailsTaxIDType = "ru_kpp" 76 TaxTransactionCustomerDetailsTaxIDTypeSAVAT TaxTransactionCustomerDetailsTaxIDType = "sa_vat" 77 TaxTransactionCustomerDetailsTaxIDTypeSGGST TaxTransactionCustomerDetailsTaxIDType = "sg_gst" 78 TaxTransactionCustomerDetailsTaxIDTypeSGUEN TaxTransactionCustomerDetailsTaxIDType = "sg_uen" 79 TaxTransactionCustomerDetailsTaxIDTypeSITIN TaxTransactionCustomerDetailsTaxIDType = "si_tin" 80 TaxTransactionCustomerDetailsTaxIDTypeSVNIT TaxTransactionCustomerDetailsTaxIDType = "sv_nit" 81 TaxTransactionCustomerDetailsTaxIDTypeTHVAT TaxTransactionCustomerDetailsTaxIDType = "th_vat" 82 TaxTransactionCustomerDetailsTaxIDTypeTRTIN TaxTransactionCustomerDetailsTaxIDType = "tr_tin" 83 TaxTransactionCustomerDetailsTaxIDTypeTWVAT TaxTransactionCustomerDetailsTaxIDType = "tw_vat" 84 TaxTransactionCustomerDetailsTaxIDTypeUAVAT TaxTransactionCustomerDetailsTaxIDType = "ua_vat" 85 TaxTransactionCustomerDetailsTaxIDTypeUnknown TaxTransactionCustomerDetailsTaxIDType = "unknown" 86 TaxTransactionCustomerDetailsTaxIDTypeUSEIN TaxTransactionCustomerDetailsTaxIDType = "us_ein" 87 TaxTransactionCustomerDetailsTaxIDTypeUYRUC TaxTransactionCustomerDetailsTaxIDType = "uy_ruc" 88 TaxTransactionCustomerDetailsTaxIDTypeVERIF TaxTransactionCustomerDetailsTaxIDType = "ve_rif" 89 TaxTransactionCustomerDetailsTaxIDTypeVNTIN TaxTransactionCustomerDetailsTaxIDType = "vn_tin" 90 TaxTransactionCustomerDetailsTaxIDTypeZAVAT TaxTransactionCustomerDetailsTaxIDType = "za_vat" 91 ) 92 93 // The taxability override used for taxation. 94 type TaxTransactionCustomerDetailsTaxabilityOverride string 95 96 // List of values that TaxTransactionCustomerDetailsTaxabilityOverride can take 97 const ( 98 TaxTransactionCustomerDetailsTaxabilityOverrideCustomerExempt TaxTransactionCustomerDetailsTaxabilityOverride = "customer_exempt" 99 TaxTransactionCustomerDetailsTaxabilityOverrideNone TaxTransactionCustomerDetailsTaxabilityOverride = "none" 100 TaxTransactionCustomerDetailsTaxabilityOverrideReverseCharge TaxTransactionCustomerDetailsTaxabilityOverride = "reverse_charge" 101 ) 102 103 // Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. 104 type TaxTransactionShippingCostTaxBehavior string 105 106 // List of values that TaxTransactionShippingCostTaxBehavior can take 107 const ( 108 TaxTransactionShippingCostTaxBehaviorExclusive TaxTransactionShippingCostTaxBehavior = "exclusive" 109 TaxTransactionShippingCostTaxBehaviorInclusive TaxTransactionShippingCostTaxBehavior = "inclusive" 110 ) 111 112 // Indicates the level of the jurisdiction imposing the tax. 113 type TaxTransactionShippingCostTaxBreakdownJurisdictionLevel string 114 115 // List of values that TaxTransactionShippingCostTaxBreakdownJurisdictionLevel can take 116 const ( 117 TaxTransactionShippingCostTaxBreakdownJurisdictionLevelCity TaxTransactionShippingCostTaxBreakdownJurisdictionLevel = "city" 118 TaxTransactionShippingCostTaxBreakdownJurisdictionLevelCountry TaxTransactionShippingCostTaxBreakdownJurisdictionLevel = "country" 119 TaxTransactionShippingCostTaxBreakdownJurisdictionLevelCounty TaxTransactionShippingCostTaxBreakdownJurisdictionLevel = "county" 120 TaxTransactionShippingCostTaxBreakdownJurisdictionLevelDistrict TaxTransactionShippingCostTaxBreakdownJurisdictionLevel = "district" 121 TaxTransactionShippingCostTaxBreakdownJurisdictionLevelState TaxTransactionShippingCostTaxBreakdownJurisdictionLevel = "state" 122 ) 123 124 // Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). 125 type TaxTransactionShippingCostTaxBreakdownSourcing string 126 127 // List of values that TaxTransactionShippingCostTaxBreakdownSourcing can take 128 const ( 129 TaxTransactionShippingCostTaxBreakdownSourcingDestination TaxTransactionShippingCostTaxBreakdownSourcing = "destination" 130 TaxTransactionShippingCostTaxBreakdownSourcingOrigin TaxTransactionShippingCostTaxBreakdownSourcing = "origin" 131 ) 132 133 // The tax type, such as `vat` or `sales_tax`. 134 type TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType string 135 136 // List of values that TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType can take 137 const ( 138 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeAmusementTax TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "amusement_tax" 139 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeCommunicationsTax TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "communications_tax" 140 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeGST TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "gst" 141 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeHST TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "hst" 142 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeIGST TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "igst" 143 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeJCT TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "jct" 144 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeLeaseTax TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "lease_tax" 145 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypePST TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "pst" 146 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeQST TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "qst" 147 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeRST TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "rst" 148 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeSalesTax TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "sales_tax" 149 TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxTypeVAT TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType = "vat" 150 ) 151 152 // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. 153 type TaxTransactionShippingCostTaxBreakdownTaxabilityReason string 154 155 // List of values that TaxTransactionShippingCostTaxBreakdownTaxabilityReason can take 156 const ( 157 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonCustomerExempt TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "customer_exempt" 158 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonNotCollecting TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "not_collecting" 159 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonNotSubjectToTax TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "not_subject_to_tax" 160 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonNotSupported TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "not_supported" 161 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonPortionProductExempt TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "portion_product_exempt" 162 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonPortionReducedRated TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "portion_reduced_rated" 163 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonPortionStandardRated TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "portion_standard_rated" 164 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonProductExempt TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "product_exempt" 165 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonProductExemptHoliday TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "product_exempt_holiday" 166 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonProportionallyRated TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "proportionally_rated" 167 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonReducedRated TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "reduced_rated" 168 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonReverseCharge TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "reverse_charge" 169 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonStandardRated TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "standard_rated" 170 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonTaxableBasisReduced TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "taxable_basis_reduced" 171 TaxTransactionShippingCostTaxBreakdownTaxabilityReasonZeroRated TaxTransactionShippingCostTaxBreakdownTaxabilityReason = "zero_rated" 172 ) 173 174 // If `reversal`, this transaction reverses an earlier transaction. 175 type TaxTransactionType string 176 177 // List of values that TaxTransactionType can take 178 const ( 179 TaxTransactionTypeReversal TaxTransactionType = "reversal" 180 TaxTransactionTypeTransaction TaxTransactionType = "transaction" 181 ) 182 183 // Retrieves a Tax Transaction object. 184 type TaxTransactionParams struct { 185 Params `form:"*"` 186 // Specifies which fields in the response should be expanded. 187 Expand []*string `form:"expand"` 188 } 189 190 // AddExpand appends a new field to expand. 191 func (p *TaxTransactionParams) AddExpand(f string) { 192 p.Expand = append(p.Expand, &f) 193 } 194 195 // Retrieves the line items of a committed standalone transaction as a collection. 196 type TaxTransactionListLineItemsParams struct { 197 ListParams `form:"*"` 198 Transaction *string `form:"-"` // Included in URL 199 // Specifies which fields in the response should be expanded. 200 Expand []*string `form:"expand"` 201 } 202 203 // AddExpand appends a new field to expand. 204 func (p *TaxTransactionListLineItemsParams) AddExpand(f string) { 205 p.Expand = append(p.Expand, &f) 206 } 207 208 // Creates a Tax Transaction from a calculation. 209 type TaxTransactionCreateFromCalculationParams struct { 210 Params `form:"*"` 211 // Tax Calculation ID to be used as input when creating the transaction. 212 Calculation *string `form:"calculation"` 213 // Specifies which fields in the response should be expanded. 214 Expand []*string `form:"expand"` 215 // Set of [key-value pairs](https://stripe.com/docs/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`. 216 Metadata map[string]string `form:"metadata"` 217 // A custom order or sale identifier, such as 'myOrder_123'. Must be unique across all transactions, including reversals. 218 Reference *string `form:"reference"` 219 } 220 221 // AddExpand appends a new field to expand. 222 func (p *TaxTransactionCreateFromCalculationParams) AddExpand(f string) { 223 p.Expand = append(p.Expand, &f) 224 } 225 226 // AddMetadata adds a new key-value pair to the Metadata. 227 func (p *TaxTransactionCreateFromCalculationParams) AddMetadata(key string, value string) { 228 if p.Metadata == nil { 229 p.Metadata = make(map[string]string) 230 } 231 232 p.Metadata[key] = value 233 } 234 235 // The line item amounts to reverse. 236 type TaxTransactionCreateReversalLineItemParams struct { 237 // The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. 238 Amount *int64 `form:"amount"` 239 // The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. 240 AmountTax *int64 `form:"amount_tax"` 241 // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. 242 Metadata map[string]string `form:"metadata"` 243 // The `id` of the line item to reverse in the original transaction. 244 OriginalLineItem *string `form:"original_line_item"` 245 // The quantity reversed. Appears in [tax exports](https://stripe.com/docs/tax/reports), but does not affect the amount of tax reversed. 246 Quantity *int64 `form:"quantity"` 247 // A custom identifier for this line item in the reversal transaction, such as 'L1-refund'. 248 Reference *string `form:"reference"` 249 } 250 251 // AddMetadata adds a new key-value pair to the Metadata. 252 func (p *TaxTransactionCreateReversalLineItemParams) AddMetadata(key string, value string) { 253 if p.Metadata == nil { 254 p.Metadata = make(map[string]string) 255 } 256 257 p.Metadata[key] = value 258 } 259 260 // The shipping cost to reverse. 261 type TaxTransactionCreateReversalShippingCostParams struct { 262 // The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. 263 Amount *int64 `form:"amount"` 264 // The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. 265 AmountTax *int64 `form:"amount_tax"` 266 } 267 268 // Partially or fully reverses a previously created Transaction. 269 type TaxTransactionCreateReversalParams struct { 270 Params `form:"*"` 271 // Specifies which fields in the response should be expanded. 272 Expand []*string `form:"expand"` 273 // A flat amount to reverse across the entire transaction, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. This value represents the total amount to refund from the transaction, including taxes. 274 FlatAmount *int64 `form:"flat_amount"` 275 // The line item amounts to reverse. 276 LineItems []*TaxTransactionCreateReversalLineItemParams `form:"line_items"` 277 // Set of [key-value pairs](https://stripe.com/docs/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`. 278 Metadata map[string]string `form:"metadata"` 279 // If `partial`, the provided line item or shipping cost amounts are reversed. If `full`, the original transaction is fully reversed. 280 Mode *string `form:"mode"` 281 // The ID of the Transaction to partially or fully reverse. 282 OriginalTransaction *string `form:"original_transaction"` 283 // A custom identifier for this reversal, such as `myOrder_123-refund_1`, which must be unique across all transactions. The reference helps identify this reversal transaction in exported [tax reports](https://stripe.com/docs/tax/reports). 284 Reference *string `form:"reference"` 285 // The shipping cost to reverse. 286 ShippingCost *TaxTransactionCreateReversalShippingCostParams `form:"shipping_cost"` 287 } 288 289 // AddExpand appends a new field to expand. 290 func (p *TaxTransactionCreateReversalParams) AddExpand(f string) { 291 p.Expand = append(p.Expand, &f) 292 } 293 294 // AddMetadata adds a new key-value pair to the Metadata. 295 func (p *TaxTransactionCreateReversalParams) AddMetadata(key string, value string) { 296 if p.Metadata == nil { 297 p.Metadata = make(map[string]string) 298 } 299 300 p.Metadata[key] = value 301 } 302 303 // The customer's tax IDs (for example, EU VAT numbers). 304 type TaxTransactionCustomerDetailsTaxID struct { 305 // The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown` 306 Type TaxTransactionCustomerDetailsTaxIDType `json:"type"` 307 // The value of the tax ID. 308 Value string `json:"value"` 309 } 310 type TaxTransactionCustomerDetails struct { 311 // The customer's postal address (for example, home or business location). 312 Address *Address `json:"address"` 313 // The type of customer address provided. 314 AddressSource TaxTransactionCustomerDetailsAddressSource `json:"address_source"` 315 // The customer's IP address (IPv4 or IPv6). 316 IPAddress string `json:"ip_address"` 317 // The taxability override used for taxation. 318 TaxabilityOverride TaxTransactionCustomerDetailsTaxabilityOverride `json:"taxability_override"` 319 // The customer's tax IDs (for example, EU VAT numbers). 320 TaxIDs []*TaxTransactionCustomerDetailsTaxID `json:"tax_ids"` 321 } 322 323 // If `type=reversal`, contains information about what was reversed. 324 type TaxTransactionReversal struct { 325 // The `id` of the reversed `Transaction` object. 326 OriginalTransaction string `json:"original_transaction"` 327 } 328 type TaxTransactionShippingCostTaxBreakdownJurisdiction struct { 329 // Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). 330 Country string `json:"country"` 331 // A human-readable name for the jurisdiction imposing the tax. 332 DisplayName string `json:"display_name"` 333 // Indicates the level of the jurisdiction imposing the tax. 334 Level TaxTransactionShippingCostTaxBreakdownJurisdictionLevel `json:"level"` 335 // [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. 336 State string `json:"state"` 337 } 338 339 // Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. 340 type TaxTransactionShippingCostTaxBreakdownTaxRateDetails struct { 341 // A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". 342 DisplayName string `json:"display_name"` 343 // The tax rate percentage as a string. For example, 8.5% is represented as "8.5". 344 PercentageDecimal string `json:"percentage_decimal"` 345 // The tax type, such as `vat` or `sales_tax`. 346 TaxType TaxTransactionShippingCostTaxBreakdownTaxRateDetailsTaxType `json:"tax_type"` 347 } 348 349 // Detailed account of taxes relevant to shipping cost. (It is not populated for the transaction resource object and will be removed in the next API version.) 350 type TaxTransactionShippingCostTaxBreakdown struct { 351 // The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). 352 Amount int64 `json:"amount"` 353 Jurisdiction *TaxTransactionShippingCostTaxBreakdownJurisdiction `json:"jurisdiction"` 354 // Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). 355 Sourcing TaxTransactionShippingCostTaxBreakdownSourcing `json:"sourcing"` 356 // The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. 357 TaxabilityReason TaxTransactionShippingCostTaxBreakdownTaxabilityReason `json:"taxability_reason"` 358 // The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). 359 TaxableAmount int64 `json:"taxable_amount"` 360 // Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. 361 TaxRateDetails *TaxTransactionShippingCostTaxBreakdownTaxRateDetails `json:"tax_rate_details"` 362 } 363 364 // The shipping cost details for the transaction. 365 type TaxTransactionShippingCost struct { 366 // The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. 367 Amount int64 `json:"amount"` 368 // The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). 369 AmountTax int64 `json:"amount_tax"` 370 // The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). 371 ShippingRate string `json:"shipping_rate"` 372 // Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. 373 TaxBehavior TaxTransactionShippingCostTaxBehavior `json:"tax_behavior"` 374 // Detailed account of taxes relevant to shipping cost. (It is not populated for the transaction resource object and will be removed in the next API version.) 375 TaxBreakdown []*TaxTransactionShippingCostTaxBreakdown `json:"tax_breakdown"` 376 // The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. 377 TaxCode string `json:"tax_code"` 378 } 379 380 // A Tax Transaction records the tax collected from or refunded to your customer. 381 // 382 // Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom#tax-transaction) 383 type TaxTransaction struct { 384 APIResource 385 // Time at which the object was created. Measured in seconds since the Unix epoch. 386 Created int64 `json:"created"` 387 // Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). 388 Currency Currency `json:"currency"` 389 // The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. 390 Customer string `json:"customer"` 391 CustomerDetails *TaxTransactionCustomerDetails `json:"customer_details"` 392 // Unique identifier for the transaction. 393 ID string `json:"id"` 394 // The tax collected or refunded, by line item. 395 LineItems *TaxTransactionLineItemList `json:"line_items"` 396 // Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. 397 Livemode bool `json:"livemode"` 398 // Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. 399 Metadata map[string]string `json:"metadata"` 400 // String representing the object's type. Objects of the same type share the same value. 401 Object string `json:"object"` 402 // A custom unique identifier, such as 'myOrder_123'. 403 Reference string `json:"reference"` 404 // If `type=reversal`, contains information about what was reversed. 405 Reversal *TaxTransactionReversal `json:"reversal"` 406 // The shipping cost details for the transaction. 407 ShippingCost *TaxTransactionShippingCost `json:"shipping_cost"` 408 // Timestamp of date at which the tax rules and rates in effect applies for the calculation. 409 TaxDate int64 `json:"tax_date"` 410 // If `reversal`, this transaction reverses an earlier transaction. 411 Type TaxTransactionType `json:"type"` 412 }