lago-javascript-client 0.45.0-beta → 0.49.0-beta

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.
@@ -4,6 +4,11 @@ export interface AddOnBaseInput {
4
4
  * @example "Setup Fee"
5
5
  */
6
6
  name?: string;
7
+ /**
8
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
9
+ * @example "Setup Fee (SF1)"
10
+ */
11
+ invoice_display_name?: string;
7
12
  /**
8
13
  * Unique code used to identify the add-on.
9
14
  * @example "setup_fee"
@@ -42,6 +47,11 @@ export interface AddOnObject {
42
47
  * @example "Setup Fee"
43
48
  */
44
49
  name: string;
50
+ /**
51
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
52
+ * @example "Setup Fee (SF1)"
53
+ */
54
+ invoice_display_name?: string;
45
55
  /**
46
56
  * Unique code used to identify the add-on.
47
57
  * @example "setup_fee"
@@ -141,72 +151,6 @@ export interface ApiErrorNotFound {
141
151
  /** @example "object_not_found" */
142
152
  code: string;
143
153
  }
144
- export interface AppliedAddOn {
145
- applied_add_on: AppliedAddOnObject;
146
- }
147
- export interface AppliedAddOnInput {
148
- applied_add_on: {
149
- /**
150
- * The customer external unique identifier (provided by your own application)
151
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
152
- */
153
- external_customer_id: string;
154
- /**
155
- * Unique code used to identify the add-on.
156
- * @example "setup_fee"
157
- */
158
- add_on_code: string;
159
- /**
160
- * The cost of the add-on in cents, excluding any applicable taxes, that is billed to a customer. By creating a one-off invoice, you will be able to override this value.
161
- * @example 50000
162
- */
163
- amount_cents?: number | null;
164
- /** The currency of the add-on. */
165
- amount_currency?: Currency;
166
- };
167
- }
168
- export interface AppliedAddOnObject {
169
- /**
170
- * Unique identifier of the applied add-on created by Lago.
171
- * @format uuid
172
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
173
- */
174
- lago_id: string;
175
- /**
176
- * Unique identifier of the add-on created by Lago.
177
- * @format uuid
178
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
179
- */
180
- lago_add_on_id: string;
181
- /**
182
- * Unique code used to identify the add-on.
183
- * @example "setup_fee"
184
- */
185
- add_on_code: string;
186
- /**
187
- * Unique identifier of the customer created by Lago.
188
- * @format uuid
189
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
190
- */
191
- lago_customer_id: string;
192
- /**
193
- * The customer external unique identifier (provided by your own application)
194
- * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
195
- */
196
- external_customer_id: string;
197
- /**
198
- * The cost of the add-on in cents, excluding any applicable taxes, that is billed to a customer. By creating a one-off invoice, you will be able to override this value.
199
- * @example 50000
200
- */
201
- amount_cents: number;
202
- /** The currency of the add-on. */
203
- amount_currency: Currency;
204
- /**
205
- * @format date-time
206
- * @example "2022-09-14T16:35:31Z"
207
- */
208
- created_at: string;
209
- }
210
154
  export interface AppliedCoupon {
211
155
  applied_coupon: AppliedCouponObject;
212
156
  }
