orb-billing 5.9.0 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -189,7 +189,7 @@ export interface ChangedSubscriptionResources {
189
189
  /**
190
190
  * The invoices that were created as part of this operation.
191
191
  */
192
- created_invoices: Array<Invoice>;
192
+ created_invoices: Array<ChangedSubscriptionResources.CreatedInvoice>;
193
193
 
194
194
  /**
195
195
  * The credit notes that were voided as part of this operation.
@@ -202,6 +202,623 @@ export interface ChangedSubscriptionResources {
202
202
  voided_invoices: Array<Invoice>;
203
203
  }
204
204
 
205
+ export namespace ChangedSubscriptionResources {
206
+ export interface CreatedInvoice {
207
+ id: string;
208
+
209
+ /**
210
+ * This is the final amount required to be charged to the customer and reflects the
211
+ * application of the customer balance to the `total` of the invoice.
212
+ */
213
+ amount_due: string;
214
+
215
+ auto_collection: CreatedInvoice.AutoCollection;
216
+
217
+ billing_address: Shared.Address | null;
218
+
219
+ /**
220
+ * The creation time of the resource in Orb.
221
+ */
222
+ created_at: string;
223
+
224
+ /**
225
+ * A list of credit notes associated with the invoice
226
+ */
227
+ credit_notes: Array<CreatedInvoice.CreditNote>;
228
+
229
+ /**
230
+ * An ISO 4217 currency string or `credits`
231
+ */
232
+ currency: string;
233
+
234
+ customer: Shared.CustomerMinified;
235
+
236
+ customer_balance_transactions: Array<CreatedInvoice.CustomerBalanceTransaction>;
237
+
238
+ /**
239
+ * Tax IDs are commonly required to be displayed on customer invoices, which are
240
+ * added to the headers of invoices.
241
+ *
242
+ * ### Supported Tax ID Countries and Types
243
+ *
244
+ * | Country | Type | Description |
245
+ * | ---------------------- | ------------ | ------------------------------------------------------------------------------------------------------- |
246
+ * | Albania | `al_tin` | Albania Tax Identification Number |
247
+ * | Andorra | `ad_nrt` | Andorran NRT Number |
248
+ * | Angola | `ao_tin` | Angola Tax Identification Number |
249
+ * | Argentina | `ar_cuit` | Argentinian Tax ID Number |
250
+ * | Armenia | `am_tin` | Armenia Tax Identification Number |
251
+ * | Aruba | `aw_tin` | Aruba Tax Identification Number |
252
+ * | Australia | `au_abn` | Australian Business Number (AU ABN) |
253
+ * | Australia | `au_arn` | Australian Taxation Office Reference Number |
254
+ * | Austria | `eu_vat` | European VAT Number |
255
+ * | Azerbaijan | `az_tin` | Azerbaijan Tax Identification Number |
256
+ * | Bahamas | `bs_tin` | Bahamas Tax Identification Number |
257
+ * | Bahrain | `bh_vat` | Bahraini VAT Number |
258
+ * | Bangladesh | `bd_bin` | Bangladesh Business Identification Number |
259
+ * | Barbados | `bb_tin` | Barbados Tax Identification Number |
260
+ * | Belarus | `by_tin` | Belarus TIN Number |
261
+ * | Belgium | `eu_vat` | European VAT Number |
262
+ * | Benin | `bj_ifu` | Benin Tax Identification Number (Identifiant Fiscal Unique) |
263
+ * | Bolivia | `bo_tin` | Bolivian Tax ID |
264
+ * | Bosnia and Herzegovina | `ba_tin` | Bosnia and Herzegovina Tax Identification Number |
265
+ * | Brazil | `br_cnpj` | Brazilian CNPJ Number |
266
+ * | Brazil | `br_cpf` | Brazilian CPF Number |
267
+ * | Bulgaria | `bg_uic` | Bulgaria Unified Identification Code |
268
+ * | Bulgaria | `eu_vat` | European VAT Number |
269
+ * | Burkina Faso | `bf_ifu` | Burkina Faso Tax Identification Number (Numéro d'Identifiant Fiscal Unique) |
270
+ * | Cambodia | `kh_tin` | Cambodia Tax Identification Number |
271
+ * | Cameroon | `cm_niu` | Cameroon Tax Identification Number (Numéro d'Identifiant fiscal Unique) |
272
+ * | Canada | `ca_bn` | Canadian BN |
273
+ * | Canada | `ca_gst_hst` | Canadian GST/HST Number |
274
+ * | Canada | `ca_pst_bc` | Canadian PST Number (British Columbia) |
275
+ * | Canada | `ca_pst_mb` | Canadian PST Number (Manitoba) |
276
+ * | Canada | `ca_pst_sk` | Canadian PST Number (Saskatchewan) |
277
+ * | Canada | `ca_qst` | Canadian QST Number (Québec) |
278
+ * | Cape Verde | `cv_nif` | Cape Verde Tax Identification Number (Número de Identificação Fiscal) |
279
+ * | Chile | `cl_tin` | Chilean TIN |
280
+ * | China | `cn_tin` | Chinese Tax ID |
281
+ * | Colombia | `co_nit` | Colombian NIT Number |
282
+ * | Congo-Kinshasa | `cd_nif` | Congo (DR) Tax Identification Number (Número de Identificação Fiscal) |
283
+ * | Costa Rica | `cr_tin` | Costa Rican Tax ID |
284
+ * | Croatia | `eu_vat` | European VAT Number |
285
+ * | Croatia | `hr_oib` | Croatian Personal Identification Number (OIB) |
286
+ * | Cyprus | `eu_vat` | European VAT Number |
287
+ * | Czech Republic | `eu_vat` | European VAT Number |
288
+ * | Denmark | `eu_vat` | European VAT Number |
289
+ * | Dominican Republic | `do_rcn` | Dominican RCN Number |
290
+ * | Ecuador | `ec_ruc` | Ecuadorian RUC Number |
291
+ * | Egypt | `eg_tin` | Egyptian Tax Identification Number |
292
+ * | El Salvador | `sv_nit` | El Salvadorian NIT Number |
293
+ * | Estonia | `eu_vat` | European VAT Number |
294
+ * | Ethiopia | `et_tin` | Ethiopia Tax Identification Number |
295
+ * | European Union | `eu_oss_vat` | European One Stop Shop VAT Number for non-Union scheme |
296
+ * | Finland | `eu_vat` | European VAT Number |
297
+ * | France | `eu_vat` | European VAT Number |
298
+ * | Georgia | `ge_vat` | Georgian VAT |
299
+ * | Germany | `de_stn` | German Tax Number (Steuernummer) |
300
+ * | Germany | `eu_vat` | European VAT Number |
301
+ * | Greece | `eu_vat` | European VAT Number |
302
+ * | Guinea | `gn_nif` | Guinea Tax Identification Number (Número de Identificação Fiscal) |
303
+ * | Hong Kong | `hk_br` | Hong Kong BR Number |
304
+ * | Hungary | `eu_vat` | European VAT Number |
305
+ * | Hungary | `hu_tin` | Hungary Tax Number (adószám) |
306
+ * | Iceland | `is_vat` | Icelandic VAT |
307
+ * | India | `in_gst` | Indian GST Number |
308
+ * | Indonesia | `id_npwp` | Indonesian NPWP Number |
309
+ * | Ireland | `eu_vat` | European VAT Number |
310
+ * | Israel | `il_vat` | Israel VAT |
311
+ * | Italy | `eu_vat` | European VAT Number |
312
+ * | Japan | `jp_cn` | Japanese Corporate Number (_Hōjin Bangō_) |
313
+ * | Japan | `jp_rn` | Japanese Registered Foreign Businesses' Registration Number (_Tōroku Kokugai Jigyōsha no Tōroku Bangō_) |
314
+ * | Japan | `jp_trn` | Japanese Tax Registration Number (_Tōroku Bangō_) |
315
+ * | Kazakhstan | `kz_bin` | Kazakhstani Business Identification Number |
316
+ * | Kenya | `ke_pin` | Kenya Revenue Authority Personal Identification Number |
317
+ * | Kyrgyzstan | `kg_tin` | Kyrgyzstan Tax Identification Number |
318
+ * | Laos | `la_tin` | Laos Tax Identification Number |
319
+ * | Latvia | `eu_vat` | European VAT Number |
320
+ * | Liechtenstein | `li_uid` | Liechtensteinian UID Number |
321
+ * | Liechtenstein | `li_vat` | Liechtenstein VAT Number |
322
+ * | Lithuania | `eu_vat` | European VAT Number |
323
+ * | Luxembourg | `eu_vat` | European VAT Number |
324
+ * | Malaysia | `my_frp` | Malaysian FRP Number |
325
+ * | Malaysia | `my_itn` | Malaysian ITN |
326
+ * | Malaysia | `my_sst` | Malaysian SST Number |
327
+ * | Malta | `eu_vat` | European VAT Number |
328
+ * | Mauritania | `mr_nif` | Mauritania Tax Identification Number (Número de Identificação Fiscal) |
329
+ * | Mexico | `mx_rfc` | Mexican RFC Number |
330
+ * | Moldova | `md_vat` | Moldova VAT Number |
331
+ * | Montenegro | `me_pib` | Montenegro PIB Number |
332
+ * | Morocco | `ma_vat` | Morocco VAT Number |
333
+ * | Nepal | `np_pan` | Nepal PAN Number |
334
+ * | Netherlands | `eu_vat` | European VAT Number |
335
+ * | New Zealand | `nz_gst` | New Zealand GST Number |
336
+ * | Nigeria | `ng_tin` | Nigerian Tax Identification Number |
337
+ * | North Macedonia | `mk_vat` | North Macedonia VAT Number |
338
+ * | Northern Ireland | `eu_vat` | Northern Ireland VAT Number |
339
+ * | Norway | `no_vat` | Norwegian VAT Number |
340
+ * | Norway | `no_voec` | Norwegian VAT on e-commerce Number |
341
+ * | Oman | `om_vat` | Omani VAT Number |
342
+ * | Peru | `pe_ruc` | Peruvian RUC Number |
343
+ * | Philippines | `ph_tin` | Philippines Tax Identification Number |
344
+ * | Poland | `eu_vat` | European VAT Number |
345
+ * | Portugal | `eu_vat` | European VAT Number |
346
+ * | Romania | `eu_vat` | European VAT Number |
347
+ * | Romania | `ro_tin` | Romanian Tax ID Number |
348
+ * | Russia | `ru_inn` | Russian INN |
349
+ * | Russia | `ru_kpp` | Russian KPP |
350
+ * | Saudi Arabia | `sa_vat` | Saudi Arabia VAT |
351
+ * | Senegal | `sn_ninea` | Senegal NINEA Number |
352
+ * | Serbia | `rs_pib` | Serbian PIB Number |
353
+ * | Singapore | `sg_gst` | Singaporean GST |
354
+ * | Singapore | `sg_uen` | Singaporean UEN |
355
+ * | Slovakia | `eu_vat` | European VAT Number |
356
+ * | Slovenia | `eu_vat` | European VAT Number |
357
+ * | Slovenia | `si_tin` | Slovenia Tax Number (davčna številka) |
358
+ * | South Africa | `za_vat` | South African VAT Number |
359
+ * | South Korea | `kr_brn` | Korean BRN |
360
+ * | Spain | `es_cif` | Spanish NIF Number (previously Spanish CIF Number) |
361
+ * | Spain | `eu_vat` | European VAT Number |
362
+ * | Suriname | `sr_fin` | Suriname FIN Number |
363
+ * | Sweden | `eu_vat` | European VAT Number |
364
+ * | Switzerland | `ch_uid` | Switzerland UID Number |
365
+ * | Switzerland | `ch_vat` | Switzerland VAT Number |
366
+ * | Taiwan | `tw_vat` | Taiwanese VAT |
367
+ * | Tajikistan | `tj_tin` | Tajikistan Tax Identification Number |
368
+ * | Tanzania | `tz_vat` | Tanzania VAT Number |
369
+ * | Thailand | `th_vat` | Thai VAT |
370
+ * | Turkey | `tr_tin` | Turkish Tax Identification Number |
371
+ * | Uganda | `ug_tin` | Uganda Tax Identification Number |
372
+ * | Ukraine | `ua_vat` | Ukrainian VAT |
373
+ * | United Arab Emirates | `ae_trn` | United Arab Emirates TRN |
374
+ * | United Kingdom | `gb_vat` | United Kingdom VAT Number |
375
+ * | United States | `us_ein` | United States EIN |
376
+ * | Uruguay | `uy_ruc` | Uruguayan RUC Number |
377
+ * | Uzbekistan | `uz_tin` | Uzbekistan TIN Number |
378
+ * | Uzbekistan | `uz_vat` | Uzbekistan VAT Number |
379
+ * | Venezuela | `ve_rif` | Venezuelan RIF Number |
380
+ * | Vietnam | `vn_tin` | Vietnamese Tax ID Number |
381
+ * | Zambia | `zm_tin` | Zambia Tax Identification Number |
382
+ * | Zimbabwe | `zw_tin` | Zimbabwe Tax Identification Number |
383
+ */
384
+ customer_tax_id: Shared.CustomerTaxID | null;
385
+
386
+ /**
387
+ * @deprecated This field is deprecated in favor of `discounts`. If a `discounts`
388
+ * list is provided, the first discount in the list will be returned. If the list
389
+ * is empty, `None` will be returned.
390
+ */
391
+ discount: unknown;
392
+
393
+ discounts: Array<Shared.InvoiceLevelDiscount>;
394
+
395
+ /**
396
+ * When the invoice payment is due. The due date is null if the invoice is not yet
397
+ * finalized.
398
+ */
399
+ due_date: string | null;
400
+
401
+ /**
402
+ * If the invoice has a status of `draft`, this will be the time that the invoice
403
+ * will be eligible to be issued, otherwise it will be `null`. If `auto-issue` is
404
+ * true, the invoice will automatically begin issuing at this time.
405
+ */
406
+ eligible_to_issue_at: string | null;
407
+
408
+ /**
409
+ * A URL for the customer-facing invoice portal. This URL expires 30 days after the
410
+ * invoice's due date, or 60 days after being re-generated through the UI.
411
+ */
412
+ hosted_invoice_url: string | null;
413
+
414
+ /**
415
+ * The scheduled date of the invoice
416
+ */
417
+ invoice_date: string;
418
+
419
+ /**
420
+ * Automatically generated invoice number to help track and reconcile invoices.
421
+ * Invoice numbers have a prefix such as `RFOBWG`. These can be sequential per
422
+ * account or customer.
423
+ */
424
+ invoice_number: string;
425
+
426
+ /**
427
+ * The link to download the PDF representation of the `Invoice`.
428
+ */
429
+ invoice_pdf: string | null;
430
+
431
+ invoice_source: 'subscription' | 'partial' | 'one_off';
432
+
433
+ /**
434
+ * True if the invoice has only in-advance fixed fees and is payable now
435
+ */
436
+ is_payable_now: boolean;
437
+
438
+ /**
439
+ * If the invoice failed to issue, this will be the last time it failed to issue
440
+ * (even if it is now in a different state.)
441
+ */
442
+ issue_failed_at: string | null;
443
+
444
+ /**
445
+ * If the invoice has been issued, this will be the time it transitioned to
446
+ * `issued` (even if it is now in a different state.)
447
+ */
448
+ issued_at: string | null;
449
+
450
+ /**
451
+ * The breakdown of prices in this invoice.
452
+ */
453
+ line_items: Array<CreatedInvoice.LineItem>;
454
+
455
+ maximum: Shared.Maximum | null;
456
+
457
+ maximum_amount: string | null;
458
+
459
+ /**
460
+ * Free-form text which is available on the invoice PDF and the Orb invoice portal.
461
+ */
462
+ memo: string | null;
463
+
464
+ /**
465
+ * User specified key-value pairs for the resource. If not present, this defaults
466
+ * to an empty dictionary. Individual keys can be removed by setting the value to
467
+ * `null`, and the entire metadata mapping can be cleared by setting `metadata` to
468
+ * `null`.
469
+ */
470
+ metadata: { [key: string]: string };
471
+
472
+ minimum: Shared.Minimum | null;
473
+
474
+ minimum_amount: string | null;
475
+
476
+ /**
477
+ * If the invoice has a status of `paid`, this gives a timestamp when the invoice
478
+ * was paid.
479
+ */
480
+ paid_at: string | null;
481
+
482
+ /**
483
+ * A list of payment attempts associated with the invoice
484
+ */
485
+ payment_attempts: Array<CreatedInvoice.PaymentAttempt>;
486
+
487
+ /**
488
+ * If payment was attempted on this invoice but failed, this will be the time of
489
+ * the most recent attempt.
490
+ */
491
+ payment_failed_at: string | null;
492
+
493
+ /**
494
+ * If payment was attempted on this invoice, this will be the start time of the
495
+ * most recent attempt. This field is especially useful for delayed-notification
496
+ * payment mechanisms (like bank transfers), where payment can take 3 days or more.
497
+ */
498
+ payment_started_at: string | null;
499
+
500
+ /**
501
+ * If the invoice is in draft, this timestamp will reflect when the invoice is
502
+ * scheduled to be issued.
503
+ */
504
+ scheduled_issue_at: string | null;
505
+
506
+ shipping_address: Shared.Address | null;
507
+
508
+ status: 'issued' | 'paid' | 'synced' | 'void' | 'draft';
509
+
510
+ subscription: Shared.SubscriptionMinified | null;
511
+
512
+ /**
513
+ * The total before any discounts and minimums are applied.
514
+ */
515
+ subtotal: string;
516
+
517
+ /**
518
+ * If the invoice failed to sync, this will be the last time an external invoicing
519
+ * provider sync was attempted. This field will always be `null` for invoices using
520
+ * Orb Invoicing.
521
+ */
522
+ sync_failed_at: string | null;
523
+
524
+ /**
525
+ * The total after any minimums and discounts have been applied.
526
+ */
527
+ total: string;
528
+
529
+ /**
530
+ * If the invoice has a status of `void`, this gives a timestamp when the invoice
531
+ * was voided.
532
+ */
533
+ voided_at: string | null;
534
+
535
+ /**
536
+ * This is true if the invoice will be automatically issued in the future, and
537
+ * false otherwise.
538
+ */
539
+ will_auto_issue: boolean;
540
+ }
541
+
542
+ export namespace CreatedInvoice {
543
+ export interface AutoCollection {
544
+ /**
545
+ * True only if auto-collection is enabled for this invoice.
546
+ */
547
+ enabled: boolean | null;
548
+
549
+ /**
550
+ * If the invoice is scheduled for auto-collection, this field will reflect when
551
+ * the next attempt will occur. If dunning has been exhausted, or auto-collection
552
+ * is not enabled for this invoice, this field will be `null`.
553
+ */
554
+ next_attempt_at: string | null;
555
+
556
+ /**
557
+ * Number of auto-collection payment attempts.
558
+ */
559
+ num_attempts: number | null;
560
+
561
+ /**
562
+ * If Orb has ever attempted payment auto-collection for this invoice, this field
563
+ * will reflect when that attempt occurred. In conjunction with `next_attempt_at`,
564
+ * this can be used to tell whether the invoice is currently in dunning (that is,
565
+ * `previously_attempted_at` is non-null, and `next_attempt_time` is non-null), or
566
+ * if dunning has been exhausted (`previously_attempted_at` is non-null, but
567
+ * `next_attempt_time` is null).
568
+ */
569
+ previously_attempted_at: string | null;
570
+ }
571
+
572
+ export interface CreditNote {
573
+ id: string;
574
+
575
+ credit_note_number: string;
576
+
577
+ /**
578
+ * An optional memo supplied on the credit note.
579
+ */
580
+ memo: string | null;
581
+
582
+ reason: string;
583
+
584
+ total: string;
585
+
586
+ type: string;
587
+
588
+ /**
589
+ * If the credit note has a status of `void`, this gives a timestamp when the
590
+ * credit note was voided.
591
+ */
592
+ voided_at: string | null;
593
+ }
594
+
595
+ export interface CustomerBalanceTransaction {
596
+ /**
597
+ * A unique id for this transaction.
598
+ */
599
+ id: string;
600
+
601
+ action:
602
+ | 'applied_to_invoice'
603
+ | 'manual_adjustment'
604
+ | 'prorated_refund'
605
+ | 'revert_prorated_refund'
606
+ | 'return_from_voiding'
607
+ | 'credit_note_applied'
608
+ | 'credit_note_voided'
609
+ | 'overpayment_refund'
610
+ | 'external_payment'
611
+ | 'small_invoice_carryover';
612
+
613
+ /**
614
+ * The value of the amount changed in the transaction.
615
+ */
616
+ amount: string;
617
+
618
+ /**
619
+ * The creation time of this transaction.
620
+ */
621
+ created_at: string;
622
+
623
+ credit_note: Shared.CreditNoteTiny | null;
624
+
625
+ /**
626
+ * An optional description provided for manual customer balance adjustments.
627
+ */
628
+ description: string | null;
629
+
630
+ /**
631
+ * The new value of the customer's balance prior to the transaction, in the
632
+ * customer's currency.
633
+ */
634
+ ending_balance: string;
635
+
636
+ invoice: Shared.InvoiceTiny | null;
637
+
638
+ /**
639
+ * The original value of the customer's balance prior to the transaction, in the
640
+ * customer's currency.
641
+ */
642
+ starting_balance: string;
643
+
644
+ type: 'increment' | 'decrement';
645
+ }
646
+
647
+ export interface LineItem {
648
+ /**
649
+ * A unique ID for this line item.
650
+ */
651
+ id: string;
652
+
653
+ /**
654
+ * The line amount after any adjustments and before overage conversion, credits and
655
+ * partial invoicing.
656
+ */
657
+ adjusted_subtotal: string;
658
+
659
+ /**
660
+ * All adjustments applied to the line item in the order they were applied based on
661
+ * invoice calculations (ie. usage discounts -> amount discounts -> percentage
662
+ * discounts -> minimums -> maximums).
663
+ */
664
+ adjustments: Array<
665
+ | Shared.MonetaryUsageDiscountAdjustment
666
+ | Shared.MonetaryAmountDiscountAdjustment
667
+ | Shared.MonetaryPercentageDiscountAdjustment
668
+ | Shared.MonetaryMinimumAdjustment
669
+ | Shared.MonetaryMaximumAdjustment
670
+ >;
671
+
672
+ /**
673
+ * The final amount for a line item after all adjustments and pre paid credits have
674
+ * been applied.
675
+ */
676
+ amount: string;
677
+
678
+ /**
679
+ * The number of prepaid credits applied.
680
+ */
681
+ credits_applied: string;
682
+
683
+ /**
684
+ * @deprecated This field is deprecated in favor of `adjustments`
685
+ */
686
+ discount: Shared.Discount | null;
687
+
688
+ /**
689
+ * The end date of the range of time applied for this line item's price.
690
+ */
691
+ end_date: string;
692
+
693
+ /**
694
+ * An additional filter that was used to calculate the usage for this line item.
695
+ */
696
+ filter: string | null;
697
+
698
+ /**
699
+ * [DEPRECATED] For configured prices that are split by a grouping key, this will
700
+ * be populated with the key and a value. The `amount` and `subtotal` will be the
701
+ * values for this particular grouping.
702
+ */
703
+ grouping: string | null;
704
+
705
+ /**
706
+ * @deprecated This field is deprecated in favor of `adjustments`.
707
+ */
708
+ maximum: Shared.Maximum | null;
709
+
710
+ /**
711
+ * @deprecated This field is deprecated in favor of `adjustments`.
712
+ */
713
+ maximum_amount: string | null;
714
+
715
+ /**
716
+ * @deprecated This field is deprecated in favor of `adjustments`.
717
+ */
718
+ minimum: Shared.Minimum | null;
719
+
720
+ /**
721
+ * @deprecated This field is deprecated in favor of `adjustments`.
722
+ */
723
+ minimum_amount: string | null;
724
+
725
+ /**
726
+ * The name of the price associated with this line item.
727
+ */
728
+ name: string;
729
+
730
+ /**
731
+ * Any amount applied from a partial invoice
732
+ */
733
+ partially_invoiced_amount: string;
734
+
735
+ /**
736
+ * The Price resource represents a price that can be billed on a subscription,
737
+ * resulting in a charge on an invoice in the form of an invoice line item. Prices
738
+ * take a quantity and determine an amount to bill.
739
+ *
740
+ * Orb supports a few different pricing models out of the box. Each of these models
741
+ * is serialized differently in a given Price object. The model_type field
742
+ * determines the key for the configuration object that is present.
743
+ *
744
+ * For more on the types of prices, see
745
+ * [the core concepts documentation](/core-concepts#plan-and-price)
746
+ */
747
+ price: Shared.Price;
748
+
749
+ /**
750
+ * Either the fixed fee quantity or the usage during the service period.
751
+ */
752
+ quantity: number;
753
+
754
+ /**
755
+ * The start date of the range of time applied for this line item's price.
756
+ */
757
+ start_date: string;
758
+
759
+ /**
760
+ * For complex pricing structures, the line item can be broken down further in
761
+ * `sub_line_items`.
762
+ */
763
+ sub_line_items: Array<Shared.MatrixSubLineItem | Shared.TierSubLineItem | Shared.OtherSubLineItem>;
764
+
765
+ /**
766
+ * The line amount before any adjustments.
767
+ */
768
+ subtotal: string;
769
+
770
+ /**
771
+ * An array of tax rates and their incurred tax amounts. Empty if no tax
772
+ * integration is configured.
773
+ */
774
+ tax_amounts: Array<Shared.TaxAmount>;
775
+
776
+ /**
777
+ * A list of customer ids that were used to calculate the usage for this line item.
778
+ */
779
+ usage_customer_ids: Array<string> | null;
780
+ }
781
+
782
+ export interface PaymentAttempt {
783
+ /**
784
+ * The ID of the payment attempt.
785
+ */
786
+ id: string;
787
+
788
+ /**
789
+ * The amount of the payment attempt.
790
+ */
791
+ amount: string;
792
+
793
+ /**
794
+ * The time at which the payment attempt was created.
795
+ */
796
+ created_at: string;
797
+
798
+ /**
799
+ * The payment provider that attempted to collect the payment.
800
+ */
801
+ payment_provider: 'stripe' | null;
802
+
803
+ /**
804
+ * The ID of the payment attempt in the payment provider.
805
+ */
806
+ payment_provider_id: string | null;
807
+
808
+ /**
809
+ * URL to the downloadable PDF version of the receipt. This field will be `null`
810
+ * for payment attempts that did not succeed.
811
+ */
812
+ receipt_pdf: string | null;
813
+
814
+ /**
815
+ * Whether the payment attempt succeeded.
816
+ */
817
+ succeeded: boolean;
818
+ }
819
+ }
820
+ }
821
+
205
822
  export interface ConversionRateTier {
206
823
  /**
207
824
  * Exclusive tier starting value
@@ -8921,6 +9538,8 @@ export namespace Price {
8921
9538
 
8922
9539
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
8923
9540
 
9541
+ billing_mode: 'in_advance' | 'in_arrear';
9542
+
8924
9543
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
8925
9544
 
8926
9545
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -9008,6 +9627,8 @@ export namespace Price {
9008
9627
 
9009
9628
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9010
9629
 
9630
+ billing_mode: 'in_advance' | 'in_arrear';
9631
+
9011
9632
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
9012
9633
 
9013
9634
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -9095,6 +9716,8 @@ export namespace Price {
9095
9716
 
9096
9717
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9097
9718
 
9719
+ billing_mode: 'in_advance' | 'in_arrear';
9720
+
9098
9721
  /**
9099
9722
  * Configuration for bulk pricing
9100
9723
  */
@@ -9182,6 +9805,8 @@ export namespace Price {
9182
9805
 
9183
9806
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9184
9807
 
9808
+ billing_mode: 'in_advance' | 'in_arrear';
9809
+
9185
9810
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
9186
9811
 
9187
9812
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -9269,6 +9894,8 @@ export namespace Price {
9269
9894
 
9270
9895
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9271
9896
 
9897
+ billing_mode: 'in_advance' | 'in_arrear';
9898
+
9272
9899
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
9273
9900
 
9274
9901
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -9356,6 +9983,8 @@ export namespace Price {
9356
9983
 
9357
9984
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9358
9985
 
9986
+ billing_mode: 'in_advance' | 'in_arrear';
9987
+
9359
9988
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
9360
9989
 
9361
9990
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -9478,6 +10107,8 @@ export namespace Price {
9478
10107
 
9479
10108
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9480
10109
 
10110
+ billing_mode: 'in_advance' | 'in_arrear';
10111
+
9481
10112
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
9482
10113
 
9483
10114
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -9602,6 +10233,8 @@ export namespace Price {
9602
10233
 
9603
10234
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9604
10235
 
10236
+ billing_mode: 'in_advance' | 'in_arrear';
10237
+
9605
10238
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
9606
10239
 
9607
10240
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -9734,6 +10367,8 @@ export namespace Price {
9734
10367
 
9735
10368
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9736
10369
 
10370
+ billing_mode: 'in_advance' | 'in_arrear';
10371
+
9737
10372
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
9738
10373
 
9739
10374
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -9856,6 +10491,8 @@ export namespace Price {
9856
10491
 
9857
10492
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9858
10493
 
10494
+ billing_mode: 'in_advance' | 'in_arrear';
10495
+
9859
10496
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
9860
10497
 
9861
10498
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -9983,6 +10620,8 @@ export namespace Price {
9983
10620
 
9984
10621
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
9985
10622
 
10623
+ billing_mode: 'in_advance' | 'in_arrear';
10624
+
9986
10625
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
9987
10626
 
9988
10627
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -10092,6 +10731,8 @@ export namespace Price {
10092
10731
 
10093
10732
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
10094
10733
 
10734
+ billing_mode: 'in_advance' | 'in_arrear';
10735
+
10095
10736
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
10096
10737
 
10097
10738
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -10196,6 +10837,8 @@ export namespace Price {
10196
10837
 
10197
10838
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
10198
10839
 
10840
+ billing_mode: 'in_advance' | 'in_arrear';
10841
+
10199
10842
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
10200
10843
 
10201
10844
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -10283,6 +10926,8 @@ export namespace Price {
10283
10926
 
10284
10927
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
10285
10928
 
10929
+ billing_mode: 'in_advance' | 'in_arrear';
10930
+
10286
10931
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
10287
10932
 
10288
10933
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -10400,6 +11045,8 @@ export namespace Price {
10400
11045
 
10401
11046
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
10402
11047
 
11048
+ billing_mode: 'in_advance' | 'in_arrear';
11049
+
10403
11050
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
10404
11051
 
10405
11052
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -10499,6 +11146,8 @@ export namespace Price {
10499
11146
 
10500
11147
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
10501
11148
 
11149
+ billing_mode: 'in_advance' | 'in_arrear';
11150
+
10502
11151
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
10503
11152
 
10504
11153
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -10608,6 +11257,8 @@ export namespace Price {
10608
11257
 
10609
11258
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
10610
11259
 
11260
+ billing_mode: 'in_advance' | 'in_arrear';
11261
+
10611
11262
  /**
10612
11263
  * Configuration for bulk_with_proration pricing
10613
11264
  */
@@ -10724,6 +11375,8 @@ export namespace Price {
10724
11375
 
10725
11376
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
10726
11377
 
11378
+ billing_mode: 'in_advance' | 'in_arrear';
11379
+
10727
11380
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
10728
11381
 
10729
11382
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -10833,6 +11486,8 @@ export namespace Price {
10833
11486
 
10834
11487
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
10835
11488
 
11489
+ billing_mode: 'in_advance' | 'in_arrear';
11490
+
10836
11491
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
10837
11492
 
10838
11493
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -10991,6 +11646,8 @@ export namespace Price {
10991
11646
 
10992
11647
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
10993
11648
 
11649
+ billing_mode: 'in_advance' | 'in_arrear';
11650
+
10994
11651
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
10995
11652
 
10996
11653
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -11105,6 +11762,8 @@ export namespace Price {
11105
11762
 
11106
11763
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
11107
11764
 
11765
+ billing_mode: 'in_advance' | 'in_arrear';
11766
+
11108
11767
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
11109
11768
 
11110
11769
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -11231,6 +11890,8 @@ export namespace Price {
11231
11890
 
11232
11891
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
11233
11892
 
11893
+ billing_mode: 'in_advance' | 'in_arrear';
11894
+
11234
11895
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
11235
11896
 
11236
11897
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -11358,6 +12019,8 @@ export namespace Price {
11358
12019
 
11359
12020
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
11360
12021
 
12022
+ billing_mode: 'in_advance' | 'in_arrear';
12023
+
11361
12024
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
11362
12025
 
11363
12026
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -11484,6 +12147,8 @@ export namespace Price {
11484
12147
 
11485
12148
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
11486
12149
 
12150
+ billing_mode: 'in_advance' | 'in_arrear';
12151
+
11487
12152
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
11488
12153
 
11489
12154
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -11625,6 +12290,8 @@ export namespace Price {
11625
12290
 
11626
12291
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
11627
12292
 
12293
+ billing_mode: 'in_advance' | 'in_arrear';
12294
+
11628
12295
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
11629
12296
 
11630
12297
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -11776,6 +12443,8 @@ export namespace Price {
11776
12443
 
11777
12444
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
11778
12445
 
12446
+ billing_mode: 'in_advance' | 'in_arrear';
12447
+
11779
12448
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
11780
12449
 
11781
12450
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;
@@ -11902,6 +12571,8 @@ export namespace Price {
11902
12571
 
11903
12572
  billing_cycle_configuration: Shared.BillingCycleConfiguration;
11904
12573
 
12574
+ billing_mode: 'in_advance' | 'in_arrear';
12575
+
11905
12576
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
11906
12577
 
11907
12578
  composite_price_filters: Array<Shared.TransformPriceFilter> | null;