lago-javascript-client 0.49.0-beta → 0.51.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.
@@ -899,6 +899,131 @@ export interface CouponsPaginated {
899
899
  export interface CouponUpdateInput {
900
900
  coupon: CouponBaseInput;
901
901
  }
902
+ export interface CreditNoteEstimateInput {
903
+ credit_note: {
904
+ /**
905
+ * The invoice unique identifier, created by Lago.
906
+ * @format uuid
907
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
908
+ */
909
+ invoice_id: string;
910
+ /**
911
+ * The list of credit note’s items.
912
+ * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":10},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":5}]
913
+ */
914
+ items: {
915
+ /**
916
+ * The fee unique identifier, created by Lago.
917
+ * @format uuid
918
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
919
+ */
920
+ fee_id: string;
921
+ /**
922
+ * The amount of the credit note item, expressed in cents.
923
+ * @example 10
924
+ */
925
+ amount_cents: number;
926
+ }[];
927
+ };
928
+ }
929
+ export interface CreditNoteEstimated {
930
+ estimated_credit_note: {
931
+ /**
932
+ * Unique identifier assigned to the invoice that the credit note belongs to
933
+ * @format uuid
934
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
935
+ */
936
+ lago_invoice_id: string;
937
+ /**
938
+ * The invoice unique number, related to the credit note.
939
+ * @example "LAG-1234"
940
+ */
941
+ invoice_number: string;
942
+ /** The currency of the credit note. */
943
+ currency: Currency;
944
+ /**
945
+ * The tax amount of the credit note, expressed in cents.
946
+ * @example 20
947
+ */
948
+ taxes_amount_cents: number;
949
+ /**
950
+ * The tax rate associated with this specific credit note.
951
+ * @example 20
952
+ */
953
+ taxes_rate: number;
954
+ /**
955
+ * The subtotal of the credit note excluding any applicable taxes, expressed in cents.
956
+ * @example 100
957
+ */
958
+ sub_total_excluding_taxes_amount_cents: number;
959
+ /**
960
+ * The credited amount of the credit note, expressed in cents.
961
+ * @example 100
962
+ */
963
+ max_creditable_amount_cents: number;
964
+ /**
965
+ * The refunded amount of the credit note, expressed in cents.
966
+ * @example 0
967
+ */
968
+ max_refundable_amount_cents: number;
969
+ /**
970
+ * The pro-rated amount of the coupons applied to the source invoice.
971
+ * @example 20
972
+ */
973
+ coupons_adjustment_amount_cents: number;
974
+ /** Array of credit note’s items. */
975
+ items: {
976
+ /**
977
+ * The credit note’s item amount, expressed in cents.
978
+ * @example 100
979
+ */
980
+ amount_cents: number;
981
+ /**
982
+ * Unique identifier assigned to the fee within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the fee’s record within the Lago system.
983
+ * @format uuid
984
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
985
+ */
986
+ lago_fee_id: string | null;
987
+ }[];
988
+ applied_taxes?: {
989
+ /**
990
+ * Unique identifier of the tax, created by Lago.
991
+ * @format uuid
992
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
993
+ */
994
+ lago_tax_id?: string;
995
+ /**
996
+ * Name of the tax.
997
+ * @example "TVA"
998
+ */
999
+ tax_name?: string;
1000
+ /**
1001
+ * Unique code used to identify the tax associated with the API request.
1002
+ * @example "french_standard_vat"
1003
+ */
1004
+ tax_code?: string;
1005
+ /**
1006
+ * The percentage rate of the tax
1007
+ * @example 20
1008
+ */
1009
+ tax_rate?: number;
1010
+ /**
1011
+ * Internal description of the taxe
1012
+ * @example "French standard VAT"
1013
+ */
1014
+ tax_description?: string;
1015
+ /** @example 100 */
1016
+ base_amount_cents?: number;
1017
+ /**
1018
+ * Amount of the tax
1019
+ * @example 2000
1020
+ */
1021
+ amount_cents?: number;
1022
+ /** Currency of the tax */
1023
+ amount_currency?: Currency;
1024
+ }[];
1025
+ };
1026
+ }
902
1027
  export interface CreditObject {
903
1028
  /**
904
1029
  * Unique identifier assigned to the credit within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit’s item record within the Lago system.
@@ -1086,7 +1211,7 @@ export interface CreditNoteObject {
1086
1211
  * The pro-rated amount of the coupons applied to the source invoice.
1087
1212
  * @example 20
1088
1213
  */
1089
- coupons_adjustement_amount_cents: number;
1214
+ coupons_adjustment_amount_cents: number;
1090
1215
  /**
1091
1216
  * The date when the credit note was created. It is expressed in Coordinated Universal Time (UTC).
1092
1217
  * @format date-time
@@ -1749,12 +1874,12 @@ export interface EventObject {
1749
1874
  * @format uuid
1750
1875
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1751
1876
  */
1752
- lago_customer_id: string;
1877
+ lago_customer_id: string | null;
1753
1878
  /**
1754
1879
  * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1755
1880
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1756
1881
  */
1757
- external_customer_id: string;
1882
+ external_customer_id: string | null;
1758
1883
  /**
1759
1884
  * The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
1760
1885
  * @example "storage"
@@ -1780,12 +1905,12 @@ export interface EventObject {
1780
1905
  * @format uuid
1781
1906
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1782
1907
  */
1783
- lago_subscription_id: string;
1908
+ lago_subscription_id: string | null;
1784
1909
  /**
1785
1910
  * The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided.
1786
1911
  * @example "sub_1234567890"
1787
1912
  */
1788
- external_subscription_id: string;
1913
+ external_subscription_id: string | null;
1789
1914
  /**
1790
1915
  * The creation date of the event's record in the Lago application, presented in the ISO 8601 datetime format, specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record was created within the Lago application
1791
1916
  * @format date-time
@@ -1884,6 +2009,11 @@ export interface FeeObject {
1884
2009
  * @example "0.32"
1885
2010
  */
1886
2011
  units: string;
2012
+ /**
2013
+ * The unit amount of the fee per unit, with precision.
2014
+ * @example "312.5"
2015
+ */
2016
+ precise_unit_amount: string;
1887
2017
  /**
1888
2018
  * The cost of this specific fee, including any applicable taxes.
1889
2019
  * @example 120
@@ -1974,6 +2104,11 @@ export interface FeeObject {
1974
2104
  * @example "Setup Fee (SF1)"
1975
2105
  */
1976
2106
  invoice_display_name?: string;
2107
+ /**
2108
+ * 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.
2109
+ * @example "Transactions - ACH"
2110
+ */
2111
+ group_invoice_display_name?: string;
1977
2112
  /**
1978
2113
  * 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`.
1979
2114
  * @format uuid
@@ -2607,6 +2742,77 @@ export interface PlanCreateInput {
2607
2742
  }[];
2608
2743
  };
2609
2744
  }
2745
+ /** Based plan overrides. */
2746
+ export interface PlanOverridesObject {
2747
+ /**
2748
+ * The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
2749
+ * @example 10000
2750
+ */
2751
+ amount_cents?: number;
2752
+ /** The currency of the plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed. */
2753
+ amount_currency?: Currency;
2754
+ /**
2755
+ * The description on the plan.
2756
+ * @example "Plan for early stage startups."
2757
+ */
2758
+ description?: string;
2759
+ /**
2760
+ * 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.
2761
+ * @example "Startup plan"
2762
+ */
2763
+ invoice_display_name?: string;
2764
+ /**
2765
+ * The name of the plan.
2766
+ * @example "Startup"
2767
+ */
2768
+ name?: string;
2769
+ /**
2770
+ * List of unique code used to identify the taxes.
2771
+ * @example ["french_standard_vat"]
2772
+ */
2773
+ tax_codes?: string[];
2774
+ /**
2775
+ * The duration in days during which the base cost of the plan is offered for free.
2776
+ * @example 5
2777
+ */
2778
+ trial_period?: number;
2779
+ /** Additional usage-based charges for this plan. */
2780
+ charges?: {
2781
+ /**
2782
+ * Unique identifier of the charge created by Lago.
2783
+ * @format uuid
2784
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2785
+ */
2786
+ id?: string;
2787
+ /**
2788
+ * 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.
2789
+ * @example "Setup"
2790
+ */
2791
+ invoice_display_name?: string;
2792
+ /**
2793
+ * The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
2794
+ * @example 0
2795
+ */
2796
+ min_amount_cents?: number;
2797
+ /** List of all thresholds utilized for calculating the charge. */
2798
+ properties?: ChargeProperties;
2799
+ /** All charge information, sorted by groups. */
2800
+ group_properties?: {
2801
+ /**
2802
+ * Unique identifier of a billable metric group, created by Lago.
2803
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2804
+ */
2805
+ group_id: string;
2806
+ /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
2807
+ values: ChargeProperties;
2808
+ }[];
2809
+ /**
2810
+ * List of unique code used to identify the taxes.
2811
+ * @example ["french_standard_vat"]
2812
+ */
2813
+ tax_codes?: string[];
2814
+ }[];
2815
+ }
2610
2816
  export interface PlanUpdateInput {
2611
2817
  plan: {
2612
2818
  /**
@@ -2815,7 +3021,7 @@ export interface PlansPaginated {
2815
3021
  meta: PaginationMeta;
2816
3022
  }
2817
3023
  export interface Subscription {
2818
- subscription: SubscriptionObject;
3024
+ subscription: SubscriptionObjectExtended;
2819
3025
  }
2820
3026
  export interface SubscriptionCreateInput {
2821
3027
  subscription: {
@@ -2856,6 +3062,8 @@ export interface SubscriptionCreateInput {
2856
3062
  * @example "2022-08-08T00:00:00Z"
2857
3063
  */
2858
3064
  subscription_at?: string;
3065
+ /** Based plan overrides. */
3066
+ plan_overrides?: PlanOverridesObject;
2859
3067
  };
2860
3068
  }
2861
3069
  export interface SubscriptionUpdateInput {
@@ -2877,6 +3085,8 @@ export interface SubscriptionUpdateInput {
2877
3085
  * @example "2022-08-08T00:00:00Z"
2878
3086
  */
2879
3087
  subscription_at?: string;
3088
+ /** Based plan overrides. */
3089
+ plan_overrides?: PlanOverridesObject;
2880
3090
  };
2881
3091
  }
2882
3092
  export interface SubscriptionObject {
@@ -2979,6 +3189,9 @@ export interface SubscriptionObject {
2979
3189
  */
2980
3190
  downgrade_plan_date?: string | null;
2981
3191
  }
3192
+ export type SubscriptionObjectExtended = SubscriptionObject & {
3193
+ plan?: PlanObject;
3194
+ };
2982
3195
  export interface SubscriptionsPaginated {
2983
3196
  subscriptions: SubscriptionObject[];
2984
3197
  meta: PaginationMeta;
@@ -3761,6 +3974,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3761
3974
  * @secure
3762
3975
  */
3763
3976
  downloadCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotFound>>;
3977
+ /**
3978
+ * @description This endpoint allows you to retrieve amounts for a new credit note creation.
3979
+ *
3980
+ * @tags credit_notes
3981
+ * @name EstimateCreditNote
3982
+ * @summary Estimate amounts for a new credit note
3983
+ * @request POST:/credit_notes/estimate
3984
+ * @secure
3985
+ */
3986
+ estimateCreditNote: (data: CreditNoteEstimateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteEstimated, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
3764
3987
  /**
3765
3988
  * @description This endpoint voids an existing credit note.
3766
3989
  *
@@ -3915,7 +4138,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3915
4138
  * @request POST:/events
3916
4139
  * @secure
3917
4140
  */
3918
- createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4141
+ createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
3919
4142
  /**
3920
4143
  * @description This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer.
3921
4144
  *
@@ -558,6 +558,24 @@ export class Api extends HttpClient {
558
558
  format: "json",
559
559
  ...params,
560
560
  }),
561
+ /**
562
+ * @description This endpoint allows you to retrieve amounts for a new credit note creation.
563
+ *
564
+ * @tags credit_notes
565
+ * @name EstimateCreditNote
566
+ * @summary Estimate amounts for a new credit note
567
+ * @request POST:/credit_notes/estimate
568
+ * @secure
569
+ */
570
+ estimateCreditNote: (data, params = {}) => this.request({
571
+ path: `/credit_notes/estimate`,
572
+ method: "POST",
573
+ body: data,
574
+ secure: true,
575
+ type: ContentType.Json,
576
+ format: "json",
577
+ ...params,
578
+ }),
561
579
  /**
562
580
  * @description This endpoint voids an existing credit note.
563
581
  *
@@ -726,6 +744,7 @@ export class Api extends HttpClient {
726
744
  body: data,
727
745
  secure: true,
728
746
  type: ContentType.Json,
747
+ format: "json",
729
748
  ...params,
730
749
  }),
731
750
  /**
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "main": "./script/mod.js",
4
4
  "name": "lago-javascript-client",
5
5
  "sideEffects": false,
6
- "version": "v0.49.0-beta",
6
+ "version": "v0.51.0-beta",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",
@@ -899,6 +899,131 @@ export interface CouponsPaginated {
899
899
  export interface CouponUpdateInput {
900
900
  coupon: CouponBaseInput;
901
901
  }
902
+ export interface CreditNoteEstimateInput {
903
+ credit_note: {
904
+ /**
905
+ * The invoice unique identifier, created by Lago.
906
+ * @format uuid
907
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
908
+ */
909
+ invoice_id: string;
910
+ /**
911
+ * The list of credit note’s items.
912
+ * @example [{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a90","amount_cents":10},{"fee_id":"1a901a90-1a90-1a90-1a90-1a901a901a91","amount_cents":5}]
913
+ */
914
+ items: {
915
+ /**
916
+ * The fee unique identifier, created by Lago.
917
+ * @format uuid
918
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
919
+ */
920
+ fee_id: string;
921
+ /**
922
+ * The amount of the credit note item, expressed in cents.
923
+ * @example 10
924
+ */
925
+ amount_cents: number;
926
+ }[];
927
+ };
928
+ }
929
+ export interface CreditNoteEstimated {
930
+ estimated_credit_note: {
931
+ /**
932
+ * Unique identifier assigned to the invoice that the credit note belongs to
933
+ * @format uuid
934
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
935
+ */
936
+ lago_invoice_id: string;
937
+ /**
938
+ * The invoice unique number, related to the credit note.
939
+ * @example "LAG-1234"
940
+ */
941
+ invoice_number: string;
942
+ /** The currency of the credit note. */
943
+ currency: Currency;
944
+ /**
945
+ * The tax amount of the credit note, expressed in cents.
946
+ * @example 20
947
+ */
948
+ taxes_amount_cents: number;
949
+ /**
950
+ * The tax rate associated with this specific credit note.
951
+ * @example 20
952
+ */
953
+ taxes_rate: number;
954
+ /**
955
+ * The subtotal of the credit note excluding any applicable taxes, expressed in cents.
956
+ * @example 100
957
+ */
958
+ sub_total_excluding_taxes_amount_cents: number;
959
+ /**
960
+ * The credited amount of the credit note, expressed in cents.
961
+ * @example 100
962
+ */
963
+ max_creditable_amount_cents: number;
964
+ /**
965
+ * The refunded amount of the credit note, expressed in cents.
966
+ * @example 0
967
+ */
968
+ max_refundable_amount_cents: number;
969
+ /**
970
+ * The pro-rated amount of the coupons applied to the source invoice.
971
+ * @example 20
972
+ */
973
+ coupons_adjustment_amount_cents: number;
974
+ /** Array of credit note’s items. */
975
+ items: {
976
+ /**
977
+ * The credit note’s item amount, expressed in cents.
978
+ * @example 100
979
+ */
980
+ amount_cents: number;
981
+ /**
982
+ * Unique identifier assigned to the fee within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the fee’s record within the Lago system.
983
+ * @format uuid
984
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
985
+ */
986
+ lago_fee_id: string | null;
987
+ }[];
988
+ applied_taxes?: {
989
+ /**
990
+ * Unique identifier of the tax, created by Lago.
991
+ * @format uuid
992
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
993
+ */
994
+ lago_tax_id?: string;
995
+ /**
996
+ * Name of the tax.
997
+ * @example "TVA"
998
+ */
999
+ tax_name?: string;
1000
+ /**
1001
+ * Unique code used to identify the tax associated with the API request.
1002
+ * @example "french_standard_vat"
1003
+ */
1004
+ tax_code?: string;
1005
+ /**
1006
+ * The percentage rate of the tax
1007
+ * @example 20
1008
+ */
1009
+ tax_rate?: number;
1010
+ /**
1011
+ * Internal description of the taxe
1012
+ * @example "French standard VAT"
1013
+ */
1014
+ tax_description?: string;
1015
+ /** @example 100 */
1016
+ base_amount_cents?: number;
1017
+ /**
1018
+ * Amount of the tax
1019
+ * @example 2000
1020
+ */
1021
+ amount_cents?: number;
1022
+ /** Currency of the tax */
1023
+ amount_currency?: Currency;
1024
+ }[];
1025
+ };
1026
+ }
902
1027
  export interface CreditObject {
903
1028
  /**
904
1029
  * Unique identifier assigned to the credit within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the credit’s item record within the Lago system.
@@ -1086,7 +1211,7 @@ export interface CreditNoteObject {
1086
1211
  * The pro-rated amount of the coupons applied to the source invoice.
1087
1212
  * @example 20
1088
1213
  */
1089
- coupons_adjustement_amount_cents: number;
1214
+ coupons_adjustment_amount_cents: number;
1090
1215
  /**
1091
1216
  * The date when the credit note was created. It is expressed in Coordinated Universal Time (UTC).
1092
1217
  * @format date-time
@@ -1749,12 +1874,12 @@ export interface EventObject {
1749
1874
  * @format uuid
1750
1875
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1751
1876
  */
1752
- lago_customer_id: string;
1877
+ lago_customer_id: string | null;
1753
1878
  /**
1754
1879
  * The customer external unique identifier (provided by your own application). This field is optional if you send the `external_subscription_id`, targeting a specific subscription.
1755
1880
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1756
1881
  */
1757
- external_customer_id: string;
1882
+ external_customer_id: string | null;
1758
1883
  /**
1759
1884
  * The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one of your active billable metrics. If the provided code does not correspond to any active billable metric, it will be ignored during the process.
1760
1885
  * @example "storage"
@@ -1780,12 +1905,12 @@ export interface EventObject {
1780
1905
  * @format uuid
1781
1906
  * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
1782
1907
  */
1783
- lago_subscription_id: string;
1908
+ lago_subscription_id: string | null;
1784
1909
  /**
1785
1910
  * The unique identifier of the subscription within your application. It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id` is not provided.
1786
1911
  * @example "sub_1234567890"
1787
1912
  */
1788
- external_subscription_id: string;
1913
+ external_subscription_id: string | null;
1789
1914
  /**
1790
1915
  * The creation date of the event's record in the Lago application, presented in the ISO 8601 datetime format, specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record was created within the Lago application
1791
1916
  * @format date-time
@@ -1884,6 +2009,11 @@ export interface FeeObject {
1884
2009
  * @example "0.32"
1885
2010
  */
1886
2011
  units: string;
2012
+ /**
2013
+ * The unit amount of the fee per unit, with precision.
2014
+ * @example "312.5"
2015
+ */
2016
+ precise_unit_amount: string;
1887
2017
  /**
1888
2018
  * The cost of this specific fee, including any applicable taxes.
1889
2019
  * @example 120
@@ -1974,6 +2104,11 @@ export interface FeeObject {
1974
2104
  * @example "Setup Fee (SF1)"
1975
2105
  */
1976
2106
  invoice_display_name?: string;
2107
+ /**
2108
+ * 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.
2109
+ * @example "Transactions - ACH"
2110
+ */
2111
+ group_invoice_display_name?: string;
1977
2112
  /**
1978
2113
  * 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`.
1979
2114
  * @format uuid
@@ -2607,6 +2742,77 @@ export interface PlanCreateInput {
2607
2742
  }[];
2608
2743
  };
2609
2744
  }
2745
+ /** Based plan overrides. */
2746
+ export interface PlanOverridesObject {
2747
+ /**
2748
+ * The base cost of the plan, excluding any applicable taxes, that is billed on a recurring basis. This value is defined at 0 if your plan is a pay-as-you-go plan.
2749
+ * @example 10000
2750
+ */
2751
+ amount_cents?: number;
2752
+ /** The currency of the plan. It indicates the monetary unit in which the plan's cost, including taxes and usage-based charges, is expressed. */
2753
+ amount_currency?: Currency;
2754
+ /**
2755
+ * The description on the plan.
2756
+ * @example "Plan for early stage startups."
2757
+ */
2758
+ description?: string;
2759
+ /**
2760
+ * 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.
2761
+ * @example "Startup plan"
2762
+ */
2763
+ invoice_display_name?: string;
2764
+ /**
2765
+ * The name of the plan.
2766
+ * @example "Startup"
2767
+ */
2768
+ name?: string;
2769
+ /**
2770
+ * List of unique code used to identify the taxes.
2771
+ * @example ["french_standard_vat"]
2772
+ */
2773
+ tax_codes?: string[];
2774
+ /**
2775
+ * The duration in days during which the base cost of the plan is offered for free.
2776
+ * @example 5
2777
+ */
2778
+ trial_period?: number;
2779
+ /** Additional usage-based charges for this plan. */
2780
+ charges?: {
2781
+ /**
2782
+ * Unique identifier of the charge created by Lago.
2783
+ * @format uuid
2784
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2785
+ */
2786
+ id?: string;
2787
+ /**
2788
+ * 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.
2789
+ * @example "Setup"
2790
+ */
2791
+ invoice_display_name?: string;
2792
+ /**
2793
+ * The minimum spending amount required for the charge, measured in cents and excluding any applicable taxes. It indicates the minimum amount that needs to be charged for each billing period.
2794
+ * @example 0
2795
+ */
2796
+ min_amount_cents?: number;
2797
+ /** List of all thresholds utilized for calculating the charge. */
2798
+ properties?: ChargeProperties;
2799
+ /** All charge information, sorted by groups. */
2800
+ group_properties?: {
2801
+ /**
2802
+ * Unique identifier of a billable metric group, created by Lago.
2803
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2804
+ */
2805
+ group_id: string;
2806
+ /** List of all thresholds utilized for calculating a charge, scoped by groups used as dimensions for a single charge. */
2807
+ values: ChargeProperties;
2808
+ }[];
2809
+ /**
2810
+ * List of unique code used to identify the taxes.
2811
+ * @example ["french_standard_vat"]
2812
+ */
2813
+ tax_codes?: string[];
2814
+ }[];
2815
+ }
2610
2816
  export interface PlanUpdateInput {
2611
2817
  plan: {
2612
2818
  /**
@@ -2815,7 +3021,7 @@ export interface PlansPaginated {
2815
3021
  meta: PaginationMeta;
2816
3022
  }
2817
3023
  export interface Subscription {
2818
- subscription: SubscriptionObject;
3024
+ subscription: SubscriptionObjectExtended;
2819
3025
  }
2820
3026
  export interface SubscriptionCreateInput {
2821
3027
  subscription: {
@@ -2856,6 +3062,8 @@ export interface SubscriptionCreateInput {
2856
3062
  * @example "2022-08-08T00:00:00Z"
2857
3063
  */
2858
3064
  subscription_at?: string;
3065
+ /** Based plan overrides. */
3066
+ plan_overrides?: PlanOverridesObject;
2859
3067
  };
2860
3068
  }
2861
3069
  export interface SubscriptionUpdateInput {
@@ -2877,6 +3085,8 @@ export interface SubscriptionUpdateInput {
2877
3085
  * @example "2022-08-08T00:00:00Z"
2878
3086
  */
2879
3087
  subscription_at?: string;
3088
+ /** Based plan overrides. */
3089
+ plan_overrides?: PlanOverridesObject;
2880
3090
  };
2881
3091
  }
2882
3092
  export interface SubscriptionObject {
@@ -2979,6 +3189,9 @@ export interface SubscriptionObject {
2979
3189
  */
2980
3190
  downgrade_plan_date?: string | null;
2981
3191
  }
3192
+ export type SubscriptionObjectExtended = SubscriptionObject & {
3193
+ plan?: PlanObject;
3194
+ };
2982
3195
  export interface SubscriptionsPaginated {
2983
3196
  subscriptions: SubscriptionObject[];
2984
3197
  meta: PaginationMeta;
@@ -3761,6 +3974,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3761
3974
  * @secure
3762
3975
  */
3763
3976
  downloadCreditNote: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<CreditNote, ApiErrorUnauthorized | ApiErrorNotFound>>;
3977
+ /**
3978
+ * @description This endpoint allows you to retrieve amounts for a new credit note creation.
3979
+ *
3980
+ * @tags credit_notes
3981
+ * @name EstimateCreditNote
3982
+ * @summary Estimate amounts for a new credit note
3983
+ * @request POST:/credit_notes/estimate
3984
+ * @secure
3985
+ */
3986
+ estimateCreditNote: (data: CreditNoteEstimateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteEstimated, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
3764
3987
  /**
3765
3988
  * @description This endpoint voids an existing credit note.
3766
3989
  *
@@ -3915,7 +4138,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3915
4138
  * @request POST:/events
3916
4139
  * @secure
3917
4140
  */
3918
- createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<void, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4141
+ createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
3919
4142
  /**
3920
4143
  * @description This endpoint is used for transmitting a batch of usage measurement events to multiple subscriptions for a single customer.
3921
4144
  *
@@ -562,6 +562,24 @@ class Api extends HttpClient {
562
562
  format: "json",
563
563
  ...params,
564
564
  }),
565
+ /**
566
+ * @description This endpoint allows you to retrieve amounts for a new credit note creation.
567
+ *
568
+ * @tags credit_notes
569
+ * @name EstimateCreditNote
570
+ * @summary Estimate amounts for a new credit note
571
+ * @request POST:/credit_notes/estimate
572
+ * @secure
573
+ */
574
+ estimateCreditNote: (data, params = {}) => this.request({
575
+ path: `/credit_notes/estimate`,
576
+ method: "POST",
577
+ body: data,
578
+ secure: true,
579
+ type: ContentType.Json,
580
+ format: "json",
581
+ ...params,
582
+ }),
565
583
  /**
566
584
  * @description This endpoint voids an existing credit note.
567
585
  *
@@ -730,6 +748,7 @@ class Api extends HttpClient {
730
748
  body: data,
731
749
  secure: true,
732
750
  type: ContentType.Json,
751
+ format: "json",
733
752
  ...params,
734
753
  }),
735
754
  /**