@@ -245,7 +189,7 @@ export interface AppliedCouponInput {
245
189
  amount_currency?: Currency;
246
190
  /**
247
191
  * The percentage rate of the coupon. This field is required only for coupons with a `percentage` coupon type.
248
- * @format ^[0-9]+.?[0-9]*$
192
+ * @pattern ^[0-9]+.?[0-9]*$
249
193
  * @example null
250
194
  */
251
195
  percentage_rate?: string | null;
@@ -304,7 +248,7 @@ export interface AppliedCouponObject {
304
248
  amount_currency?: Currency;
305
249
  /**
306
250
  * The percentage rate of the coupon. This field is required only for coupons with a `percentage` coupon type.
307
- * @format ^[0-9]+.?[0-9]*$
251
+ * @pattern ^[0-9]+.?[0-9]*$
308
252
  * @example null
309
253
  */
310
254
  percentage_rate?: string | null;
@@ -446,10 +390,15 @@ export interface BillableMetricObject {
446
390
  */
447
391
  field_name?: string | null;
448
392
  /**
449
- * Aggregation method used to compute usage for this billable metric. Possible values are `count_agg`, `sum_agg`, `max_agg` or `unique_count_agg`.
393
+ * Aggregation method used to compute usage for this billable metric.
450
394
  * @example "sum_agg"
451
395
  */
452
- aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg";
396
+ aggregation_type: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "weighted_sum_agg" | "latest_agg";
397
+ /**
398
+ * Parameter exclusively utilized in conjunction with the `weighted_sum` aggregation type. It serves to adjust the aggregation result by assigning weights and proration to the result based on time intervals. When this field is not provided, the default time interval is assumed to be in `seconds`.
399
+ * @example "seconds"
400
+ */
401
+ weighted_interval?: "seconds" | null;
453
402
  /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
454
403
  group?: BillableMetricGroup;
455
404
  /**
@@ -499,10 +448,15 @@ export interface BillableMetricBaseInput {
499
448
  */
500
449
  field_name?: string | null;
501
450
  /**
502
- * Aggregation method used to compute usage for this billable metric. Possible values are `count_agg`, `sum_agg`, `max_agg` or `unique_count_agg`.
451
+ * Aggregation method used to compute usage for this billable metric.
503
452
  * @example "sum_agg"
504
453
  */
505
- aggregation_type?: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg";
454
+ aggregation_type?: "count_agg" | "sum_agg" | "max_agg" | "unique_count_agg" | "weighted_sum_agg" | "latest_agg";
455
+ /**
456
+ * Parameter exclusively utilized in conjunction with the `weighted_sum` aggregation type. It serves to adjust the aggregation result by assigning weights and proration to the result based on time intervals. When this field is not provided, the default time interval is assumed to be in `seconds`.
457
+ * @example "seconds"
458
+ */
459
+ weighted_interval?: "seconds" | null;
506
460
  /** Group with one or two dimensions, used to apply differentiated pricing based on additional properties of the billable metric. */
507
461
  group?: BillableMetricGroup;
508
462
  }
@@ -558,6 +512,11 @@ export interface ChargeObject {
558
512
  * @example "requests"
559
513
  */
560
514
  billable_metric_code: string;
515
+ /**
516
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
517
+ * @example "Setup"
518
+ */
519
+ invoice_display_name?: string;
561
520
  /**
562
521
  * The date and time when the charge was created. It is expressed in UTC format according to the ISO 8601 datetime standard.
563
522
  * @format date-time
@@ -614,13 +573,13 @@ export interface ChargeProperties {
614
573
  to_value: number | null;
615
574
  /**
616
575
  * The flat amount for a whole tier, excluding tax, for a `graduated` charge model. It is expressed as a decimal value.
617
- * @format ^[0-9]+.?[0-9]*$
576
+ * @pattern ^[0-9]+.?[0-9]*$
618
577
  * @example "10"
619
578
  */
620
579
  flat_amount: string;
621
580
  /**
622
581
  * The unit price, excluding tax, for a specific tier of a `graduated` charge model. It is expressed as a decimal value.
623
- * @format ^[0-9]+.?[0-9]*$
582
+ * @pattern ^[0-9]+.?[0-9]*$
624
583
  * @example "0.5"
625
584
  */
626
585
  per_unit_amount: string;
@@ -655,7 +614,7 @@ export interface ChargeProperties {
655
614
  /**
656
615
  * - The unit price, excluding tax, for a `standard` charge model. It is expressed as a decimal value.
657
616
  * - The amount, excluding tax, for a complete set of units in a `package` charge model. It is expressed as a decimal value.
658
- * @format ^[0-9]+.?[0-9]*$
617
+ * @pattern ^[0-9]+.?[0-9]*$
659
618
  * @example "30"
660
619
  */
661
620
  amount?: string;
@@ -671,13 +630,13 @@ export interface ChargeProperties {
671
630
  package_size?: number;
672
631
  /**
673
632
  * The percentage rate that is applied to the amount of each transaction for a `percentage` charge model. It is expressed as a decimal value.
674
- * @format ^[0-9]+.?[0-9]*$
633
+ * @pattern ^[0-9]+.?[0-9]*$
675
634
  * @example "1"
676
635
  */
677
636
  rate?: string;
678
637
  /**
679
638
  * The fixed fee that is applied to each transaction for a `percentage` charge model. It is expressed as a decimal value.
680
- * @format ^[0-9]+.?[0-9]*$
639
+ * @pattern ^[0-9]+.?[0-9]*$
681
640
  * @example "0.5"
682
641
  */
683
642
  fixed_amount?: string;
@@ -688,10 +647,22 @@ export interface ChargeProperties {
688
647
  free_units_per_events?: number | null;
689
648
  /**
690
649
  * The transaction amount that is not impacted by the `percentage` rate and fixed fee in a percentage charge model. This field indicates the portion of the transaction amount that is exempt from the calculation of charges based on the specified percentage rate and fixed fee.
691
- * @format ^[0-9]+.?[0-9]*$
650
+ * @pattern ^[0-9]+.?[0-9]*$
692
651
  * @example "500"
693
652
  */
694
653
  free_units_per_total_aggregation?: string | null;
654
+ /**
655
+ * Specifies the maximum allowable spending for a single transaction. Working as a transaction cap.
656
+ * @format ^[0-9]+.?[0-9]*$
657
+ * @example "3.75"
658
+ */
659
+ per_transaction_max_amount?: string | null;
660
+ /**
661
+ * Specifies the minimum allowable spending for a single transaction. Working as a transaction floor.
662
+ * @format ^[0-9]+.?[0-9]*$
663
+ * @example "1.75"
664
+ */
665
+ per_transaction_min_amount?: string | null;
695
666
  /** Volume ranges, sorted from bottom to top tiers, used for a `volume` charge model. */
696
667
  volume_ranges?: {
697
668
  /**
@@ -708,270 +679,20 @@ export interface ChargeProperties {
708
679
  to_value: number | null;
709
680
  /**
710
681
  * The unit price, excluding tax, for a specific tier of a `volume` charge model. It is expressed as a decimal value.
711
- * @format ^[0-9]+.?[0-9]*$
682
+ * @pattern ^[0-9]+.?[0-9]*$
712
683
  * @example "10"
713
684
  */
714
685
  flat_amount: string;
715
686
  /**
716
687
  * The flat amount for a whole tier, excluding tax, for a `volume` charge model. It is expressed as a decimal value.
717
- * @format ^[0-9]+.?[0-9]*$
688
+ * @pattern ^[0-9]+.?[0-9]*$
718
689
  * @example "0.5"
719
690
  */
720
691
  per_unit_amount: string;
721
692
  }[];
722
693
  }
723
694
  /** @example "US" */
724
- export declare enum Country {
725
- AD = "AD",
726
- AE = "AE",
727
- AF = "AF",
728
- AG = "AG",
729
- AI = "AI",
730
- AL = "AL",
731
- AM = "AM",
732
- AO = "AO",
733
- AQ = "AQ",
734
- AR = "AR",
735
- AS = "AS",
736
- AT = "AT",
737
- AU = "AU",
738
- AW = "AW",
739
- AX = "AX",
740
- AZ = "AZ",
741
- BA = "BA",
742
- BB = "BB",
743
- BD = "BD",
744
- BE = "BE",
745
- BF = "BF",
746
- BG = "BG",
747
- BH = "BH",
748
- BI = "BI",
749
- BJ = "BJ",
750
- BL = "BL",
751
- BM = "BM",
752
- BN = "BN",
753
- BO = "BO",
754
- BQ = "BQ",
755
- BR = "BR",
756
- BS = "BS",
757
- BT = "BT",
758
- BV = "BV",
759
- BW = "BW",
760
- BY = "BY",
761
- BZ = "BZ",
762
- CA = "CA",
763
- CC = "CC",
764
- CD = "CD",
765
- CF = "CF",
766
- CG = "CG",
767
- CH = "CH",
768
- CI = "CI",
769
- CK = "CK",
770
- CL = "CL",
771
- CM = "CM",
772
- CN = "CN",
773
- CO = "CO",
774
- CR = "CR",
775
- CU = "CU",
776
- CV = "CV",
777
- CW = "CW",
778
- CX = "CX",
779
- CY = "CY",
780
- CZ = "CZ",
781
- DE = "DE",
782
- DJ = "DJ",
783
- DK = "DK",
784
- DM = "DM",
785
- DO = "DO",
786
- DZ = "DZ",
787
- EC = "EC",
788
- EE = "EE",
789
- EG = "EG",
790
- EH = "EH",
791
- ER = "ER",
792
- ES = "ES",
793
- ET = "ET",
794
- FI = "FI",
795
- FJ = "FJ",
796
- FK = "FK",
797
- FM = "FM",
798
- FO = "FO",
799
- FR = "FR",
800
- GA = "GA",
801
- GB = "GB",
802
- GD = "GD",
803
- GE = "GE",
804
- GF = "GF",
805
- GG = "GG",
806
- GH = "GH",
807
- GI = "GI",
808
- GL = "GL",
809
- GM = "GM",
810
- GN = "GN",
811
- GP = "GP",
812
- GQ = "GQ",
813
- GR = "GR",
814
- GS = "GS",
815
- GT = "GT",
816
- GU = "GU",
817
- GW = "GW",
818
- GY = "GY",
819
- HK = "HK",
820
- HM = "HM",
821
- HN = "HN",
822
- HR = "HR",
823
- HT = "HT",
824
- HU = "HU",
825
- ID = "ID",
826
- IE = "IE",
827
- IL = "IL",
828
- IM = "IM",
829
- IN = "IN",
830
- IO = "IO",
831
- IQ = "IQ",
832
- IR = "IR",
833
- IS = "IS",
834
- IT = "IT",
835
- JE = "JE",
836
- JM = "JM",
837
- JO = "JO",
838
- JP = "JP",
839
- KE = "KE",
840
- KG = "KG",
841
- KH = "KH",
842
- KI = "KI",
843
- KM = "KM",
844
- KN = "KN",
845
- KP = "KP",
846
- KR = "KR",
847
- KW = "KW",
848
- KY = "KY",
849
- KZ = "KZ",
850
- LA = "LA",
851
- LB = "LB",
852
- LC = "LC",
853
- LI = "LI",
854
- LK = "LK",
855
- LR = "LR",
856
- LS = "LS",
857
- LT = "LT",
858
- LU = "LU",
859
- LV = "LV",
860
- LY = "LY",
861
- MA = "MA",
862
- MC = "MC",
863
- MD = "MD",
864
- ME = "ME",
865
- MF = "MF",
866
- MG = "MG",
867
- MH = "MH",
868
- MK = "MK",
869
- ML = "ML",
870
- MM = "MM",
871
- MN = "MN",
872
- MO = "MO",
873
- MP = "MP",
874
- MQ = "MQ",
875
- MR = "MR",
876
- MS = "MS",
877
- MT = "MT",
878
- MU = "MU",
879
- MV = "MV",
880
- MW = "MW",
881
- MX = "MX",
882
- MY = "MY",
883
- MZ = "MZ",
884
- NA = "NA",
885
- NC = "NC",
886
- NE = "NE",
887
- NF = "NF",
888
- NG = "NG",
889
- NI = "NI",
890
- NL = "NL",
891
- NO = "NO",
892
- NP = "NP",
893
- NR = "NR",
894
- NU = "NU",
895
- NZ = "NZ",
896
- OM = "OM",
897
- PA = "PA",
898
- PE = "PE",
899
- PF = "PF",
900
- PG = "PG",
901
- PH = "PH",
902
- PK = "PK",
903
- PL = "PL",
904
- PM = "PM",
905
- PN = "PN",
906
- PR = "PR",
907
- PS = "PS",
908
- PT = "PT",
909
- PW = "PW",
910
- PY = "PY",
911
- QA = "QA",
912
- RE = "RE",
913
- RO = "RO",
914
- RS = "RS",
915
- RU = "RU",
916
- RW = "RW",
917
- SA = "SA",
918
- SB = "SB",
919
- SC = "SC",
920
- SD = "SD",
921
- SE = "SE",
922
- SG = "SG",
923
- SH = "SH",
924
- SI = "SI",
925
- SJ = "SJ",
926
- SK = "SK",
927
- SL = "SL",
928
- SM = "SM",
929
- SN = "SN",
930
- SO = "SO",
931
- SR = "SR",
932
- SS = "SS",
933
- ST = "ST",
934
- SV = "SV",
935
- SX = "SX",
936
- SY = "SY",
937
- SZ = "SZ",
938
- TC = "TC",
939
- TD = "TD",
940
- TF = "TF",
941
- TG = "TG",
942
- TH = "TH",
943
- TJ = "TJ",
944
- TK = "TK",
945
- TL = "TL",
946
- TM = "TM",
947
- TN = "TN",
948
- TO = "TO",
949
- TR = "TR",
950
- TT = "TT",
951
- TV = "TV",
952
- TW = "TW",
953
- TZ = "TZ",
954
- UA = "UA",
955
- UG = "UG",
956
- UM = "UM",
957
- US = "US",
958
- UY = "UY",
959
- UZ = "UZ",
960
- VA = "VA",
961
- VC = "VC",
962
- VE = "VE",
963
- VG = "VG",
964
- VI = "VI",
965
- VN = "VN",
966
- VU = "VU",
967
- WF = "WF",
968
- WS = "WS",
969
- YE = "YE",
970
- YT = "YT",
971
- ZA = "ZA",
972
- ZM = "ZM",
973
- ZW = "ZW"
974
- }
695
+ export type Country = "AD" | "AE" | "AF" | "AG" | "AI" | "AL" | "AM" | "AO" | "AQ" | "AR" | "AS" | "AT" | "AU" | "AW" | "AX" | "AZ" | "BA" | "BB" | "BD" | "BE" | "BF" | "BG" | "BH" | "BI" | "BJ" | "BL" | "BM" | "BN" | "BO" | "BQ" | "BR" | "BS" | "BT" | "BV" | "BW" | "BY" | "BZ" | "CA" | "CC" | "CD" | "CF" | "CG" | "CH" | "CI" | "CK" | "CL" | "CM" | "CN" | "CO" | "CR" | "CU" | "CV" | "CW" | "CX" | "CY" | "CZ" | "DE" | "DJ" | "DK" | "DM" | "DO" | "DZ" | "EC" | "EE" | "EG" | "EH" | "ER" | "ES" | "ET" | "FI" | "FJ" | "FK" | "FM" | "FO" | "FR" | "GA" | "GB" | "GD" | "GE" | "GF" | "GG" | "GH" | "GI" | "GL" | "GM" | "GN" | "GP" | "GQ" | "GR" | "GS" | "GT" | "GU" | "GW" | "GY" | "HK" | "HM" | "HN" | "HR" | "HT" | "HU" | "ID" | "IE" | "IL" | "IM" | "IN" | "IO" | "IQ" | "IR" | "IS" | "IT" | "JE" | "JM" | "JO" | "JP" | "KE" | "KG" | "KH" | "KI" | "KM" | "KN" | "KP" | "KR" | "KW" | "KY" | "KZ" | "LA" | "LB" | "LC" | "LI" | "LK" | "LR" | "LS" | "LT" | "LU" | "LV" | "LY" | "MA" | "MC" | "MD" | "ME" | "MF" | "MG" | "MH" | "MK" | "ML" | "MM" | "MN" | "MO" | "MP" | "MQ" | "MR" | "MS" | "MT" | "MU" | "MV" | "MW" | "MX" | "MY" | "MZ" | "NA" | "NC" | "NE" | "NF" | "NG" | "NI" | "NL" | "NO" | "NP" | "NR" | "NU" | "NZ" | "OM" | "PA" | "PE" | "PF" | "PG" | "PH" | "PK" | "PL" | "PM" | "PN" | "PR" | "PS" | "PT" | "PW" | "PY" | "QA" | "RE" | "RO" | "RS" | "RU" | "RW" | "SA" | "SB" | "SC" | "SD" | "SE" | "SG" | "SH" | "SI" | "SJ" | "SK" | "SL" | "SM" | "SN" | "SO" | "SR" | "SS" | "ST" | "SV" | "SX" | "SY" | "SZ" | "TC" | "TD" | "TF" | "TG" | "TH" | "TJ" | "TK" | "TL" | "TM" | "TN" | "TO" | "TR" | "TT" | "TV" | "TW" | "TZ" | "UA" | "UG" | "UM" | "US" | "UY" | "UZ" | "VA" | "VC" | "VE" | "VG" | "VI" | "VN" | "VU" | "WF" | "WS" | "YE" | "YT" | "ZA" | "ZM" | "ZW";
975
696
  export interface Coupon {
976
697
  coupon: CouponObject;
977
698
  }
@@ -1013,7 +734,7 @@ export interface CouponBaseInput {
1013
734
  reusable?: boolean;
1014
735
  /**
1015
736
  * The percentage rate of the coupon. This field is required only for coupons with a `percentage` coupon type.
1016
- * @format ^[0-9]+.?[0-9]*$
737
+ * @pattern ^[0-9]+.?[0-9]*$
1017
738
  * @example null
1018
739
  */
1019
740
  percentage_rate?: string | null;
@@ -1126,7 +847,7 @@ export interface CouponObject {
1126
847
  billable_metric_codes?: string[];
1127
848
  /**
1128
849
  * The percentage rate of the coupon. This field is required only for coupons with a `percentage` coupon type.
1129
- * @format ^[0-9]+.?[0-9]*$
850
+ * @pattern ^[0-9]+.?[0-9]*$
1130
851
  * @example null
1131
852
  */
1132
853
  percentage_rate?: string | null;
@@ -1164,6 +885,12 @@ export interface CouponObject {
1164
885
  * @example "2022-04-29T08:59:51Z"
1165
886
  */
1166
887
  created_at: string;
888
+ /**
889
+ * This field indicates if the coupon has been terminated and is no longer usable. If it's not null, it won't be removed for existing customers using it, but it prevents the coupon from being applied in the future.
890
+ * @format date-time
891
+ * @example "2022-08-08T23:59:59Z"
892
+ */
893
+ terminated_at?: string;
1167
894
  }
1168
895
  export interface CouponsPaginated {
1169
896
  coupons: CouponObject[];
@@ -1198,7 +925,7 @@ export interface CreditObject {
1198
925
  * @format uuid
1199
926
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1200
927
  */
1201
- lago_id: string;
928
+ lago_item_id: string;
1202
929
  /**
1203
930
  * The type of credit applied. Possible values are `coupon` or `credit_note`.
1204
931
  * @example "coupon"
@@ -1446,145 +1173,7 @@ export interface CreditNoteUpdateInput {
1446
1173
  };
1447
1174
  }
1448
1175
  /** @example "USD" */
1449
- export declare enum Currency {
1450
- AED = "AED",
1451
- AFN = "AFN",
1452
- ALL = "ALL",
1453
- AMD = "AMD",
1454
- ANG = "ANG",
1455
- AOA = "AOA",
1456
- ARS = "ARS",
1457
- AUD = "AUD",
1458
- AWG = "AWG",
1459
- AZN = "AZN",
1460
- BAM = "BAM",
1461
- BBD = "BBD",
1462
- BDT = "BDT",
1463
- BGN = "BGN",
1464
- BIF = "BIF",
1465
- BMD = "BMD",
1466
- BND = "BND",
1467
- BOB = "BOB",
1468
- BRL = "BRL",
1469
- BSD = "BSD",
1470
- BWP = "BWP",
1471
- BYN = "BYN",
1472
- BZD = "BZD",
1473
- CAD = "CAD",
1474
- CDF = "CDF",
1475
- CHF = "CHF",
1476
- CLF = "CLF",
1477
- CLP = "CLP",
1478
- CNY = "CNY",
1479
- COP = "COP",
1480
- CRC = "CRC",
1481
- CVE = "CVE",
1482
- CZK = "CZK",
1483
- DJF = "DJF",
1484
- DKK = "DKK",
1485
- DOP = "DOP",
1486
- DZD = "DZD",
1487
- EGP = "EGP",
1488
- ETB = "ETB",
1489
- EUR = "EUR",
1490
- FJD = "FJD",
1491
- FKP = "FKP",
1492
- GBP = "GBP",
1493
- GEL = "GEL",
1494
- GIP = "GIP",
1495
- GMD = "GMD",
1496
- GNF = "GNF",
1497
- GTQ = "GTQ",
1498
- GYD = "GYD",
1499
- HKD = "HKD",
1500
- HNL = "HNL",
1501
- HRK = "HRK",
1502
- HTG = "HTG",
1503
- HUF = "HUF",
1504
- IDR = "IDR",
1505
- ILS = "ILS",
1506
- INR = "INR",
1507
- ISK = "ISK",
1508
- JMD = "JMD",
1509
- JPY = "JPY",
1510
- KES = "KES",
1511
- KGS = "KGS",
1512
- KHR = "KHR",
1513
- KMF = "KMF",
1514
- KRW = "KRW",
1515
- KYD = "KYD",
1516
- KZT = "KZT",
1517
- LAK = "LAK",
1518
- LBP = "LBP",
1519
- LKR = "LKR",
1520
- LRD = "LRD",
1521
- LSL = "LSL",
1522
- MAD = "MAD",
1523
- MDL = "MDL",
1524
- MGA = "MGA",
1525
- MKD = "MKD",
1526
- MMK = "MMK",
1527
- MNT = "MNT",
1528
- MOP = "MOP",
1529
- MRO = "MRO",
1530
- MUR = "MUR",
1531
- MVR = "MVR",
1532
- MWK = "MWK",
1533
- MXN = "MXN",
1534
- MYR = "MYR",
1535
- MZN = "MZN",
1536
- NAD = "NAD",
1537
- NGN = "NGN",
1538
- NIO = "NIO",
1539
- NOK = "NOK",
1540
- NPR = "NPR",
1541
- NZD = "NZD",
1542
- PAB = "PAB",
1543
- PEN = "PEN",
1544
- PGK = "PGK",
1545
- PHP = "PHP",
1546
- PKR = "PKR",
1547
- PLN = "PLN",
1548
- PYG = "PYG",
1549
- QAR = "QAR",
1550
- RON = "RON",
1551
- RSD = "RSD",
1552
- RUB = "RUB",
1553
- RWF = "RWF",
1554
- SAR = "SAR",
1555
- SBD = "SBD",
1556
- SCR = "SCR",
1557
- SEK = "SEK",
1558
- SGD = "SGD",
1559
- SHP = "SHP",
1560
- SLL = "SLL",
1561
- SOS = "SOS",
1562
- SRD = "SRD",
1563
- STD = "STD",
1564
- SZL = "SZL",
1565
- THB = "THB",
1566
- TJS = "TJS",
1567
- TOP = "TOP",
1568
- TRY = "TRY",
1569
- TTD = "TTD",
1570
- TWD = "TWD",
1571
- TZS = "TZS",
1572
- UAH = "UAH",
1573
- UGX = "UGX",
1574
- USD = "USD",
1575
- UYU = "UYU",
1576
- UZS = "UZS",
1577
- VND = "VND",
1578
- VUV = "VUV",
1579
- WST = "WST",
1580
- XAF = "XAF",
1581
- XCD = "XCD",
1582
- XOF = "XOF",
1583
- XPF = "XPF",
1584
- YER = "YER",
1585
- ZAR = "ZAR",
1586
- ZMW = "ZMW"
1587
- }
1176
+ export type Currency = "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLF" | "CLP" | "CNY" | "COP" | "CRC" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "INR" | "ISK" | "JMD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KRW" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRO" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SEK" | "SGD" | "SHP" | "SLL" | "SOS" | "SRD" | "STD" | "SZL" | "THB" | "TJS" | "TOP" | "TRY" | "TTD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW";
1588
1177
  export interface Customer {
1589
1178
  customer: CustomerObjectExtended;
1590
1179
  }
@@ -1630,10 +1219,15 @@ export interface CustomerBillingConfiguration {
1630
1219
  export interface CustomerChargeUsageObject {
1631
1220
  /**
1632
1221
  * The number of units consumed by the customer for a specific charge item.
1633
- * @format ^[0-9]+.?[0-9]*$
1222
+ * @pattern ^[0-9]+.?[0-9]*$
1634
1223
  * @example "1.0"
1635
1224
  */
1636
1225
  units: string;
1226
+ /**
1227
+ * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
1228
+ * @example 10
1229
+ */
1230
+ events_count: number;
1637
1231
  /**
1638
1232
  * The amount in cents, tax excluded, consumed by the customer for a specific charge item.
1639
1233
  * @example 123
@@ -1699,10 +1293,15 @@ export interface CustomerChargeUsageObject {
1699
1293
  value?: string;
1700
1294
  /**
1701
1295
  * The number of units consumed for a specific group related to a charge item.
1702
- * @format ^[0-9]+.?[0-9]*$
1296
+ * @pattern ^[0-9]+.?[0-9]*$
1703
1297
  * @example "0.9"
1704
1298
  */
1705
1299
  units?: string;
1300
+ /**
1301
+ * The quantity of usage events that have been recorded for a particular charge during the specified time period. These events may also be referred to as the number of transactions in some contexts.
1302
+ * @example 10
1303
+ */
1304
+ events_count?: number;
1706
1305
  /**
1707
1306
  * The amount in cents, tax excluded, consumed for a specific group related to a charge item.
1708
1307
  * @example 1000
@@ -1979,6 +1578,10 @@ export type CustomerObjectExtended = CustomerObject & {
1979
1578
  /** List of customer taxes */
1980
1579
  taxes?: TaxObject[];
1981
1580
  };
1581
+ export interface CustomerPastUsage {
1582
+ usage_periods: CustomerUsage[];
1583
+ meta: PaginationMeta;
1584
+ }
1982
1585
  export interface CustomersPaginated {
1983
1586
  customers: CustomerObjectExtended[];
1984
1587
  meta: PaginationMeta;
@@ -2005,6 +1608,12 @@ export interface CustomerUsageObject {
2005
1608
  * @example "2022-08-01T23:59:59Z"
2006
1609
  */
2007
1610
  issuing_date: string;
1611
+ /**
1612
+ * A unique identifier associated with the invoice related to this particular usage record.
1613
+ * @format uuid
1614
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1615
+ */
1616
+ lago_invoice_id?: string | null;
2008
1617
  /** The currency of the customer’s current usage. */
2009
1618
  currency?: Currency;
2010
1619
  /**
@@ -2110,19 +1719,17 @@ export interface EventInput {
2110
1719
  */
2111
1720
  code: string;
2112
1721
  /**
2113
- * This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception.
2114
- * @example 1651240791
1722
+ * This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC).
1723
+ * If this timestamp is not provided, the API will automatically set it to the time of event reception.
1724
+ * You can also provide miliseconds precision by appending decimals to the timestamp.
1725
+ * @example "1651240791.123"
2115
1726
  */
2116
- timestamp?: number;
1727
+ timestamp?: number | string;
2117
1728
  /**
2118
1729
  * This field represents additional properties associated with the event, which are utilized in the calculation of the final fee. This object becomes mandatory when the targeted billable metric employs a `sum_agg`, `max_agg`, or `unique_count_agg` aggregation method. However, when using a simple `count_agg`, this object is not required.
2119
1730
  * @example {"gb":10}
2120
1731
  */
2121
- properties?: {
2122
- /** The `operation_type` field is only necessary when adding or removing a specific unit when the targeted billable metric adopts a `unique_count_agg` aggregation method. In other cases, the `operation_type` field is not required. The valid values for the `operation_type` field are `add` or `remove`, which indicate whether the unit is being added or removed from the unique count aggregation, respectively. */
2123
- operation_type?: "add" | "remove";
2124
- [key: string]: any;
2125
- };
1732
+ properties?: Record<string, string>;
2126
1733
  };
2127
1734
  }
2128
1735
  export interface EventObject {
@@ -2156,7 +1763,7 @@ export interface EventObject {
2156
1763
  /**
2157
1764
  * This field captures the Unix timestamp in seconds indicating the occurrence of the event in Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it to the time of event reception.
2158
1765
  * @format date-time
2159
- * @example "2022-04-29T08:59:51Z"
1766
+ * @example "2022-04-29T08:59:51.123Z"
2160
1767
  */
2161
1768
  timestamp: string;
2162
1769
  /**
@@ -2250,6 +1857,11 @@ export interface FeeObject {
2250
1857
  * @example "external_id"
2251
1858
  */
2252
1859
  external_subscription_id?: string | null;
1860
+ /**
1861
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
1862
+ * @example "Setup Fee (SF1)"
1863
+ */
1864
+ invoice_display_name?: string;
2253
1865
  /**
2254
1866
  * The cost of this specific fee, excluding any applicable taxes.
2255
1867
  * @example 100
@@ -2357,6 +1969,11 @@ export interface FeeObject {
2357
1969
  * @example "Startup"
2358
1970
  */
2359
1971
  name: string;
1972
+ /**
1973
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
1974
+ * @example "Setup Fee (SF1)"
1975
+ */
1976
+ invoice_display_name?: string;
2360
1977
  /**
2361
1978
  * Unique identifier of the fee item, created by Lago. It can be the identifier of the `add-on`, the identifier of the `charge`, the identifier of the `credit` or the identifier of the `subscription`.
2362
1979
  * @format uuid
@@ -2412,6 +2029,11 @@ export interface GroupPropertiesObject {
2412
2029
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2413
2030
  */
2414
2031
  group_id: string;
2032
+ /**
2033
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual group will be used as the default display name.
2034
+ * @example "AWS"
2035
+ */
2036
+ invoice_display_name?: string;
2415
2037
  /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
2416
2038
  values: ChargeProperties;
2417
2039
  }
@@ -2596,6 +2218,11 @@ export interface InvoiceOneOffCreateInput {
2596
2218
  * @example "setup_fee"
2597
2219
  */
2598
2220
  add_on_code: string;
2221
+ /**
2222
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
2223
+ * @example "Setup Fee (SF1)"
2224
+ */
2225
+ invoice_display_name?: string;
2599
2226
  /**
2600
2227
  * The amount of the fee per unit, expressed in cents. By default, the amount of the add-on is used.
2601
2228
  * @example 12000
@@ -2603,7 +2230,7 @@ export interface InvoiceOneOffCreateInput {
2603
2230
  unit_amount_cents?: number | null;
2604
2231
  /**
2605
2232
  * The quantity of units associated with the fee. By default, only 1 unit is added to the invoice.
2606
- * @format ^[0-9]+.?[0-9]*$
2233
+ * @pattern ^[0-9]+.?[0-9]*$
2607
2234
  * @example "2.5"
2608
2235
  */
2609
2236
  units?: string | null;
@@ -2868,6 +2495,11 @@ export interface PlanCreateInput {
2868
2495
  * @example "Startup"
2869
2496
  */
2870
2497
  name?: string;
2498
+ /**
2499
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the plan will be used as the default display name.
2500
+ * @example "Startup plan"
2501
+ */
2502
+ invoice_display_name?: string;
2871
2503
  /**
2872
2504
  * The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
2873
2505
  * @example "startup"
@@ -2912,7 +2544,7 @@ export interface PlanCreateInput {
2912
2544
  tax_codes?: string[];
2913
2545
  /**
2914
2546
  * Additional usage-based charges for this plan.
2915
- * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
2547
+ * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
2916
2548
  */
2917
2549
  charges?: {
2918
2550
  /**
@@ -2936,6 +2568,11 @@ export interface PlanCreateInput {
2936
2568
  * @example true
2937
2569
  */
2938
2570
  invoiceable?: boolean;
2571
+ /**
2572
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
2573
+ * @example "Setup"
2574
+ */
2575
+ invoice_display_name?: string;
2939
2576
  /**
2940
2577
  * Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
2941
2578
  *
@@ -2977,6 +2614,11 @@ export interface PlanUpdateInput {
2977
2614
  * @example "Startup"
2978
2615
  */
2979
2616
  name?: string;
2617
+ /**
2618
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the plan will be used as the default display name.
2619
+ * @example "Startup plan"
2620
+ */
2621
+ invoice_display_name?: string;
2980
2622
  /**
2981
2623
  * The code of the plan. It serves as a unique identifier associated with a particular plan. The code is typically used for internal or system-level identification purposes, like assigning a subscription, for instance.
2982
2624
  * @example "startup"
@@ -3021,7 +2663,7 @@ export interface PlanUpdateInput {
3021
2663
  tax_codes?: string[];
3022
2664
  /**
3023
2665
  * Additional usage-based charges for this plan.
3024
- * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
2666
+ * @example [{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[],"tax_codes":["french_standard_vat"]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"to_value":10,"from_value":0,"flat_amount":"10","per_unit_amount":"0.5"},{"to_value":null,"from_value":11,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
3025
2667
  */
3026
2668
  charges?: {
3027
2669
  /**
@@ -3051,6 +2693,11 @@ export interface PlanUpdateInput {
3051
2693
  * @example true
3052
2694
  */
3053
2695
  invoiceable?: boolean;
2696
+ /**
2697
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the actual charge will be used as the default display name.
2698
+ * @example "Setup"
2699
+ */
2700
+ invoice_display_name?: string;
3054
2701
  /**
3055
2702
  * Specifies whether a charge is prorated based on the remaining number of days in the billing period or billed fully.
3056
2703
  *
@@ -3097,6 +2744,11 @@ export interface PlanObject {
3097
2744
  * @example "Startup"
3098
2745
  */
3099
2746
  name: string;
2747
+ /**
2748
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the name of the plan will be used as the default display name.
2749
+ * @example "Startup plan"
2750
+ */
2751
+ invoice_display_name?: string;
3100
2752
  /**
3101
2753
  * The date and time when the plan was created. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the plan was initially created.
3102
2754
  * @format date-time
@@ -3152,7 +2804,7 @@ export interface PlanObject {
3152
2804
  draft_invoices_count: number;
3153
2805
  /**
3154
2806
  * Additional usage-based charges for this plan.
3155
- * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","values":{"amount":"8"}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
2807
+ * @example [{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","billable_metric_code":"requests","created_at":"2023-06-27T19:43:42Z","charge_model":"package","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":3000,"properties":{"amount":"30","free_units":100,"package_size":1000},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a92","billable_metric_code":"cpu","created_at":"2023-06-27T19:43:42Z","charge_model":"graduated","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"graduated_ranges":[{"from_value":0,"to_value":10,"flat_amount":"10","per_unit_amount":"0.5"},{"from_value":11,"to_value":null,"flat_amount":"0","per_unit_amount":"0.4"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a93","billable_metric_code":"seats","created_at":"2023-06-27T19:43:42Z","charge_model":"standard","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{},"group_properties":[{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a01","invoice_display_name":"Europe","values":{"amount":"10"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a02","invoice_display_name":"USA","values":{"amount":"5"}},{"group_id":"1a901a90-1a90-1a90-1a90-1a901a901a03","invoice_display_name":"Africa","values":{"amount":"8"}}]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a94","billable_metric_code":"storage","created_at":"2023-06-27T19:43:42Z","charge_model":"volume","invoiceable":true,"invoice_display_name":"Setup","pay_in_advance":false,"prorated":false,"min_amount_cents":0,"properties":{"volume_ranges":[{"from_value":0,"to_value":100,"flat_amount":"0","per_unit_amount":"0"},{"from_value":101,"to_value":null,"flat_amount":"0","per_unit_amount":"0.5"}]},"group_properties":[]},{"lago_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","lago_billable_metric_id":"1a901a90-1a90-1a90-1a90-1a901a901a95","billable_metric_code":"payments","created_at":"2023-06-27T19:43:42Z","charge_model":"percentage","invoiceable":false,"invoice_display_name":"Setup","pay_in_advance":true,"prorated":false,"min_amount_cents":0,"properties":{"rate":"1","fixed_amount":"0.5","free_units_per_events":5,"free_units_per_total_aggregation":"500"},"group_properties":[]}]
3156
2808
  */
3157
2809
  charges?: ChargeObject[];
3158
2810
  /** All taxes applied to the plan. */
@@ -3192,6 +2844,12 @@ export interface SubscriptionCreateInput {
3192
2844
  * @example "anniversary"
3193
2845
  */
3194
2846
  billing_time?: "calendar" | "anniversary";
2847
+ /**
2848
+ * The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC).
2849
+ * @format date-time
2850
+ * @example "2022-10-08T00:00:00Z"
2851
+ */
2852
+ ending_at?: string;
3195
2853
  /**
3196
2854
  * The start date for the subscription, allowing for the creation of subscriptions that can begin in the past or future. Please note that it cannot be used to update the start date of a pending subscription or schedule an upgrade/downgrade. The start_date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3197
2855
  * @format date-time
@@ -3207,6 +2865,12 @@ export interface SubscriptionUpdateInput {
3207
2865
  * @example "Repository B"
3208
2866
  */
3209
2867
  name?: string | null;
2868
+ /**
2869
+ * The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC).
2870
+ * @format date-time
2871
+ * @example "2022-10-08T00:00:00Z"
2872
+ */
2873
+ ending_at?: string;
3210
2874
  /**
3211
2875
  * The start date and time of the subscription. This field can only be modified for pending subscriptions that have not yet started. This date should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3212
2876
  * @format date-time
@@ -3280,6 +2944,12 @@ export interface SubscriptionObject {
3280
2944
  * @example "2022-08-08T00:00:00Z"
3281
2945
  */
3282
2946
  started_at?: string | null;
2947
+ /**
2948
+ * The effective end date of the subscription. If this field is set to null, the subscription will automatically renew. This date should be provided in ISO 8601 datetime format, and use Coordinated Universal Time (UTC).
2949
+ * @format date-time
2950
+ * @example "2022-10-08T00:00:00Z"
2951
+ */
2952
+ ending_at?: string;
3283
2953
  /**
3284
2954
  * The anniversary date and time of the initial subscription. This date serves as the basis for billing subscriptions with `anniversary` billing time. The `anniversary_date` should be provided in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3285
2955
  * @format date-time
@@ -3329,7 +2999,7 @@ export interface TaxBaseInput {
3329
2999
  code?: string;
3330
3000
  /**
3331
3001
  * The percentage rate of the tax
3332
- * @format ^[0-9]+.?[0-9]*$
3002
+ * @pattern ^[0-9]+.?[0-9]*$
3333
3003
  * @example "20.0"
3334
3004
  */
3335
3005
  rate?: string;
@@ -3414,143 +3084,7 @@ export interface TaxUpdateInput {
3414
3084
  tax: TaxBaseInput;
3415
3085
  }
3416
3086
  /** @example "America/Los_Angeles" */
3417
- export declare enum Timezone {
3418
- UTC = "UTC",
3419
- AfricaAlgiers = "Africa/Algiers",
3420
- AfricaCairo = "Africa/Cairo",
3421
- AfricaCasablanca = "Africa/Casablanca",
3422
- AfricaHarare = "Africa/Harare",
3423
- AfricaJohannesburg = "Africa/Johannesburg",
3424
- AfricaMonrovia = "Africa/Monrovia",
3425
- AfricaNairobi = "Africa/Nairobi",
3426
- AmericaArgentinaBuenosAires = "America/Argentina/Buenos_Aires",
3427
- AmericaBogota = "America/Bogota",
3428
- AmericaCaracas = "America/Caracas",
3429
- AmericaChicago = "America/Chicago",
3430
- AmericaChihuahua = "America/Chihuahua",
3431
- AmericaDenver = "America/Denver",
3432
- AmericaGodthab = "America/Godthab",
3433
- AmericaGuatemala = "America/Guatemala",
3434
- AmericaGuyana = "America/Guyana",
3435
- AmericaHalifax = "America/Halifax",
3436
- AmericaIndianaIndianapolis = "America/Indiana/Indianapolis",
3437
- AmericaJuneau = "America/Juneau",
3438
- AmericaLaPaz = "America/La_Paz",
3439
- AmericaLima = "America/Lima",
3440
- AmericaLosAngeles = "America/Los_Angeles",
3441
- AmericaMazatlan = "America/Mazatlan",
3442
- AmericaMexicoCity = "America/Mexico_City",
3443
- AmericaMonterrey = "America/Monterrey",
3444
- AmericaMontevideo = "America/Montevideo",
3445
- AmericaNewYork = "America/New_York",
3446
- AmericaPhoenix = "America/Phoenix",
3447
- AmericaPuertoRico = "America/Puerto_Rico",
3448
- AmericaRegina = "America/Regina",
3449
- AmericaSantiago = "America/Santiago",
3450
- AmericaSaoPaulo = "America/Sao_Paulo",
3451
- AmericaStJohns = "America/St_Johns",
3452
- AmericaTijuana = "America/Tijuana",
3453
- AsiaAlmaty = "Asia/Almaty",
3454
- AsiaBaghdad = "Asia/Baghdad",
3455
- AsiaBaku = "Asia/Baku",
3456
- AsiaBangkok = "Asia/Bangkok",
3457
- AsiaChongqing = "Asia/Chongqing",
3458
- AsiaColombo = "Asia/Colombo",
3459
- AsiaDhaka = "Asia/Dhaka",
3460
- AsiaHongKong = "Asia/Hong_Kong",
3461
- AsiaIrkutsk = "Asia/Irkutsk",
3462
- AsiaJakarta = "Asia/Jakarta",
3463
- AsiaJerusalem = "Asia/Jerusalem",
3464
- AsiaKabul = "Asia/Kabul",
3465
- AsiaKamchatka = "Asia/Kamchatka",
3466
- AsiaKarachi = "Asia/Karachi",
3467
- AsiaKathmandu = "Asia/Kathmandu",
3468
- AsiaKolkata = "Asia/Kolkata",
3469
- AsiaKrasnoyarsk = "Asia/Krasnoyarsk",
3470
- AsiaKualaLumpur = "Asia/Kuala_Lumpur",
3471
- AsiaKuwait = "Asia/Kuwait",
3472
- AsiaMagadan = "Asia/Magadan",
3473
- AsiaMuscat = "Asia/Muscat",
3474
- AsiaNovosibirsk = "Asia/Novosibirsk",
3475
- AsiaRangoon = "Asia/Rangoon",
3476
- AsiaRiyadh = "Asia/Riyadh",
3477
- AsiaSeoul = "Asia/Seoul",
3478
- AsiaShanghai = "Asia/Shanghai",
3479
- AsiaSingapore = "Asia/Singapore",
3480
- AsiaSrednekolymsk = "Asia/Srednekolymsk",
3481
- AsiaTaipei = "Asia/Taipei",
3482
- AsiaTashkent = "Asia/Tashkent",
3483
- AsiaTbilisi = "Asia/Tbilisi",
3484
- AsiaTehran = "Asia/Tehran",
3485
- AsiaTokyo = "Asia/Tokyo",
3486
- AsiaUlaanbaatar = "Asia/Ulaanbaatar",
3487
- AsiaUrumqi = "Asia/Urumqi",
3488
- AsiaVladivostok = "Asia/Vladivostok",
3489
- AsiaYakutsk = "Asia/Yakutsk",
3490
- AsiaYekaterinburg = "Asia/Yekaterinburg",
3491
- AsiaYerevan = "Asia/Yerevan",
3492
- AtlanticAzores = "Atlantic/Azores",
3493
- AtlanticCapeVerde = "Atlantic/Cape_Verde",
3494
- AtlanticSouthGeorgia = "Atlantic/South_Georgia",
3495
- AustraliaAdelaide = "Australia/Adelaide",
3496
- AustraliaBrisbane = "Australia/Brisbane",
3497
- AustraliaDarwin = "Australia/Darwin",
3498
- AustraliaHobart = "Australia/Hobart",
3499
- AustraliaMelbourne = "Australia/Melbourne",
3500
- AustraliaPerth = "Australia/Perth",
3501
- AustraliaSydney = "Australia/Sydney",
3502
- EuropeAmsterdam = "Europe/Amsterdam",
3503
- EuropeAthens = "Europe/Athens",
3504
- EuropeBelgrade = "Europe/Belgrade",
3505
- EuropeBerlin = "Europe/Berlin",
3506
- EuropeBratislava = "Europe/Bratislava",
3507
- EuropeBrussels = "Europe/Brussels",
3508
- EuropeBucharest = "Europe/Bucharest",
3509
- EuropeBudapest = "Europe/Budapest",
3510
- EuropeCopenhagen = "Europe/Copenhagen",
3511
- EuropeDublin = "Europe/Dublin",
3512
- EuropeHelsinki = "Europe/Helsinki",
3513
- EuropeIstanbul = "Europe/Istanbul",
3514
- EuropeKaliningrad = "Europe/Kaliningrad",
3515
- EuropeKiev = "Europe/Kiev",
3516
- EuropeLisbon = "Europe/Lisbon",
3517
- EuropeLjubljana = "Europe/Ljubljana",
3518
- EuropeLondon = "Europe/London",
3519
- EuropeMadrid = "Europe/Madrid",
3520
- EuropeMinsk = "Europe/Minsk",
3521
- EuropeMoscow = "Europe/Moscow",
3522
- EuropeParis = "Europe/Paris",
3523
- EuropePrague = "Europe/Prague",
3524
- EuropeRiga = "Europe/Riga",
3525
- EuropeRome = "Europe/Rome",
3526
- EuropeSamara = "Europe/Samara",
3527
- EuropeSarajevo = "Europe/Sarajevo",
3528
- EuropeSkopje = "Europe/Skopje",
3529
- EuropeSofia = "Europe/Sofia",
3530
- EuropeStockholm = "Europe/Stockholm",
3531
- EuropeTallinn = "Europe/Tallinn",
3532
- EuropeVienna = "Europe/Vienna",
3533
- EuropeVilnius = "Europe/Vilnius",
3534
- EuropeVolgograd = "Europe/Volgograd",
3535
- EuropeWarsaw = "Europe/Warsaw",
3536
- EuropeZagreb = "Europe/Zagreb",
3537
- EuropeZurich = "Europe/Zurich",
3538
- GMT12 = "GMT+12",
3539
- PacificApia = "Pacific/Apia",
3540
- PacificAuckland = "Pacific/Auckland",
3541
- PacificChatham = "Pacific/Chatham",
3542
- PacificFakaofo = "Pacific/Fakaofo",
3543
- PacificFiji = "Pacific/Fiji",
3544
- PacificGuadalcanal = "Pacific/Guadalcanal",
3545
- PacificGuam = "Pacific/Guam",
3546
- PacificHonolulu = "Pacific/Honolulu",
3547
- PacificMajuro = "Pacific/Majuro",
3548
- PacificMidway = "Pacific/Midway",
3549
- PacificNoumea = "Pacific/Noumea",
3550
- PacificPagoPago = "Pacific/Pago_Pago",
3551
- PacificPortMoresby = "Pacific/Port_Moresby",
3552
- PacificTongatapu = "Pacific/Tongatapu"
3553
- }
3087
+ export type Timezone = "UTC" | "Africa/Algiers" | "Africa/Cairo" | "Africa/Casablanca" | "Africa/Harare" | "Africa/Johannesburg" | "Africa/Monrovia" | "Africa/Nairobi" | "America/Argentina/Buenos_Aires" | "America/Bogota" | "America/Caracas" | "America/Chicago" | "America/Chihuahua" | "America/Denver" | "America/Godthab" | "America/Guatemala" | "America/Guyana" | "America/Halifax" | "America/Indiana/Indianapolis" | "America/Juneau" | "America/La_Paz" | "America/Lima" | "America/Los_Angeles" | "America/Mazatlan" | "America/Mexico_City" | "America/Monterrey" | "America/Montevideo" | "America/New_York" | "America/Phoenix" | "America/Puerto_Rico" | "America/Regina" | "America/Santiago" | "America/Sao_Paulo" | "America/St_Johns" | "America/Tijuana" | "Asia/Almaty" | "Asia/Baghdad" | "Asia/Baku" | "Asia/Bangkok" | "Asia/Chongqing" | "Asia/Colombo" | "Asia/Dhaka" | "Asia/Hong_Kong" | "Asia/Irkutsk" | "Asia/Jakarta" | "Asia/Jerusalem" | "Asia/Kabul" | "Asia/Kamchatka" | "Asia/Karachi" | "Asia/Kathmandu" | "Asia/Kolkata" | "Asia/Krasnoyarsk" | "Asia/Kuala_Lumpur" | "Asia/Kuwait" | "Asia/Magadan" | "Asia/Muscat" | "Asia/Novosibirsk" | "Asia/Rangoon" | "Asia/Riyadh" | "Asia/Seoul" | "Asia/Shanghai" | "Asia/Singapore" | "Asia/Srednekolymsk" | "Asia/Taipei" | "Asia/Tashkent" | "Asia/Tbilisi" | "Asia/Tehran" | "Asia/Tokyo" | "Asia/Ulaanbaatar" | "Asia/Urumqi" | "Asia/Vladivostok" | "Asia/Yakutsk" | "Asia/Yekaterinburg" | "Asia/Yerevan" | "Atlantic/Azores" | "Atlantic/Cape_Verde" | "Atlantic/South_Georgia" | "Australia/Adelaide" | "Australia/Brisbane" | "Australia/Darwin" | "Australia/Hobart" | "Australia/Melbourne" | "Australia/Perth" | "Australia/Sydney" | "Europe/Amsterdam" | "Europe/Athens" | "Europe/Belgrade" | "Europe/Berlin" | "Europe/Bratislava" | "Europe/Brussels" | "Europe/Bucharest" | "Europe/Budapest" | "Europe/Copenhagen" | "Europe/Dublin" | "Europe/Helsinki" | "Europe/Istanbul" | "Europe/Kaliningrad" | "Europe/Kiev" | "Europe/Lisbon" | "Europe/Ljubljana" | "Europe/London" | "Europe/Madrid" | "Europe/Minsk" | "Europe/Moscow" | "Europe/Paris" | "Europe/Prague" | "Europe/Riga" | "Europe/Rome" | "Europe/Samara" | "Europe/Sarajevo" | "Europe/Skopje" | "Europe/Sofia" | "Europe/Stockholm" | "Europe/Tallinn" | "Europe/Vienna" | "Europe/Vilnius" | "Europe/Volgograd" | "Europe/Warsaw" | "Europe/Zagreb" | "Europe/Zurich" | "GMT+12" | "Pacific/Apia" | "Pacific/Auckland" | "Pacific/Chatham" | "Pacific/Fakaofo" | "Pacific/Fiji" | "Pacific/Guadalcanal" | "Pacific/Guam" | "Pacific/Honolulu" | "Pacific/Majuro" | "Pacific/Midway" | "Pacific/Noumea" | "Pacific/Pago_Pago" | "Pacific/Port_Moresby" | "Pacific/Tongatapu";
3554
3088
  export interface Wallet {
3555
3089
  wallet: WalletObject;
3556
3090
  }
@@ -3563,7 +3097,7 @@ export interface WalletCreateInput {
3563
3097
  name?: string;
3564
3098
  /**
3565
3099
  * The rate of conversion between credits and the amount in the specified currency. It indicates the ratio or factor used to convert credits into the corresponding monetary value in the currency of the transaction.
3566
- * @format ^[0-9]+.?[0-9]*$
3100
+ * @pattern ^[0-9]+.?[0-9]*$
3567
3101
  * @example "1.5"
3568
3102
  */
3569
3103
  rate_amount: string;
@@ -3571,13 +3105,13 @@ export interface WalletCreateInput {
3571
3105
  currency: Currency;
3572
3106
  /**
3573
3107
  * The number of paid credits. Required only if there is no granted credits.
3574
- * @format ^[0-9]+.?[0-9]*$
3108
+ * @pattern ^[0-9]+.?[0-9]*$
3575
3109
  * @example "20.0"
3576
3110
  */
3577
3111
  paid_credits?: string | null;
3578
3112
  /**
3579
3113
  * The number of free granted credits. Required only if there is no paid credits.
3580
- * @format ^[0-9]+.?[0-9]*$
3114
+ * @pattern ^[0-9]+.?[0-9]*$
3581
3115
  * @example "10.0"
3582
3116
  */
3583
3117
  granted_credits?: string | null;
@@ -3626,13 +3160,13 @@ export interface WalletObject {
3626
3160
  name?: string;
3627
3161
  /**
3628
3162
  * The rate of conversion between credits and the amount in the specified currency. It indicates the ratio or factor used to convert credits into the corresponding monetary value in the currency of the transaction.
3629
- * @format ^[0-9]+.?[0-9]*$
3163
+ * @pattern ^[0-9]+.?[0-9]*$
3630
3164
  * @example "1.5"
3631
3165
  */
3632
3166
  rate_amount: string;
3633
3167
  /**
3634
3168
  * The current wallet balance expressed in credits.
3635
- * @format ^[0-9]+.?[0-9]*$
3169
+ * @pattern ^[0-9]+.?[0-9]*$
3636
3170
  * @example "28.0"
3637
3171
  */
3638
3172
  credits_balance: string;
@@ -3643,7 +3177,7 @@ export interface WalletObject {
3643
3177
  balance_cents: number;
3644
3178
  /**
3645
3179
  * The number of consumed credits.
3646
- * @format ^[0-9]+.?[0-9]*$
3180
+ * @pattern ^[0-9]+.?[0-9]*$
3647
3181
  * @example "2.0"
3648
3182
  */
3649
3183
  consumed_credits: string;
@@ -3692,13 +3226,13 @@ export interface WalletTransactionCreateInput {
3692
3226
  wallet_id: string;
3693
3227
  /**
3694
3228
  * The number of paid credits. Required only if there is no granted credits.
3695
- * @format ^[0-9]+.?[0-9]*$
3229
+ * @pattern ^[0-9]+.?[0-9]*$
3696
3230
  * @example "20.0"
3697
3231
  */
3698
3232
  paid_credits?: string;
3699
3233
  /**
3700
3234
  * The number of free granted credits. Required only if there is no paid credits.
3701
- * @format ^[0-9]+.?[0-9]*$
3235
+ * @pattern ^[0-9]+.?[0-9]*$
3702
3236
  * @example "10.0"
3703
3237
  */
3704
3238
  granted_credits?: string;
@@ -3729,13 +3263,13 @@ export interface WalletTransactionObject {
3729
3263
  transaction_type: "inbound" | "outbound";
3730
3264
  /**
3731
3265
  * The amount of credits based on the rate and the currency.
3732
- * @format ^[0-9]+.?[0-9]*$
3266
+ * @pattern ^[0-9]+.?[0-9]*$
3733
3267
  * @example "10.0"
3734
3268
  */
3735
3269
  amount: string;
3736
3270
  /**
3737
3271
  * The number of credits used in the wallet transaction.
3738
- * @format ^[0-9]+.?[0-9]*$
3272
+ * @pattern ^[0-9]+.?[0-9]*$
3739
3273
  * @example "100.0"
3740
3274
  */
3741
3275
  credit_amount: string;
@@ -3773,6 +3307,71 @@ export interface WalletUpdateInput {
3773
3307
  expiration_at?: string | null;
3774
3308
  };
3775
3309
  }
3310
+ export interface WebhookEndpoint {
3311
+ webhook_endpoint: WebhookEndpointObject;
3312
+ }
3313
+ export interface WebhookEndpointCreateInput {
3314
+ webhook_endpoint?: {
3315
+ /**
3316
+ * The URL of the webhook endpoint.
3317
+ * @example "https://foo.bar"
3318
+ */
3319
+ webhook_url: string;
3320
+ /**
3321
+ * The signature used for the webhook. If no value is passed,
3322
+ * @example "hmac"
3323
+ */
3324
+ signature_algo?: "jwt" | "hmac" | null;
3325
+ };
3326
+ }
3327
+ export interface WebhookEndpointObject {
3328
+ /**
3329
+ * Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the webhook endpoint's record within the Lago system.
3330
+ * @format uuid
3331
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3332
+ */
3333
+ lago_id: string;
3334
+ /**
3335
+ * Unique identifier assigned to the organization attached to the webhook endpoint within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the organization’s record within the Lago system.
3336
+ * @format uuid
3337
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
3338
+ */
3339
+ lago_organization_id: string;
3340
+ /**
3341
+ * The name of the wallet.
3342
+ * @example "Prepaid"
3343
+ */
3344
+ webhook_url: string;
3345
+ /**
3346
+ * The signature algo for the webhook.
3347
+ * @example "hmac"
3348
+ */
3349
+ signature_algo?: "jwt" | "hmac";
3350
+ /**
3351
+ * The date of the webhook endpoint creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
3352
+ * @format date-time
3353
+ * @example "2022-04-29T08:59:51Z"
3354
+ */
3355
+ created_at: string;
3356
+ }
3357
+ export interface WebhookEndpointsPaginated {
3358
+ webhook_endpoints: WebhookEndpointObject[];
3359
+ meta: PaginationMeta;
3360
+ }
3361
+ export interface WebhookEndpointUpdateInput {
3362
+ webhook_endpoint?: {
3363
+ /**
3364
+ * The URL of the webhook endpoint.
3365
+ * @example "https://foo.bar"
3366
+ */
3367
+ webhook_url: string;
3368
+ /**
3369
+ * The signature used for the webhook. If no value is passed,
3370
+ * @example "hmac"
3371
+ */
3372
+ signature_algo?: "jwt" | "hmac" | null;
3373
+ };
3374
+ }
3776
3375
  export type QueryParamsType = Record<string | number, any>;
3777
3376
  export type ResponseFormat = keyof Omit<Body, "body" | "bodyUsed">;
3778
3377
  export interface FullRequestParams extends Omit<RequestInit, "body"> {
@@ -3833,7 +3432,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
3833
3432
  }
3834
3433
  /**
3835
3434
  * @title Lago API documentation
3836
- * @version 0.45.0-beta
3435
+ * @version 0.49.0-beta
3837
3436
  * @license AGPLv3
3838
3437
  * @baseUrl https://api.getlago.com/api/v1
3839
3438
  * @externalDocs https://github.com/getlago
@@ -3905,19 +3504,6 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3905
3504
  */
3906
3505
  destroyAddOn: (code: string, params?: RequestParams) => Promise<HttpResponse<AddOn, ApiErrorUnauthorized | ApiErrorNotFound>>;
3907
3506
  };
3908
- appliedAddOns: {
3909
- /**
3910
- * @description Apply an add-on to a customer
3911
- *
3912
- * @tags add_ons
3913
- * @name ApplyAddOn
3914
- * @summary Apply an add-on to a customer
3915
- * @request POST:/applied_add_ons
3916
- * @deprecated
3917
- * @secure
3918
- */
3919
- applyAddOn: (data: AppliedAddOnInput, params?: RequestParams) => Promise<HttpResponse<AppliedAddOn, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
3920
- };
3921
3507
  appliedCoupons: {
3922
3508
  /**
3923
3509
  * @description This endpoint is used to apply a specific coupon to a customer, before or during a subscription.
@@ -4282,6 +3868,42 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4282
3868
  */
4283
3869
  external_subscription_id: string;
4284
3870
  }, params?: RequestParams) => Promise<HttpResponse<CustomerUsage, ApiErrorUnauthorized | ApiErrorNotFound>>;
3871
+ /**
3872
+ * @description This endpoint enables the retrieval of the usage-based billing data for a customer within past periods.
3873
+ *
3874
+ * @tags customers
3875
+ * @name FindAllCustomerPastUsage
3876
+ * @summary Retrieve customer past usage
3877
+ * @request GET:/customers/{external_customer_id}/past_usage
3878
+ * @secure
3879
+ */
3880
+ findAllCustomerPastUsage: (externalCustomerId: string, query: {
3881
+ /**
3882
+ * Page number.
3883
+ * @example 1
3884
+ */
3885
+ page?: number;
3886
+ /**
3887
+ * Number of records per page.
3888
+ * @example 20
3889
+ */
3890
+ per_page?: number;
3891
+ /**
3892
+ * The unique identifier of the subscription within your application.
3893
+ * @example "sub_1234567890"
3894
+ */
3895
+ external_subscription_id: string;
3896
+ /**
3897
+ * Billable metric code filter to apply to the charge usage
3898
+ * @example "cpu"
3899
+ */
3900
+ billable_metric_code?: string;
3901
+ /**
3902
+ * Number of past billing period to returns in the result
3903
+ * @example 5
3904
+ */
3905
+ periods_count?: number;
3906
+ }, params?: RequestParams) => Promise<HttpResponse<CustomerPastUsage, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4285
3907
  };
4286
3908
  events: {
4287
3909
  /**
@@ -4301,6 +3923,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4301
3923
  * @name CreateBatchEvents
4302
3924
  * @summary Batch multiple events
4303
3925
  * @request POST:/events/batch
3926
+ * @deprecated
4304
3927
  * @secure
4305
3928
  */
4306
3929
  createBatchEvents: (data: EventBatchInput, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
@@ -4679,6 +4302,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4679
4302
  */
4680
4303
  status?: ("pending" | "canceled" | "terminated" | "active")[];
4681
4304
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
4305
+ /**
4306
+ * @description This endpoint retrieves a specific subscription.
4307
+ *
4308
+ * @tags subscriptions
4309
+ * @name FindSubscription
4310
+ * @summary Retrieve a subscription
4311
+ * @request GET:/subscriptions/{external_id}
4312
+ * @secure
4313
+ */
4314
+ findSubscription: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Subscription, ApiErrorUnauthorized | ApiErrorNotFound>>;
4682
4315
  /**
4683
4316
  * @description This endpoint allows you to update a subscription.
4684
4317
  *
@@ -4902,51 +4535,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4902
4535
  * @request POST:/webhook_endpoints
4903
4536
  * @secure
4904
4537
  */
4905
- createWebhookEndpoint: (data: {
4906
- webhook_endpoint?: {
4907
- /**
4908
- * The URL of the webhook endpoint.
4909
- * @example "https://foo.bar"
4910
- */
4911
- webhook_url: string;
4912
- /**
4913
- * The signature used for the webhook. If no value is passed,
4914
- * @example "hmac"
4915
- */
4916
- signature_algo?: "jwt" | "hmac" | null;
4917
- };
4918
- }, params?: RequestParams) => Promise<HttpResponse<{
4919
- webhook_endpoint: {
4920
- /**
4921
- * Unique identifier assigned to the wallet within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the webhook endpoint's record within the Lago system.
4922
- * @format uuid
4923
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4924
- */
4925
- lago_id: string;
4926
- /**
4927
- * Unique identifier assigned to the organization attached to the webhook endpoint within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the organization’s record within the Lago system.
4928
- * @format uuid
4929
- * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
4930
- */
4931
- lago_organization_id: string;
4932
- /**
4933
- * The name of the wallet.
4934
- * @example "Prepaid"
4935
- */
4936
- webhook_url: string;
4937
- /**
4938
- * The signature algo for the webhook.
4939
- * @example "hmac"
4940
- */
4941
- signature_algo?: "jwt" | "hmac";
4942
- /**
4943
- * The date of the webhook endpoint creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
4944
- * @format date-time
4945
- * @example "2022-04-29T08:59:51Z"
4946
- */
4947
- created_at: string;
4948
- };
4949
- }, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4538
+ createWebhookEndpoint: (data: WebhookEndpointCreateInput, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4950
4539
  /**
4951
4540
  * @description This endpoint is used to list all webhook endpoints.
4952
4541
  *
@@ -4967,10 +4556,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4967
4556
  * @example 20
4968
4557
  */
4969
4558
  per_page?: number;
4970
- }, params?: RequestParams) => Promise<HttpResponse<{
4971
- webhook_endpoints: any[];
4972
- meta: PaginationMeta;
4973
- }, ApiErrorUnauthorized>>;
4559
+ }, params?: RequestParams) => Promise<HttpResponse<WebhookEndpointsPaginated, ApiErrorUnauthorized>>;
4974
4560
  /**
4975
4561
  * @description This endpoint is used to update an existing webhook endpoint.
4976
4562
  *
@@ -4980,20 +4566,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4980
4566
  * @request PUT:/webhook_endpoints/{lago_id}
4981
4567
  * @secure
4982
4568
  */
4983
- updateWebhookEndpoint: (lagoId: string, data: {
4984
- webhook_endpoint?: {
4985
- /**
4986
- * The URL of the webhook endpoint.
4987
- * @example "https://foo.bar"
4988
- */
4989
- webhook_url: string;
4990
- /**
4991
- * The signature used for the webhook. If no value is passed,
4992
- * @example "hmac"
4993
- */
4994
- signature_algo?: "jwt" | "hmac" | null;
4995
- };
4996
- }, params?: RequestParams) => Promise<HttpResponse<any, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4569
+ updateWebhookEndpoint: (lagoId: string, data: WebhookEndpointUpdateInput, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4997
4570
  /**
4998
4571
  * @description This endpoint is used to retrieve an existing webhook endpoint.
4999
4572
  *
@@ -5003,7 +4576,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5003
4576
  * @request GET:/webhook_endpoints/{lago_id}
5004
4577
  * @secure
5005
4578
  */
5006
- findWebhookEndpoint: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<any, ApiErrorUnauthorized | ApiErrorNotFound>>;
4579
+ findWebhookEndpoint: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorUnauthorized | ApiErrorNotFound>>;
5007
4580
  /**
5008
4581
  * @description This endpoint is used to delete an existing webhook endpoint.
5009
4582
  *
@@ -5013,7 +4586,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5013
4586
  * @request DELETE:/webhook_endpoints/{lago_id}
5014
4587
  * @secure
5015
4588
  */
5016
- destroyWebhookEndpoint: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<any, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
4589
+ destroyWebhookEndpoint: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<WebhookEndpoint, ApiErrorUnauthorized | ApiErrorNotAllowed | ApiErrorNotFound>>;
5017
4590
  };
5018
4591
  }
5019
4592
  export {};