lago-javascript-client 0.56.0-beta → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1816,6 +1816,8 @@ export interface EventEstimateFeesInput {
1816
1816
  code: string;
1817
1817
  /**
1818
1818
  * 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.
1819
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1820
+ * @deprecated
1819
1821
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1820
1822
  */
1821
1823
  external_customer_id?: string;
@@ -1837,6 +1839,8 @@ export interface EventInput {
1837
1839
  transaction_id: string;
1838
1840
  /**
1839
1841
  * 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.
1842
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1843
+ * @deprecated
1840
1844
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1841
1845
  */
1842
1846
  external_customer_id?: string;
@@ -1884,6 +1888,8 @@ export interface EventObject {
1884
1888
  lago_customer_id: string | null;
1885
1889
  /**
1886
1890
  * 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.
1891
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1892
+ * @deprecated
1887
1893
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1888
1894
  */
1889
1895
  external_customer_id: string | null;
@@ -2374,6 +2380,66 @@ export interface GroupsPaginated {
2374
2380
  groups: GroupObject[];
2375
2381
  meta: PaginationMeta;
2376
2382
  }
2383
+ /** Minimum commitment for this plan. */
2384
+ export type MinimumCommitmentInput = {
2385
+ /**
2386
+ * The amount of the minimum commitment in cents.
2387
+ * @example 100000
2388
+ */
2389
+ amount_cents: number;
2390
+ /**
2391
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
2392
+ * @example "Minimum Commitment (C1)"
2393
+ */
2394
+ invoice_display_name?: string;
2395
+ /**
2396
+ * List of unique code used to identify the taxes.
2397
+ * @example ["french_standard_vat"]
2398
+ */
2399
+ tax_codes?: string[];
2400
+ } | null;
2401
+ export type MinimumCommitmentObject = {
2402
+ /**
2403
+ * Unique identifier of the minimum commitment, created by Lago.
2404
+ * @format uuid
2405
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2406
+ */
2407
+ lago_id: string;
2408
+ /**
2409
+ * The unique code representing the plan to be attached to the customer.
2410
+ * @example "premium"
2411
+ */
2412
+ plan_code?: string;
2413
+ /**
2414
+ * The amount of the minimum commitment in cents.
2415
+ * @example 100000
2416
+ */
2417
+ amount_cents: number;
2418
+ /**
2419
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
2420
+ * @example "Minimum Commitment (C1)"
2421
+ */
2422
+ invoice_display_name?: string;
2423
+ /**
2424
+ * The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `quarterly`, `monthly` or `weekly`.
2425
+ * @example "monthly"
2426
+ */
2427
+ interval?: "weekly" | "monthly" | "quarterly" | "yearly";
2428
+ /**
2429
+ * The date and time when the minimum commitment 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 minimum commitment was initially created.
2430
+ * @format date-time
2431
+ * @example "2022-04-29T08:59:51Z"
2432
+ */
2433
+ created_at: string;
2434
+ /**
2435
+ * The date and time when the minimum commitment was updated. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the minimum commitment was initially created.
2436
+ * @format date-time
2437
+ * @example "2022-04-29T08:59:51Z"
2438
+ */
2439
+ updated_at?: string;
2440
+ /** All taxes applied to the minimum commitment. */
2441
+ taxes?: TaxObject[];
2442
+ } | null;
2377
2443
  export interface MrrObject {
2378
2444
  /**
2379
2445
  * Identifies the month to analyze MRR.
@@ -2976,6 +3042,8 @@ export interface PlanCreateInput {
2976
3042
  * @example ["french_standard_vat"]
2977
3043
  */
2978
3044
  tax_codes?: string[];
3045
+ /** Minimum commitment for this plan. */
3046
+ minimum_commitment?: MinimumCommitmentInput;
2979
3047
  /**
2980
3048
  * Additional usage-based charges for this plan.
2981
3049
  * @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":[]}]
@@ -3075,6 +3143,7 @@ export interface PlanOverridesObject {
3075
3143
  * @example 5
3076
3144
  */
3077
3145
  trial_period?: number;
3146
+ minimum_commitment?: MinimumCommitmentObject;
3078
3147
  /** Additional usage-based charges for this plan. */
3079
3148
  charges?: {
3080
3149
  /**
@@ -3172,6 +3241,8 @@ export interface PlanUpdateInput {
3172
3241
  * @example ["french_standard_vat"]
3173
3242
  */
3174
3243
  tax_codes?: string[];
3244
+ /** Minimum commitment for this plan. */
3245
+ minimum_commitment?: MinimumCommitmentInput;
3175
3246
  /**
3176
3247
  * Additional usage-based charges for this plan.
3177
3248
  * @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":[]}]
@@ -3313,6 +3384,7 @@ export interface PlanObject {
3313
3384
  * @example 0
3314
3385
  */
3315
3386
  draft_invoices_count: number;
3387
+ minimum_commitment?: MinimumCommitmentObject;
3316
3388
  /**
3317
3389
  * Additional usage-based charges for this plan.
3318
3390
  * @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":[]}]
@@ -3388,7 +3460,7 @@ export interface SubscriptionUpdateInput {
3388
3460
  * @format date-time
3389
3461
  * @example "2022-10-08T00:00:00Z"
3390
3462
  */
3391
- ending_at?: string;
3463
+ ending_at: string | null;
3392
3464
  /**
3393
3465
  * 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).
3394
3466
  * @format date-time
@@ -4076,7 +4148,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4076
4148
  }
4077
4149
  /**
4078
4150
  * @title Lago API documentation
4079
- * @version 0.56.0-beta
4151
+ * @version 1.1.0
4080
4152
  * @license AGPLv3
4081
4153
  * @baseUrl https://api.getlago.com/api/v1
4082
4154
  * @externalDocs https://github.com/getlago
@@ -4487,11 +4559,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4487
4559
  */
4488
4560
  estimateCreditNote: (data: CreditNoteEstimateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteEstimated, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4489
4561
  /**
4490
- * @description This endpoint voids an existing credit note.
4562
+ * @description This endpoint voids the available credit linked to a specific credit note.
4491
4563
  *
4492
4564
  * @tags credit_notes
4493
4565
  * @name VoidCreditNote
4494
- * @summary Void a credit note
4566
+ * @summary Void available credit
4495
4567
  * @request PUT:/credit_notes/{lago_id}/void
4496
4568
  * @secure
4497
4569
  */
@@ -4675,7 +4747,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4675
4747
  */
4676
4748
  createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4677
4749
  /**
4678
- * @description This endpoint is used to send a batch of usage records.
4750
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
4679
4751
  *
4680
4752
  * @tags events
4681
4753
  * @name CreateBatchEvents
@@ -4926,6 +4998,44 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4926
4998
  * @secure
4927
4999
  */
4928
5000
  refreshInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
5001
+ /**
5002
+ * @description This endpoint generates a checkout link for a specific invoice.
5003
+ *
5004
+ * @tags invoices
5005
+ * @name InvoicePaymentUrl
5006
+ * @summary Generate a payment URL
5007
+ * @request POST:/invoices/{lago_id}/payment_url
5008
+ * @secure
5009
+ */
5010
+ invoicePaymentUrl: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<{
5011
+ invoice_payment_details?: {
5012
+ /**
5013
+ * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
5014
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5015
+ */
5016
+ lago_customer_id?: string | undefined;
5017
+ /**
5018
+ * Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system
5019
+ * @example "1e501a90-1a90-1a90-1a90-1a901a901a80"
5020
+ */
5021
+ lago_invoice_id?: string | undefined;
5022
+ /**
5023
+ * The customer external unique identifier (provided by your own application)
5024
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5025
+ */
5026
+ external_customer_id?: string | undefined;
5027
+ /**
5028
+ * The Payment Provider name linked to the Customer.
5029
+ * @example "stripe"
5030
+ */
5031
+ payment_provider?: string | undefined;
5032
+ /**
5033
+ * The generated Payment URL for the Invoice.
5034
+ * @example "https://foo.bar"
5035
+ */
5036
+ payment_url?: string | undefined;
5037
+ } | undefined;
5038
+ }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4929
5039
  /**
4930
5040
  * @description This endpoint resends an invoice for collection and retry a payment.
4931
5041
  *
@@ -5067,7 +5177,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5067
5177
  * If the field is not defined, Lago will return only `active` subscriptions. However, if you wish to fetch subscriptions by different status you can define them in a status[] query param. Available filter values: `pending`, `canceled`, `terminated`, `active`.
5068
5178
  * @example ["active","pending"]
5069
5179
  */
5070
- status?: ("pending" | "canceled" | "terminated" | "active")[];
5180
+ "status[]"?: ("pending" | "canceled" | "terminated" | "active")[];
5071
5181
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
5072
5182
  /**
5073
5183
  * @description This endpoint retrieves a specific subscription.
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 0.56.0-beta
151
+ * @version 1.1.0
152
152
  * @license AGPLv3
153
153
  * @baseUrl https://api.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
@@ -647,11 +647,11 @@ export class Api extends HttpClient {
647
647
  ...params,
648
648
  }),
649
649
  /**
650
- * @description This endpoint voids an existing credit note.
650
+ * @description This endpoint voids the available credit linked to a specific credit note.
651
651
  *
652
652
  * @tags credit_notes
653
653
  * @name VoidCreditNote
654
- * @summary Void a credit note
654
+ * @summary Void available credit
655
655
  * @request PUT:/credit_notes/{lago_id}/void
656
656
  * @secure
657
657
  */
@@ -834,7 +834,7 @@ export class Api extends HttpClient {
834
834
  ...params,
835
835
  }),
836
836
  /**
837
- * @description This endpoint is used to send a batch of usage records.
837
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
838
838
  *
839
839
  * @tags events
840
840
  * @name CreateBatchEvents
@@ -1056,6 +1056,22 @@ export class Api extends HttpClient {
1056
1056
  format: "json",
1057
1057
  ...params,
1058
1058
  }),
1059
+ /**
1060
+ * @description This endpoint generates a checkout link for a specific invoice.
1061
+ *
1062
+ * @tags invoices
1063
+ * @name InvoicePaymentUrl
1064
+ * @summary Generate a payment URL
1065
+ * @request POST:/invoices/{lago_id}/payment_url
1066
+ * @secure
1067
+ */
1068
+ invoicePaymentUrl: (lagoId, params = {}) => this.request({
1069
+ path: `/invoices/${lagoId}/payment_url`,
1070
+ method: "POST",
1071
+ secure: true,
1072
+ format: "json",
1073
+ ...params,
1074
+ }),
1059
1075
  /**
1060
1076
  * @description This endpoint resends an invoice for collection and retry a payment.
1061
1077
  *
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.56.0-beta",
6
+ "version": "v1.1.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",
@@ -1816,6 +1816,8 @@ export interface EventEstimateFeesInput {
1816
1816
  code: string;
1817
1817
  /**
1818
1818
  * 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.
1819
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1820
+ * @deprecated
1819
1821
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1820
1822
  */
1821
1823
  external_customer_id?: string;
@@ -1837,6 +1839,8 @@ export interface EventInput {
1837
1839
  transaction_id: string;
1838
1840
  /**
1839
1841
  * 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.
1842
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1843
+ * @deprecated
1840
1844
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1841
1845
  */
1842
1846
  external_customer_id?: string;
@@ -1884,6 +1888,8 @@ export interface EventObject {
1884
1888
  lago_customer_id: string | null;
1885
1889
  /**
1886
1890
  * 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.
1891
+ * This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.
1892
+ * @deprecated
1887
1893
  * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
1888
1894
  */
1889
1895
  external_customer_id: string | null;
@@ -2374,6 +2380,66 @@ export interface GroupsPaginated {
2374
2380
  groups: GroupObject[];
2375
2381
  meta: PaginationMeta;
2376
2382
  }
2383
+ /** Minimum commitment for this plan. */
2384
+ export type MinimumCommitmentInput = {
2385
+ /**
2386
+ * The amount of the minimum commitment in cents.
2387
+ * @example 100000
2388
+ */
2389
+ amount_cents: number;
2390
+ /**
2391
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
2392
+ * @example "Minimum Commitment (C1)"
2393
+ */
2394
+ invoice_display_name?: string;
2395
+ /**
2396
+ * List of unique code used to identify the taxes.
2397
+ * @example ["french_standard_vat"]
2398
+ */
2399
+ tax_codes?: string[];
2400
+ } | null;
2401
+ export type MinimumCommitmentObject = {
2402
+ /**
2403
+ * Unique identifier of the minimum commitment, created by Lago.
2404
+ * @format uuid
2405
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
2406
+ */
2407
+ lago_id: string;
2408
+ /**
2409
+ * The unique code representing the plan to be attached to the customer.
2410
+ * @example "premium"
2411
+ */
2412
+ plan_code?: string;
2413
+ /**
2414
+ * The amount of the minimum commitment in cents.
2415
+ * @example 100000
2416
+ */
2417
+ amount_cents: number;
2418
+ /**
2419
+ * Specifies the name that will be displayed on an invoice. If no value is set for this field, the default name will be used as the display name.
2420
+ * @example "Minimum Commitment (C1)"
2421
+ */
2422
+ invoice_display_name?: string;
2423
+ /**
2424
+ * The interval used for recurring billing. It represents the frequency at which subscription billing occurs. The interval can be one of the following values: `yearly`, `quarterly`, `monthly` or `weekly`.
2425
+ * @example "monthly"
2426
+ */
2427
+ interval?: "weekly" | "monthly" | "quarterly" | "yearly";
2428
+ /**
2429
+ * The date and time when the minimum commitment 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 minimum commitment was initially created.
2430
+ * @format date-time
2431
+ * @example "2022-04-29T08:59:51Z"
2432
+ */
2433
+ created_at: string;
2434
+ /**
2435
+ * The date and time when the minimum commitment was updated. It is expressed in UTC format according to the ISO 8601 datetime standard. This field provides the timestamp for the exact moment when the minimum commitment was initially created.
2436
+ * @format date-time
2437
+ * @example "2022-04-29T08:59:51Z"
2438
+ */
2439
+ updated_at?: string;
2440
+ /** All taxes applied to the minimum commitment. */
2441
+ taxes?: TaxObject[];
2442
+ } | null;
2377
2443
  export interface MrrObject {
2378
2444
  /**
2379
2445
  * Identifies the month to analyze MRR.
@@ -2976,6 +3042,8 @@ export interface PlanCreateInput {
2976
3042
  * @example ["french_standard_vat"]
2977
3043
  */
2978
3044
  tax_codes?: string[];
3045
+ /** Minimum commitment for this plan. */
3046
+ minimum_commitment?: MinimumCommitmentInput;
2979
3047
  /**
2980
3048
  * Additional usage-based charges for this plan.
2981
3049
  * @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":[]}]
@@ -3075,6 +3143,7 @@ export interface PlanOverridesObject {
3075
3143
  * @example 5
3076
3144
  */
3077
3145
  trial_period?: number;
3146
+ minimum_commitment?: MinimumCommitmentObject;
3078
3147
  /** Additional usage-based charges for this plan. */
3079
3148
  charges?: {
3080
3149
  /**
@@ -3172,6 +3241,8 @@ export interface PlanUpdateInput {
3172
3241
  * @example ["french_standard_vat"]
3173
3242
  */
3174
3243
  tax_codes?: string[];
3244
+ /** Minimum commitment for this plan. */
3245
+ minimum_commitment?: MinimumCommitmentInput;
3175
3246
  /**
3176
3247
  * Additional usage-based charges for this plan.
3177
3248
  * @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":[]}]
@@ -3313,6 +3384,7 @@ export interface PlanObject {
3313
3384
  * @example 0
3314
3385
  */
3315
3386
  draft_invoices_count: number;
3387
+ minimum_commitment?: MinimumCommitmentObject;
3316
3388
  /**
3317
3389
  * Additional usage-based charges for this plan.
3318
3390
  * @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":[]}]
@@ -3388,7 +3460,7 @@ export interface SubscriptionUpdateInput {
3388
3460
  * @format date-time
3389
3461
  * @example "2022-10-08T00:00:00Z"
3390
3462
  */
3391
- ending_at?: string;
3463
+ ending_at: string | null;
3392
3464
  /**
3393
3465
  * 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).
3394
3466
  * @format date-time
@@ -4076,7 +4148,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4076
4148
  }
4077
4149
  /**
4078
4150
  * @title Lago API documentation
4079
- * @version 0.56.0-beta
4151
+ * @version 1.1.0
4080
4152
  * @license AGPLv3
4081
4153
  * @baseUrl https://api.getlago.com/api/v1
4082
4154
  * @externalDocs https://github.com/getlago
@@ -4487,11 +4559,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4487
4559
  */
4488
4560
  estimateCreditNote: (data: CreditNoteEstimateInput, params?: RequestParams) => Promise<HttpResponse<CreditNoteEstimated, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4489
4561
  /**
4490
- * @description This endpoint voids an existing credit note.
4562
+ * @description This endpoint voids the available credit linked to a specific credit note.
4491
4563
  *
4492
4564
  * @tags credit_notes
4493
4565
  * @name VoidCreditNote
4494
- * @summary Void a credit note
4566
+ * @summary Void available credit
4495
4567
  * @request PUT:/credit_notes/{lago_id}/void
4496
4568
  * @secure
4497
4569
  */
@@ -4675,7 +4747,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4675
4747
  */
4676
4748
  createEvent: (data: EventInput, params?: RequestParams) => Promise<HttpResponse<Event, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
4677
4749
  /**
4678
- * @description This endpoint is used to send a batch of usage records.
4750
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
4679
4751
  *
4680
4752
  * @tags events
4681
4753
  * @name CreateBatchEvents
@@ -4926,6 +4998,44 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
4926
4998
  * @secure
4927
4999
  */
4928
5000
  refreshInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
5001
+ /**
5002
+ * @description This endpoint generates a checkout link for a specific invoice.
5003
+ *
5004
+ * @tags invoices
5005
+ * @name InvoicePaymentUrl
5006
+ * @summary Generate a payment URL
5007
+ * @request POST:/invoices/{lago_id}/payment_url
5008
+ * @secure
5009
+ */
5010
+ invoicePaymentUrl: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<{
5011
+ invoice_payment_details?: {
5012
+ /**
5013
+ * Unique identifier assigned to the customer within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the customer's record within the Lago system
5014
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5015
+ */
5016
+ lago_customer_id?: string | undefined;
5017
+ /**
5018
+ * Unique identifier assigned to the invoice within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the invoice's record within the Lago system
5019
+ * @example "1e501a90-1a90-1a90-1a90-1a901a901a80"
5020
+ */
5021
+ lago_invoice_id?: string | undefined;
5022
+ /**
5023
+ * The customer external unique identifier (provided by your own application)
5024
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5025
+ */
5026
+ external_customer_id?: string | undefined;
5027
+ /**
5028
+ * The Payment Provider name linked to the Customer.
5029
+ * @example "stripe"
5030
+ */
5031
+ payment_provider?: string | undefined;
5032
+ /**
5033
+ * The generated Payment URL for the Invoice.
5034
+ * @example "https://foo.bar"
5035
+ */
5036
+ payment_url?: string | undefined;
5037
+ } | undefined;
5038
+ }, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
4929
5039
  /**
4930
5040
  * @description This endpoint resends an invoice for collection and retry a payment.
4931
5041
  *
@@ -5067,7 +5177,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5067
5177
  * If the field is not defined, Lago will return only `active` subscriptions. However, if you wish to fetch subscriptions by different status you can define them in a status[] query param. Available filter values: `pending`, `canceled`, `terminated`, `active`.
5068
5178
  * @example ["active","pending"]
5069
5179
  */
5070
- status?: ("pending" | "canceled" | "terminated" | "active")[];
5180
+ "status[]"?: ("pending" | "canceled" | "terminated" | "active")[];
5071
5181
  }, params?: RequestParams) => Promise<HttpResponse<SubscriptionsPaginated, ApiErrorUnauthorized | ApiErrorNotFound>>;
5072
5182
  /**
5073
5183
  * @description This endpoint retrieves a specific subscription.
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 0.56.0-beta
155
+ * @version 1.1.0
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://api.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -651,11 +651,11 @@ class Api extends HttpClient {
651
651
  ...params,
652
652
  }),
653
653
  /**
654
- * @description This endpoint voids an existing credit note.
654
+ * @description This endpoint voids the available credit linked to a specific credit note.
655
655
  *
656
656
  * @tags credit_notes
657
657
  * @name VoidCreditNote
658
- * @summary Void a credit note
658
+ * @summary Void available credit
659
659
  * @request PUT:/credit_notes/{lago_id}/void
660
660
  * @secure
661
661
  */
@@ -838,7 +838,7 @@ class Api extends HttpClient {
838
838
  ...params,
839
839
  }),
840
840
  /**
841
- * @description This endpoint is used to send a batch of usage records.
841
+ * @description This endpoint can be used to send a batch of usage records. Each request may include up to 100 events.
842
842
  *
843
843
  * @tags events
844
844
  * @name CreateBatchEvents
@@ -1060,6 +1060,22 @@ class Api extends HttpClient {
1060
1060
  format: "json",
1061
1061
  ...params,
1062
1062
  }),
1063
+ /**
1064
+ * @description This endpoint generates a checkout link for a specific invoice.
1065
+ *
1066
+ * @tags invoices
1067
+ * @name InvoicePaymentUrl
1068
+ * @summary Generate a payment URL
1069
+ * @request POST:/invoices/{lago_id}/payment_url
1070
+ * @secure
1071
+ */
1072
+ invoicePaymentUrl: (lagoId, params = {}) => this.request({
1073
+ path: `/invoices/${lagoId}/payment_url`,
1074
+ method: "POST",
1075
+ secure: true,
1076
+ format: "json",
1077
+ ...params,
1078
+ }),
1063
1079
  /**
1064
1080
  * @description This endpoint resends an invoice for collection and retry a payment.
1065
1081
  *