-
Notifications
You must be signed in to change notification settings - Fork 448
/
invoice.go
1694 lines (1540 loc) · 124 KB
/
invoice.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//
//
// File generated from our OpenAPI spec
//
//
package stripe
import (
"encoding/json"
"github.com/stripe/stripe-go/v76/form"
)
// Type of the account referenced.
type InvoiceAutomaticTaxLiabilityType string
// List of values that InvoiceAutomaticTaxLiabilityType can take
const (
InvoiceAutomaticTaxLiabilityTypeAccount InvoiceAutomaticTaxLiabilityType = "account"
InvoiceAutomaticTaxLiabilityTypeSelf InvoiceAutomaticTaxLiabilityType = "self"
)
// The status of the most recent automated tax calculation for this invoice.
type InvoiceAutomaticTaxStatus string
// List of values that InvoiceAutomaticTaxStatus can take
const (
InvoiceAutomaticTaxStatusComplete InvoiceAutomaticTaxStatus = "complete"
InvoiceAutomaticTaxStatusFailed InvoiceAutomaticTaxStatus = "failed"
InvoiceAutomaticTaxStatusRequiresLocationInputs InvoiceAutomaticTaxStatus = "requires_location_inputs"
)
// Indicates the reason why the invoice was created.
//
// * `manual`: Unrelated to a subscription, for example, created via the invoice editor.
// * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds.
// * `subscription_create`: A new subscription was created.
// * `subscription_cycle`: A subscription advanced into a new period.
// * `subscription_threshold`: A subscription reached a billing threshold.
// * `subscription_update`: A subscription was updated.
// * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint.
type InvoiceBillingReason string
// List of values that InvoiceBillingReason can take
const (
InvoiceBillingReasonAutomaticPendingInvoiceItemInvoice InvoiceBillingReason = "automatic_pending_invoice_item_invoice"
InvoiceBillingReasonManual InvoiceBillingReason = "manual"
InvoiceBillingReasonQuoteAccept InvoiceBillingReason = "quote_accept"
InvoiceBillingReasonSubscription InvoiceBillingReason = "subscription"
InvoiceBillingReasonSubscriptionCreate InvoiceBillingReason = "subscription_create"
InvoiceBillingReasonSubscriptionCycle InvoiceBillingReason = "subscription_cycle"
InvoiceBillingReasonSubscriptionThreshold InvoiceBillingReason = "subscription_threshold"
InvoiceBillingReasonSubscriptionUpdate InvoiceBillingReason = "subscription_update"
InvoiceBillingReasonUpcoming InvoiceBillingReason = "upcoming"
)
// Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions.
type InvoiceCollectionMethod string
// List of values that InvoiceCollectionMethod can take
const (
InvoiceCollectionMethodChargeAutomatically InvoiceCollectionMethod = "charge_automatically"
InvoiceCollectionMethodSendInvoice InvoiceCollectionMethod = "send_invoice"
)
// Type of the account referenced.
type InvoiceIssuerType string
// List of values that InvoiceIssuerType can take
const (
InvoiceIssuerTypeAccount InvoiceIssuerType = "account"
InvoiceIssuerTypeSelf InvoiceIssuerType = "self"
)
// Transaction type of the mandate.
type InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionType string
// List of values that InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionType can take
const (
InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionTypeBusiness InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionType = "business"
InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionTypePersonal InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsTransactionType = "personal"
)
// Bank account verification method.
type InvoicePaymentSettingsPaymentMethodOptionsACSSDebitVerificationMethod string
// List of values that InvoicePaymentSettingsPaymentMethodOptionsACSSDebitVerificationMethod can take
const (
InvoicePaymentSettingsPaymentMethodOptionsACSSDebitVerificationMethodAutomatic InvoicePaymentSettingsPaymentMethodOptionsACSSDebitVerificationMethod = "automatic"
InvoicePaymentSettingsPaymentMethodOptionsACSSDebitVerificationMethodInstant InvoicePaymentSettingsPaymentMethodOptionsACSSDebitVerificationMethod = "instant"
InvoicePaymentSettingsPaymentMethodOptionsACSSDebitVerificationMethodMicrodeposits InvoicePaymentSettingsPaymentMethodOptionsACSSDebitVerificationMethod = "microdeposits"
)
// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
type InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure string
// List of values that InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure can take
const (
InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecureAny InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure = "any"
InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecureAutomatic InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure = "automatic"
InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecureChallenge InvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure = "challenge"
)
// The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceFundingType string
// List of values that InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceFundingType can take
const (
InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceFundingTypeBankTransfer InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceFundingType = "bank_transfer"
)
// The list of permissions to request. The `payment_method` permission must be included.
type InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission string
// List of values that InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission can take
const (
InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionBalances InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "balances"
InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionPaymentMethod InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "payment_method"
InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermissionTransactions InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPermission = "transactions"
)
// Data features requested to be retrieved upon account creation.
type InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch string
// List of values that InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch can take
const (
InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchBalances InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch = "balances"
InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetchTransactions InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsPrefetch = "transactions"
)
// Bank account verification method.
type InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountVerificationMethod string
// List of values that InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountVerificationMethod can take
const (
InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountVerificationMethodAutomatic InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountVerificationMethod = "automatic"
InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountVerificationMethodInstant InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountVerificationMethod = "instant"
InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountVerificationMethodMicrodeposits InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountVerificationMethod = "microdeposits"
)
// The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice).
type InvoicePaymentSettingsPaymentMethodType string
// List of values that InvoicePaymentSettingsPaymentMethodType can take
const (
InvoicePaymentSettingsPaymentMethodTypeACHCreditTransfer InvoicePaymentSettingsPaymentMethodType = "ach_credit_transfer"
InvoicePaymentSettingsPaymentMethodTypeACHDebit InvoicePaymentSettingsPaymentMethodType = "ach_debit"
InvoicePaymentSettingsPaymentMethodTypeACSSDebit InvoicePaymentSettingsPaymentMethodType = "acss_debit"
InvoicePaymentSettingsPaymentMethodTypeAUBECSDebit InvoicePaymentSettingsPaymentMethodType = "au_becs_debit"
InvoicePaymentSettingsPaymentMethodTypeBACSDebit InvoicePaymentSettingsPaymentMethodType = "bacs_debit"
InvoicePaymentSettingsPaymentMethodTypeBancontact InvoicePaymentSettingsPaymentMethodType = "bancontact"
InvoicePaymentSettingsPaymentMethodTypeBoleto InvoicePaymentSettingsPaymentMethodType = "boleto"
InvoicePaymentSettingsPaymentMethodTypeCard InvoicePaymentSettingsPaymentMethodType = "card"
InvoicePaymentSettingsPaymentMethodTypeCashApp InvoicePaymentSettingsPaymentMethodType = "cashapp"
InvoicePaymentSettingsPaymentMethodTypeCustomerBalance InvoicePaymentSettingsPaymentMethodType = "customer_balance"
InvoicePaymentSettingsPaymentMethodTypeEPS InvoicePaymentSettingsPaymentMethodType = "eps"
InvoicePaymentSettingsPaymentMethodTypeFPX InvoicePaymentSettingsPaymentMethodType = "fpx"
InvoicePaymentSettingsPaymentMethodTypeGiropay InvoicePaymentSettingsPaymentMethodType = "giropay"
InvoicePaymentSettingsPaymentMethodTypeGrabpay InvoicePaymentSettingsPaymentMethodType = "grabpay"
InvoicePaymentSettingsPaymentMethodTypeIDEAL InvoicePaymentSettingsPaymentMethodType = "ideal"
InvoicePaymentSettingsPaymentMethodTypeKonbini InvoicePaymentSettingsPaymentMethodType = "konbini"
InvoicePaymentSettingsPaymentMethodTypeLink InvoicePaymentSettingsPaymentMethodType = "link"
InvoicePaymentSettingsPaymentMethodTypeP24 InvoicePaymentSettingsPaymentMethodType = "p24"
InvoicePaymentSettingsPaymentMethodTypePayNow InvoicePaymentSettingsPaymentMethodType = "paynow"
InvoicePaymentSettingsPaymentMethodTypePaypal InvoicePaymentSettingsPaymentMethodType = "paypal"
InvoicePaymentSettingsPaymentMethodTypePromptPay InvoicePaymentSettingsPaymentMethodType = "promptpay"
InvoicePaymentSettingsPaymentMethodTypeSEPACreditTransfer InvoicePaymentSettingsPaymentMethodType = "sepa_credit_transfer"
InvoicePaymentSettingsPaymentMethodTypeSEPADebit InvoicePaymentSettingsPaymentMethodType = "sepa_debit"
InvoicePaymentSettingsPaymentMethodTypeSofort InvoicePaymentSettingsPaymentMethodType = "sofort"
InvoicePaymentSettingsPaymentMethodTypeUSBankAccount InvoicePaymentSettingsPaymentMethodType = "us_bank_account"
InvoicePaymentSettingsPaymentMethodTypeWeChatPay InvoicePaymentSettingsPaymentMethodType = "wechat_pay"
)
// Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale.
type InvoiceRenderingPDFPageSize string
// List of values that InvoiceRenderingPDFPageSize can take
const (
InvoiceRenderingPDFPageSizeA4 InvoiceRenderingPDFPageSize = "a4"
InvoiceRenderingPDFPageSizeAuto InvoiceRenderingPDFPageSize = "auto"
InvoiceRenderingPDFPageSizeLetter InvoiceRenderingPDFPageSize = "letter"
)
// 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.
type InvoiceShippingCostTaxTaxabilityReason string
// List of values that InvoiceShippingCostTaxTaxabilityReason can take
const (
InvoiceShippingCostTaxTaxabilityReasonCustomerExempt InvoiceShippingCostTaxTaxabilityReason = "customer_exempt"
InvoiceShippingCostTaxTaxabilityReasonNotCollecting InvoiceShippingCostTaxTaxabilityReason = "not_collecting"
InvoiceShippingCostTaxTaxabilityReasonNotSubjectToTax InvoiceShippingCostTaxTaxabilityReason = "not_subject_to_tax"
InvoiceShippingCostTaxTaxabilityReasonNotSupported InvoiceShippingCostTaxTaxabilityReason = "not_supported"
InvoiceShippingCostTaxTaxabilityReasonPortionProductExempt InvoiceShippingCostTaxTaxabilityReason = "portion_product_exempt"
InvoiceShippingCostTaxTaxabilityReasonPortionReducedRated InvoiceShippingCostTaxTaxabilityReason = "portion_reduced_rated"
InvoiceShippingCostTaxTaxabilityReasonPortionStandardRated InvoiceShippingCostTaxTaxabilityReason = "portion_standard_rated"
InvoiceShippingCostTaxTaxabilityReasonProductExempt InvoiceShippingCostTaxTaxabilityReason = "product_exempt"
InvoiceShippingCostTaxTaxabilityReasonProductExemptHoliday InvoiceShippingCostTaxTaxabilityReason = "product_exempt_holiday"
InvoiceShippingCostTaxTaxabilityReasonProportionallyRated InvoiceShippingCostTaxTaxabilityReason = "proportionally_rated"
InvoiceShippingCostTaxTaxabilityReasonReducedRated InvoiceShippingCostTaxTaxabilityReason = "reduced_rated"
InvoiceShippingCostTaxTaxabilityReasonReverseCharge InvoiceShippingCostTaxTaxabilityReason = "reverse_charge"
InvoiceShippingCostTaxTaxabilityReasonStandardRated InvoiceShippingCostTaxTaxabilityReason = "standard_rated"
InvoiceShippingCostTaxTaxabilityReasonTaxableBasisReduced InvoiceShippingCostTaxTaxabilityReason = "taxable_basis_reduced"
InvoiceShippingCostTaxTaxabilityReasonZeroRated InvoiceShippingCostTaxTaxabilityReason = "zero_rated"
)
// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
type InvoiceStatus string
// List of values that InvoiceStatus can take
const (
InvoiceStatusDraft InvoiceStatus = "draft"
InvoiceStatusOpen InvoiceStatus = "open"
InvoiceStatusPaid InvoiceStatus = "paid"
InvoiceStatusUncollectible InvoiceStatus = "uncollectible"
InvoiceStatusVoid InvoiceStatus = "void"
)
// 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.
type InvoiceTotalTaxAmountTaxabilityReason string
// List of values that InvoiceTotalTaxAmountTaxabilityReason can take
const (
InvoiceTotalTaxAmountTaxabilityReasonCustomerExempt InvoiceTotalTaxAmountTaxabilityReason = "customer_exempt"
InvoiceTotalTaxAmountTaxabilityReasonNotCollecting InvoiceTotalTaxAmountTaxabilityReason = "not_collecting"
InvoiceTotalTaxAmountTaxabilityReasonNotSubjectToTax InvoiceTotalTaxAmountTaxabilityReason = "not_subject_to_tax"
InvoiceTotalTaxAmountTaxabilityReasonNotSupported InvoiceTotalTaxAmountTaxabilityReason = "not_supported"
InvoiceTotalTaxAmountTaxabilityReasonPortionProductExempt InvoiceTotalTaxAmountTaxabilityReason = "portion_product_exempt"
InvoiceTotalTaxAmountTaxabilityReasonPortionReducedRated InvoiceTotalTaxAmountTaxabilityReason = "portion_reduced_rated"
InvoiceTotalTaxAmountTaxabilityReasonPortionStandardRated InvoiceTotalTaxAmountTaxabilityReason = "portion_standard_rated"
InvoiceTotalTaxAmountTaxabilityReasonProductExempt InvoiceTotalTaxAmountTaxabilityReason = "product_exempt"
InvoiceTotalTaxAmountTaxabilityReasonProductExemptHoliday InvoiceTotalTaxAmountTaxabilityReason = "product_exempt_holiday"
InvoiceTotalTaxAmountTaxabilityReasonProportionallyRated InvoiceTotalTaxAmountTaxabilityReason = "proportionally_rated"
InvoiceTotalTaxAmountTaxabilityReasonReducedRated InvoiceTotalTaxAmountTaxabilityReason = "reduced_rated"
InvoiceTotalTaxAmountTaxabilityReasonReverseCharge InvoiceTotalTaxAmountTaxabilityReason = "reverse_charge"
InvoiceTotalTaxAmountTaxabilityReasonStandardRated InvoiceTotalTaxAmountTaxabilityReason = "standard_rated"
InvoiceTotalTaxAmountTaxabilityReasonTaxableBasisReduced InvoiceTotalTaxAmountTaxabilityReason = "taxable_basis_reduced"
InvoiceTotalTaxAmountTaxabilityReasonZeroRated InvoiceTotalTaxAmountTaxabilityReason = "zero_rated"
)
// Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice).
type InvoiceParams struct {
Params `form:"*"`
// The account tax IDs associated with the invoice. Only editable when the invoice is a draft.
AccountTaxIDs []*string `form:"account_tax_ids"`
// A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees).
ApplicationFeeAmount *int64 `form:"application_fee_amount"`
// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action.
AutoAdvance *bool `form:"auto_advance"`
// Settings for automatic tax lookup for this invoice.
AutomaticTax *InvoiceAutomaticTaxParams `form:"automatic_tax"`
// Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`.
CollectionMethod *string `form:"collection_method"`
// The currency to create this invoice in. Defaults to that of `customer` if not specified.
Currency *string `form:"currency"`
// The ID of the customer who will be billed.
Customer *string `form:"customer"`
// A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields.
CustomFields []*InvoiceCustomFieldParams `form:"custom_fields"`
// The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
DaysUntilDue *int64 `form:"days_until_due"`
// ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings.
DefaultPaymentMethod *string `form:"default_payment_method"`
// ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source.
DefaultSource *string `form:"default_source"`
// The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates.
DefaultTaxRates []*string `form:"default_tax_rates"`
// An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard.
Description *string `form:"description"`
// The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts.
Discounts []*InvoiceDiscountParams `form:"discounts"`
// The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices.
DueDate *int64 `form:"due_date"`
// The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt.
EffectiveAt *int64 `form:"effective_at"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// Footer to be displayed on the invoice.
Footer *string `form:"footer"`
// Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
FromInvoice *InvoiceFromInvoiceParams `form:"from_invoice"`
// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
Issuer *InvoiceIssuerParams `form:"issuer"`
// 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`.
Metadata map[string]string `form:"metadata"`
// Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically.
Number *string `form:"number"`
// The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
OnBehalfOf *string `form:"on_behalf_of"`
// Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
PaymentSettings *InvoicePaymentSettingsParams `form:"payment_settings"`
// How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted.
PendingInvoiceItemsBehavior *string `form:"pending_invoice_items_behavior"`
// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
Rendering *InvoiceRenderingParams `form:"rendering"`
// Settings for the cost of shipping for this invoice.
ShippingCost *InvoiceShippingCostParams `form:"shipping_cost"`
// Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
ShippingDetails *InvoiceShippingDetailsParams `form:"shipping_details"`
// Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
StatementDescriptor *string `form:"statement_descriptor"`
// The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected.
Subscription *string `form:"subscription"`
// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value.
TransferData *InvoiceTransferDataParams `form:"transfer_data"`
}
// AddExpand appends a new field to expand.
func (p *InvoiceParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}
// AddMetadata adds a new key-value pair to the Metadata.
func (p *InvoiceParams) AddMetadata(key string, value string) {
if p.Metadata == nil {
p.Metadata = make(map[string]string)
}
p.Metadata[key] = value
}
// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
type InvoiceAutomaticTaxLiabilityParams struct {
// The connected account being referenced when `type` is `account`.
Account *string `form:"account"`
// Type of the account referenced in the request.
Type *string `form:"type"`
}
// Settings for automatic tax lookup for this invoice.
type InvoiceAutomaticTaxParams struct {
// Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
Enabled *bool `form:"enabled"`
// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
Liability *InvoiceAutomaticTaxLiabilityParams `form:"liability"`
}
// A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields.
type InvoiceCustomFieldParams struct {
// The name of the custom field. This may be up to 40 characters.
Name *string `form:"name"`
// The value of the custom field. This may be up to 140 characters.
Value *string `form:"value"`
}
// The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts.
type InvoiceDiscountParams struct {
// ID of the coupon to create a new discount for.
Coupon *string `form:"coupon"`
// ID of an existing discount on the object (or one of its ancestors) to reuse.
Discount *string `form:"discount"`
// ID of the promotion code to create a new discount for.
PromotionCode *string `form:"promotion_code"`
}
// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
type InvoiceIssuerParams struct {
// The connected account being referenced when `type` is `account`.
Account *string `form:"account"`
// Type of the account referenced in the request.
Type *string `form:"type"`
}
// Additional fields for Mandate creation
type InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsParams struct {
// Transaction type of the mandate.
TransactionType *string `form:"transaction_type"`
}
// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent.
type InvoicePaymentSettingsPaymentMethodOptionsACSSDebitParams struct {
// Additional fields for Mandate creation
MandateOptions *InvoicePaymentSettingsPaymentMethodOptionsACSSDebitMandateOptionsParams `form:"mandate_options"`
// Verification method for the intent
VerificationMethod *string `form:"verification_method"`
}
// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent.
type InvoicePaymentSettingsPaymentMethodOptionsBancontactParams struct {
// Preferred language of the Bancontact authorization page that the customer is redirected to.
PreferredLanguage *string `form:"preferred_language"`
}
// The selected installment plan to use for this invoice.
type InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanParams struct {
// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.
Count *int64 `form:"count"`
// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.
// One of `month`.
Interval *string `form:"interval"`
// Type of installment plan, one of `fixed_count`.
Type *string `form:"type"`
}
// Installment configuration for payments attempted on this invoice (Mexico Only).
//
// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
type InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsParams struct {
// Setting to true enables installments for this invoice.
// Setting to false will prevent any selected plan from applying to a payment.
Enabled *bool `form:"enabled"`
// The selected installment plan to use for this invoice.
Plan *InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanParams `form:"plan"`
}
// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent.
type InvoicePaymentSettingsPaymentMethodOptionsCardParams struct {
// Installment configuration for payments attempted on this invoice (Mexico Only).
//
// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).
Installments *InvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsParams `form:"installments"`
// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.
RequestThreeDSecure *string `form:"request_three_d_secure"`
}
// Configuration for eu_bank_transfer funding type.
type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransferParams struct {
// The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.
Country *string `form:"country"`
}
// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferParams struct {
// Configuration for eu_bank_transfer funding type.
EUBankTransfer *InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEUBankTransferParams `form:"eu_bank_transfer"`
// The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.
Type *string `form:"type"`
}
// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent.
type InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceParams struct {
// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.
BankTransfer *InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferParams `form:"bank_transfer"`
// The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.
FundingType *string `form:"funding_type"`
}
// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
type InvoicePaymentSettingsPaymentMethodOptionsKonbiniParams struct{}
// If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent.
type InvoicePaymentSettingsPaymentMethodOptionsSEPADebitParams struct{}
// Additional fields for Financial Connections Session creation
type InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsParams struct {
// The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.
Permissions []*string `form:"permissions"`
// List of data features that you would like to retrieve upon account creation.
Prefetch []*string `form:"prefetch"`
}
// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent.
type InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountParams struct {
// Additional fields for Financial Connections Session creation
FinancialConnections *InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountFinancialConnectionsParams `form:"financial_connections"`
// Verification method for the intent
VerificationMethod *string `form:"verification_method"`
}
// Payment-method-specific configuration to provide to the invoice's PaymentIntent.
type InvoicePaymentSettingsPaymentMethodOptionsParams struct {
// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent.
ACSSDebit *InvoicePaymentSettingsPaymentMethodOptionsACSSDebitParams `form:"acss_debit"`
// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent.
Bancontact *InvoicePaymentSettingsPaymentMethodOptionsBancontactParams `form:"bancontact"`
// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent.
Card *InvoicePaymentSettingsPaymentMethodOptionsCardParams `form:"card"`
// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent.
CustomerBalance *InvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceParams `form:"customer_balance"`
// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent.
Konbini *InvoicePaymentSettingsPaymentMethodOptionsKonbiniParams `form:"konbini"`
// If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent.
SEPADebit *InvoicePaymentSettingsPaymentMethodOptionsSEPADebitParams `form:"sepa_debit"`
// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent.
USBankAccount *InvoicePaymentSettingsPaymentMethodOptionsUSBankAccountParams `form:"us_bank_account"`
}
// Configuration settings for the PaymentIntent that is generated when the invoice is finalized.
type InvoicePaymentSettingsParams struct {
// ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.
DefaultMandate *string `form:"default_mandate"`
// Payment-method-specific configuration to provide to the invoice's PaymentIntent.
PaymentMethodOptions *InvoicePaymentSettingsPaymentMethodOptionsParams `form:"payment_method_options"`
// The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice).
PaymentMethodTypes []*string `form:"payment_method_types"`
}
// Invoice pdf rendering options
type InvoiceRenderingPDFParams struct {
// Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`.
// If set to `auto`, invoice PDF page size defaults to `a4` for customers with
// Japanese locale and `letter` for customers with other locales.
PageSize *string `form:"page_size"`
}
// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page.
type InvoiceRenderingParams struct {
// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
AmountTaxDisplay *string `form:"amount_tax_display"`
// Invoice pdf rendering options
PDF *InvoiceRenderingPDFParams `form:"pdf"`
}
// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
type InvoiceShippingCostShippingRateDataDeliveryEstimateMaximumParams struct {
// A unit of time.
Unit *string `form:"unit"`
// Must be greater than 0.
Value *int64 `form:"value"`
}
// The lower bound of the estimated range. If empty, represents no lower bound.
type InvoiceShippingCostShippingRateDataDeliveryEstimateMinimumParams struct {
// A unit of time.
Unit *string `form:"unit"`
// Must be greater than 0.
Value *int64 `form:"value"`
}
// The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
type InvoiceShippingCostShippingRateDataDeliveryEstimateParams struct {
// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.
Maximum *InvoiceShippingCostShippingRateDataDeliveryEstimateMaximumParams `form:"maximum"`
// The lower bound of the estimated range. If empty, represents no lower bound.
Minimum *InvoiceShippingCostShippingRateDataDeliveryEstimateMinimumParams `form:"minimum"`
}
// Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
type InvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsParams struct {
// A non-negative integer in cents representing how much to charge.
Amount *int64 `form:"amount"`
// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
TaxBehavior *string `form:"tax_behavior"`
}
// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
type InvoiceShippingCostShippingRateDataFixedAmountParams struct {
// A non-negative integer in cents representing how much to charge.
Amount *int64 `form:"amount"`
// 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).
Currency *string `form:"currency"`
// Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).
CurrencyOptions map[string]*InvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsParams `form:"currency_options"`
}
// Parameters to create a new ad-hoc shipping rate for this order.
type InvoiceShippingCostShippingRateDataParams struct {
// The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.
DeliveryEstimate *InvoiceShippingCostShippingRateDataDeliveryEstimateParams `form:"delivery_estimate"`
// The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.
DisplayName *string `form:"display_name"`
// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.
FixedAmount *InvoiceShippingCostShippingRateDataFixedAmountParams `form:"fixed_amount"`
// 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`.
Metadata map[string]string `form:"metadata"`
// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.
TaxBehavior *string `form:"tax_behavior"`
// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.
TaxCode *string `form:"tax_code"`
// The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now.
Type *string `form:"type"`
}
// AddMetadata adds a new key-value pair to the Metadata.
func (p *InvoiceShippingCostShippingRateDataParams) AddMetadata(key string, value string) {
if p.Metadata == nil {
p.Metadata = make(map[string]string)
}
p.Metadata[key] = value
}
// Settings for the cost of shipping for this invoice.
type InvoiceShippingCostParams struct {
// The ID of the shipping rate to use for this order.
ShippingRate *string `form:"shipping_rate"`
// Parameters to create a new ad-hoc shipping rate for this order.
ShippingRateData *InvoiceShippingCostShippingRateDataParams `form:"shipping_rate_data"`
}
// Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer.
type InvoiceShippingDetailsParams struct {
// Shipping address
Address *AddressParams `form:"address"`
// Recipient name.
Name *string `form:"name"`
// Recipient phone (including extension)
Phone *string `form:"phone"`
}
// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value.
type InvoiceTransferDataParams struct {
// The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
Amount *int64 `form:"amount"`
// ID of an existing, connected Stripe account.
Destination *string `form:"destination"`
}
// You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first.
type InvoiceListParams struct {
ListParams `form:"*"`
// The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`.
CollectionMethod *string `form:"collection_method"`
// Only return invoices that were created during the given date interval.
Created *int64 `form:"created"`
// Only return invoices that were created during the given date interval.
CreatedRange *RangeQueryParams `form:"created"`
// Only return invoices for the customer specified by this customer ID.
Customer *string `form:"customer"`
DueDate *int64 `form:"due_date"`
DueDateRange *RangeQueryParams `form:"due_date"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview)
Status *string `form:"status"`
// Only return invoices for the subscription specified by this subscription ID.
Subscription *string `form:"subscription"`
}
// AddExpand appends a new field to expand.
func (p *InvoiceListParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}
// Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details.
type InvoiceFromInvoiceParams struct {
// The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted
Action *string `form:"action"`
// The `id` of the invoice that will be cloned.
Invoice *string `form:"invoice"`
}
// Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language).
// Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating
// conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up
// to an hour behind during outages. Search functionality is not available to merchants in India.
type InvoiceSearchParams struct {
SearchParams `form:"*"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
Page *string `form:"page"`
}
// AddExpand appends a new field to expand.
func (p *InvoiceSearchParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}
type InvoiceUpcomingAutomaticTaxParams struct {
Enabled *bool `form:"enabled"`
}
// The customer's shipping information. Appears on invoices emailed to this customer.
type InvoiceUpcomingCustomerDetailsShippingParams struct {
// Customer shipping address.
Address *AddressParams `form:"address"`
// Customer name.
Name *string `form:"name"`
// Customer phone (including extension).
Phone *string `form:"phone"`
}
// Tax details about the customer.
type InvoiceUpcomingCustomerDetailsTaxParams struct {
// A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
IPAddress *string `form:"ip_address"`
}
// The customer's tax IDs.
type InvoiceUpcomingCustomerDetailsTaxIDParams struct {
// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`
Type *string `form:"type"`
// Value of the tax ID.
Value *string `form:"value"`
}
// Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
type InvoiceUpcomingCustomerDetailsParams struct {
// The customer's address.
Address *AddressParams `form:"address"`
// The customer's shipping information. Appears on invoices emailed to this customer.
Shipping *InvoiceUpcomingCustomerDetailsShippingParams `form:"shipping"`
// Tax details about the customer.
Tax *InvoiceUpcomingCustomerDetailsTaxParams `form:"tax"`
// The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
TaxExempt *string `form:"tax_exempt"`
// The customer's tax IDs.
TaxIDs []*InvoiceUpcomingCustomerDetailsTaxIDParams `form:"tax_ids"`
}
// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
type InvoiceUpcomingInvoiceItemPeriodParams struct {
// The end of the period, which must be greater than or equal to the start. This value is inclusive.
End *int64 `form:"end"`
// The start of the period. This value is inclusive.
Start *int64 `form:"start"`
}
// List of invoice items to add or update in the upcoming invoice preview.
type InvoiceUpcomingInvoiceItemParams struct {
// The integer amount in cents (or local equivalent) of previewed invoice item.
Amount *int64 `form:"amount"`
// 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). Only applicable to new invoice items.
Currency *string `form:"currency"`
// An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
Description *string `form:"description"`
// Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
Discountable *bool `form:"discountable"`
// The coupons to redeem into discounts for the invoice item in the preview.
Discounts []*InvoiceItemDiscountParams `form:"discounts"`
// The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
InvoiceItem *string `form:"invoiceitem"`
// 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`.
Metadata map[string]string `form:"metadata"`
// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
Period *InvoiceUpcomingInvoiceItemPeriodParams `form:"period"`
// The ID of the price object.
Price *string `form:"price"`
// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
PriceData *InvoiceItemPriceDataParams `form:"price_data"`
// Non-negative integer. The quantity of units for the invoice item.
Quantity *int64 `form:"quantity"`
// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
TaxBehavior *string `form:"tax_behavior"`
// A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
TaxCode *string `form:"tax_code"`
// The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
TaxRates []*string `form:"tax_rates"`
// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
UnitAmount *int64 `form:"unit_amount"`
// 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.
UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"`
}
// AddMetadata adds a new key-value pair to the Metadata.
func (p *InvoiceUpcomingInvoiceItemParams) AddMetadata(key string, value string) {
if p.Metadata == nil {
p.Metadata = make(map[string]string)
}
p.Metadata[key] = value
}
// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
type InvoiceUpcomingIssuerParams struct {
// The connected account being referenced when `type` is `account`.
Account *string `form:"account"`
// Type of the account referenced in the request.
Type *string `form:"type"`
}
// At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice.
//
// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount.
//
// You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_proration_date value passed in the request.
type InvoiceUpcomingParams struct {
Params `form:"*"`
// Settings for automatic tax lookup for this invoice preview.
AutomaticTax *InvoiceAutomaticTaxParams `form:"automatic_tax"`
// The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead.
Coupon *string `form:"coupon"`
// The currency to preview this invoice in. Defaults to that of `customer` if not specified.
Currency *string `form:"currency"`
// The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
Customer *string `form:"customer"`
// Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
CustomerDetails *InvoiceUpcomingCustomerDetailsParams `form:"customer_details"`
// The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
Discounts []*InvoiceDiscountParams `form:"discounts"`
// Specifies which fields in the response should be expanded.
Expand []*string `form:"expand"`
// List of invoice items to add or update in the upcoming invoice preview.
InvoiceItems []*InvoiceUpcomingInvoiceItemParams `form:"invoice_items"`
// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
Issuer *InvoiceUpcomingIssuerParams `form:"issuer"`
// The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details.
OnBehalfOf *string `form:"on_behalf_of"`
// The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
Schedule *string `form:"schedule"`
// The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions.
Subscription *string `form:"subscription"`
// For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
SubscriptionBillingCycleAnchor *int64 `form:"subscription_billing_cycle_anchor"`
SubscriptionBillingCycleAnchorNow *bool `form:"-"` // See custom AppendTo
SubscriptionBillingCycleAnchorUnchanged *bool `form:"-"` // See custom AppendTo
// A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.
SubscriptionCancelAt *int64 `form:"subscription_cancel_at"`
// Boolean indicating whether this subscription should cancel at the end of the current period.
SubscriptionCancelAtPeriodEnd *bool `form:"subscription_cancel_at_period_end"`
// This simulates the subscription being canceled or expired immediately.
SubscriptionCancelNow *bool `form:"subscription_cancel_now"`
// If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set.
SubscriptionDefaultTaxRates []*string `form:"subscription_default_tax_rates"`
// A list of up to 20 subscription items, each with an attached price.
SubscriptionItems []*SubscriptionItemsParams `form:"subscription_items"`
// Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`.
SubscriptionProrationBehavior *string `form:"subscription_proration_behavior"`
// If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'.
SubscriptionProrationDate *int64 `form:"subscription_proration_date"`
// For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
SubscriptionResumeAt *string `form:"subscription_resume_at"`
// Date a subscription is intended to start (can be future or past).
SubscriptionStartDate *int64 `form:"subscription_start_date"`
// If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required.
SubscriptionTrialEnd *int64 `form:"subscription_trial_end"`
SubscriptionTrialEndNow *bool `form:"-"` // See custom AppendTo
// Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.
SubscriptionTrialFromPlan *bool `form:"subscription_trial_from_plan"`
}
// AddExpand appends a new field to expand.
func (p *InvoiceUpcomingParams) AddExpand(f string) {
p.Expand = append(p.Expand, &f)
}
// AppendTo implements custom encoding logic for InvoiceUpcomingParams.
func (p *InvoiceUpcomingParams) AppendTo(body *form.Values, keyParts []string) {
if BoolValue(p.SubscriptionBillingCycleAnchorNow) {
body.Add(form.FormatKey(append(keyParts, "subscription_billing_cycle_anchor")), "now")
}
if BoolValue(p.SubscriptionBillingCycleAnchorUnchanged) {
body.Add(form.FormatKey(append(keyParts, "subscription_billing_cycle_anchor")), "unchanged")
}
if BoolValue(p.SubscriptionTrialEndNow) {
body.Add(form.FormatKey(append(keyParts, "subscription_trial_end")), "now")
}
}
// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
type InvoiceUpcomingLinesAutomaticTaxLiabilityParams struct {
// The connected account being referenced when `type` is `account`.
Account *string `form:"account"`
// Type of the account referenced in the request.
Type *string `form:"type"`
}
// Settings for automatic tax lookup for this invoice preview.
type InvoiceUpcomingLinesAutomaticTaxParams struct {
// Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.
Enabled *bool `form:"enabled"`
// The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account.
Liability *InvoiceUpcomingLinesAutomaticTaxLiabilityParams `form:"liability"`
}
// The customer's shipping information. Appears on invoices emailed to this customer.
type InvoiceUpcomingLinesCustomerDetailsShippingParams struct {
// Customer shipping address.
Address *AddressParams `form:"address"`
// Customer name.
Name *string `form:"name"`
// Customer phone (including extension).
Phone *string `form:"phone"`
}
// Tax details about the customer.
type InvoiceUpcomingLinesCustomerDetailsTaxParams struct {
// A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes.
IPAddress *string `form:"ip_address"`
}
// The customer's tax IDs.
type InvoiceUpcomingLinesCustomerDetailsTaxIDParams struct {
// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `no_voec`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`
Type *string `form:"type"`
// Value of the tax ID.
Value *string `form:"value"`
}
// Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
type InvoiceUpcomingLinesCustomerDetailsParams struct {
// The customer's address.
Address *AddressParams `form:"address"`
// The customer's shipping information. Appears on invoices emailed to this customer.
Shipping *InvoiceUpcomingLinesCustomerDetailsShippingParams `form:"shipping"`
// Tax details about the customer.
Tax *InvoiceUpcomingLinesCustomerDetailsTaxParams `form:"tax"`
// The customer's tax exemption. One of `none`, `exempt`, or `reverse`.
TaxExempt *string `form:"tax_exempt"`
// The customer's tax IDs.
TaxIDs []*InvoiceUpcomingLinesCustomerDetailsTaxIDParams `form:"tax_ids"`
}
// The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
type InvoiceUpcomingLinesDiscountParams struct {
// ID of the coupon to create a new discount for.
Coupon *string `form:"coupon"`
// ID of an existing discount on the object (or one of its ancestors) to reuse.
Discount *string `form:"discount"`
// ID of the promotion code to create a new discount for.
PromotionCode *string `form:"promotion_code"`
}
// The coupons to redeem into discounts for the invoice item in the preview.
type InvoiceUpcomingLinesInvoiceItemDiscountParams struct {
// ID of the coupon to create a new discount for.
Coupon *string `form:"coupon"`
// ID of an existing discount on the object (or one of its ancestors) to reuse.
Discount *string `form:"discount"`
// ID of the promotion code to create a new discount for.
PromotionCode *string `form:"promotion_code"`
}
// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
type InvoiceUpcomingLinesInvoiceItemPeriodParams struct {
// The end of the period, which must be greater than or equal to the start. This value is inclusive.
End *int64 `form:"end"`
// The start of the period. This value is inclusive.
Start *int64 `form:"start"`
}
// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
type InvoiceUpcomingLinesInvoiceItemPriceDataParams struct {
// 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).
Currency *string `form:"currency"`
// The ID of the product that this price will belong to.
Product *string `form:"product"`
// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
TaxBehavior *string `form:"tax_behavior"`
// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
UnitAmount *int64 `form:"unit_amount"`
// 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.
UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"`
}
// List of invoice items to add or update in the upcoming invoice preview.
type InvoiceUpcomingLinesInvoiceItemParams struct {
// The integer amount in cents (or local equivalent) of previewed invoice item.
Amount *int64 `form:"amount"`
// 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). Only applicable to new invoice items.
Currency *string `form:"currency"`
// An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.
Description *string `form:"description"`
// Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.
Discountable *bool `form:"discountable"`
// The coupons to redeem into discounts for the invoice item in the preview.
Discounts []*InvoiceUpcomingLinesInvoiceItemDiscountParams `form:"discounts"`
// The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.
InvoiceItem *string `form:"invoiceitem"`
// 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`.
Metadata map[string]string `form:"metadata"`
// The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
Period *InvoiceUpcomingLinesInvoiceItemPeriodParams `form:"period"`
// The ID of the price object.
Price *string `form:"price"`
// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.
PriceData *InvoiceUpcomingLinesInvoiceItemPriceDataParams `form:"price_data"`
// Non-negative integer. The quantity of units for the invoice item.
Quantity *int64 `form:"quantity"`
// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.
TaxBehavior *string `form:"tax_behavior"`
// A [tax code](https://stripe.com/docs/tax/tax-categories) ID.
TaxCode *string `form:"tax_code"`
// The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item.
TaxRates []*string `form:"tax_rates"`
// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.
UnitAmount *int64 `form:"unit_amount"`
// 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.
UnitAmountDecimal *float64 `form:"unit_amount_decimal,high_precision"`
}
// AddMetadata adds a new key-value pair to the Metadata.
func (p *InvoiceUpcomingLinesInvoiceItemParams) AddMetadata(key string, value string) {
if p.Metadata == nil {
p.Metadata = make(map[string]string)
}
p.Metadata[key] = value
}
// The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
type InvoiceUpcomingLinesIssuerParams struct {
// The connected account being referenced when `type` is `account`.
Account *string `form:"account"`
// Type of the account referenced in the request.
Type *string `form:"type"`
}
// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds.
type InvoiceUpcomingLinesSubscriptionItemBillingThresholdsParams struct {
// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte))
UsageGTE *int64 `form:"usage_gte"`
}
// The coupons to redeem into discounts for the subscription item.
type InvoiceUpcomingLinesSubscriptionItemDiscountParams struct {
// ID of the coupon to create a new discount for.
Coupon *string `form:"coupon"`
// ID of an existing discount on the object (or one of its ancestors) to reuse.
Discount *string `form:"discount"`
// ID of the promotion code to create a new discount for.
PromotionCode *string `form:"promotion_code"`
}
// The recurring components of a price such as `interval` and `interval_count`.
type InvoiceUpcomingLinesSubscriptionItemPriceDataRecurringParams struct {
// Specifies billing frequency. Either `day`, `week`, `month` or `year`.
Interval *string `form:"interval"`
// The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).
IntervalCount *int64 `form:"interval_count"`