lago-javascript-client 1.10.0 → 1.11.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.
@@ -1437,10 +1437,10 @@ export interface IntegrationCustomer {
1437
1437
  lago_id?: string;
1438
1438
  /**
1439
1439
  * The integration type used for accounting and tax syncs.
1440
- * Accepted values: `netsuite`.
1440
+ * Accepted values: `netsuite, anrok`.
1441
1441
  * @example "netsuite"
1442
1442
  */
1443
- type?: "netsuite";
1443
+ type?: "netsuite" | "anrok";
1444
1444
  /**
1445
1445
  * Unique code used to identify an integration connection.
1446
1446
  * @example "netsuite-eu-1"
@@ -1670,6 +1670,14 @@ export interface CustomerCreateInput {
1670
1670
  * @example 30
1671
1671
  */
1672
1672
  net_payment_term?: number | null;
1673
+ /**
1674
+ * Specifies how invoices with a zero total amount should be handled:
1675
+ * - `inherit`: (Default) Follows the organization-level configuration.
1676
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
1677
+ * - `skip`: Invoices with a total amount of zero are not finalized.
1678
+ * @example "inherit"
1679
+ */
1680
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
1673
1681
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1674
1682
  billing_configuration?: CustomerBillingConfiguration;
1675
1683
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
@@ -1683,10 +1691,10 @@ export interface CustomerCreateInput {
1683
1691
  id?: string;
1684
1692
  /**
1685
1693
  * The integration type used for accounting and tax syncs.
1686
- * Accepted values: `netsuite`.
1694
+ * Accepted values: `netsuite, anrok, xero`.
1687
1695
  * @example "netsuite"
1688
1696
  */
1689
- integration_type?: "netsuite";
1697
+ integration_type?: "netsuite" | "anrok" | "xero";
1690
1698
  /**
1691
1699
  * Unique code used to identify an integration connection.
1692
1700
  * @example "netsuite-eu-1"
@@ -1764,7 +1772,7 @@ export interface CustomerMetadata {
1764
1772
  */
1765
1773
  created_at: string;
1766
1774
  }
1767
- export interface CustomerObject {
1775
+ export type CustomerObject = {
1768
1776
  /**
1769
1777
  * 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
1770
1778
  * @format uuid
@@ -1877,13 +1885,22 @@ export interface CustomerObject {
1877
1885
  * @example "2022-04-29T08:59:51Z"
1878
1886
  */
1879
1887
  updated_at?: string;
1888
+ /**
1889
+ * Specifies how invoices with a zero total amount should be handled:
1890
+ * - `inherit`: (Default) Follows the organization-level configuration.
1891
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
1892
+ * - `skip`: Invoices with a total amount of zero are not finalized.
1893
+ * @example "inherit"
1894
+ */
1895
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
1880
1896
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1881
1897
  billing_configuration?: CustomerBillingConfiguration;
1882
1898
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1883
1899
  shipping_address?: Address;
1884
- integration_customers?: IntegrationCustomer[];
1885
1900
  metadata?: CustomerMetadata[];
1886
- }
1901
+ } & {
1902
+ integration_customers?: IntegrationCustomer[];
1903
+ };
1887
1904
  export type CustomerObjectExtended = CustomerObject & {
1888
1905
  metadata?: CustomerMetadata[];
1889
1906
  /** List of customer taxes */
@@ -2128,6 +2145,16 @@ export interface FeeObject {
2128
2145
  * @example 100
2129
2146
  */
2130
2147
  amount_cents: number;
2148
+ /**
2149
+ * The cost of this specific fee, excluding any applicable taxes, with precision.
2150
+ * @example "1.0001"
2151
+ */
2152
+ precise_amount?: string;
2153
+ /**
2154
+ * The cost of this specific fee, including any applicable taxes, with precision.
2155
+ * @example "1.0212"
2156
+ */
2157
+ precise_total_amount?: string;
2131
2158
  /** The currency of this specific fee. It indicates the monetary unit in which the fee's cost is expressed. */
2132
2159
  amount_currency: Currency;
2133
2160
  /**
@@ -2135,6 +2162,11 @@ export interface FeeObject {
2135
2162
  * @example 20
2136
2163
  */
2137
2164
  taxes_amount_cents: number;
2165
+ /**
2166
+ * The cost of the tax associated with this specific fee, with precision.
2167
+ * @example "0.20123"
2168
+ */
2169
+ taxes_precise_amount?: string;
2138
2170
  /**
2139
2171
  * The tax rate associated with this specific fee.
2140
2172
  * @example 20
@@ -2639,7 +2671,7 @@ export interface InvoiceMetadataObject {
2639
2671
  */
2640
2672
  created_at?: string;
2641
2673
  }
2642
- export interface InvoiceObject {
2674
+ export type InvoiceObject = {
2643
2675
  /**
2644
2676
  * 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.
2645
2677
  * @format uuid
@@ -2769,12 +2801,13 @@ export interface InvoiceObject {
2769
2801
  * @example "https://getlago.com/invoice/file"
2770
2802
  */
2771
2803
  file_url?: string;
2804
+ } & {
2772
2805
  /** The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
2773
2806
  customer?: CustomerObject;
2774
2807
  metadata?: InvoiceMetadataObject[];
2775
2808
  applied_taxes?: InvoiceAppliedTaxObject[];
2776
2809
  applied_usage_thresholds?: AppliedUsageThresholdObject[] | null;
2777
- }
2810
+ };
2778
2811
  export type InvoiceObjectExtended = InvoiceObject & {
2779
2812
  credits?: CreditObject[];
2780
2813
  fees?: FeeObject[];
@@ -2998,6 +3031,11 @@ export interface OrganizationObject {
2998
3031
  billing_configuration: OrganizationBillingConfiguration;
2999
3032
  /** List of default organization taxes */
3000
3033
  taxes?: TaxObject[];
3034
+ /**
3035
+ * Indicates whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
3036
+ * @example false
3037
+ */
3038
+ finalize_zero_amount_invoice?: boolean;
3001
3039
  }
3002
3040
  export interface OrganizationUpdateInput {
3003
3041
  organization: {
@@ -3085,6 +3123,11 @@ export interface OrganizationUpdateInput {
3085
3123
  email_settings?: ("invoice.finalized" | "credit_note.created")[];
3086
3124
  /** The custom billing settings for your organization. */
3087
3125
  billing_configuration?: OrganizationBillingConfiguration;
3126
+ /**
3127
+ * Determines whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
3128
+ * @example false
3129
+ */
3130
+ finalize_zero_amount_invoice?: boolean;
3088
3131
  };
3089
3132
  }
3090
3133
  export interface OverdueBalanceObject {
@@ -4544,7 +4587,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4544
4587
  }
4545
4588
  /**
4546
4589
  * @title Lago API documentation
4547
- * @version 1.10.0
4590
+ * @version 1.11.0
4548
4591
  * @license AGPLv3
4549
4592
  * @baseUrl https://{region}.getlago.com/api/v1
4550
4593
  * @externalDocs https://github.com/getlago
@@ -5534,6 +5577,102 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5534
5577
  */
5535
5578
  updateOrganization: (data: OrganizationUpdateInput, params?: RequestParams) => Promise<HttpResponse<Organization, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
5536
5579
  };
5580
+ paymentRequests: {
5581
+ /**
5582
+ * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
5583
+ *
5584
+ * @tags payment_requests
5585
+ * @name CreatePaymentRequest
5586
+ * @summary Create a payment request
5587
+ * @request POST:/payment_requests
5588
+ * @secure
5589
+ */
5590
+ createPaymentRequest: (data: {
5591
+ payment_request: {
5592
+ /**
5593
+ * The customer external unique identifier (provided by your own application)
5594
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5595
+ */
5596
+ customer_external_id?: string;
5597
+ /**
5598
+ * The customer's email address used for sending dunning notifications
5599
+ * @format email
5600
+ * @example "dinesh@piedpiper.test"
5601
+ */
5602
+ email: string;
5603
+ /** A list of Lago IDs for the customer's overdue invoices to start the dunning process */
5604
+ lago_invoice_ids: string[];
5605
+ };
5606
+ }, params?: RequestParams) => Promise<HttpResponse<{
5607
+ payment_request: {
5608
+ /**
5609
+ * Unique identifier of the payment request, created by Lago.
5610
+ * @format uuid
5611
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5612
+ */
5613
+ lago_id: string;
5614
+ /**
5615
+ * The customer's email address used for sending dunning notifications
5616
+ * @format email
5617
+ * @example "dinesh@piedpiper.test"
5618
+ */
5619
+ email: string;
5620
+ /**
5621
+ * The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
5622
+ * @example 100
5623
+ */
5624
+ amount_cents: number;
5625
+ /** The currency of the payment request. */
5626
+ amount_currency: Currency;
5627
+ /**
5628
+ * The status of the payment associated with the payment request. It can have one of the following values:
5629
+ * - `pending`: the payment is pending, waiting for payment processing in the payment provider or when the invoice is emitted but users have not updated the payment status through the endpoint.
5630
+ * - `succeeded`: the payment of the payment request has been successfully processed.
5631
+ * - `failed`: the payment of the payment request has failed or encountered an error during processing.
5632
+ * @example "succeeded"
5633
+ */
5634
+ payment_status: "pending" | "succeeded" | "failed";
5635
+ /**
5636
+ * The date and time when the payment request 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 payment request was initially created.
5637
+ * @format date-time
5638
+ * @example "2022-04-29T08:59:51Z"
5639
+ */
5640
+ created_at: string;
5641
+ /** The customer on which the payment request applies. It refers to the customer account or entity associated with the payment request. */
5642
+ customer: any;
5643
+ invoices: any[];
5644
+ };
5645
+ }, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
5646
+ /**
5647
+ * @description This endpoint is used to list all existing payment requests.
5648
+ *
5649
+ * @tags payment_requests
5650
+ * @name FindAllPaymentRequests
5651
+ * @summary List all payment requests
5652
+ * @request GET:/payment_requests
5653
+ * @secure
5654
+ */
5655
+ findAllPaymentRequests: (query?: {
5656
+ /**
5657
+ * Page number.
5658
+ * @example 1
5659
+ */
5660
+ page?: number;
5661
+ /**
5662
+ * Number of records per page.
5663
+ * @example 20
5664
+ */
5665
+ per_page?: number;
5666
+ /**
5667
+ * Unique identifier assigned to the customer in your application.
5668
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5669
+ */
5670
+ external_customer_id?: string;
5671
+ }, params?: RequestParams) => Promise<HttpResponse<{
5672
+ payment_requests: any[];
5673
+ meta: PaginationMeta;
5674
+ }, ApiErrorUnauthorized>>;
5675
+ };
5537
5676
  plans: {
5538
5677
  /**
5539
5678
  * @description This endpoint creates a plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 1.10.0
151
+ * @version 1.11.0
152
152
  * @license AGPLv3
153
153
  * @baseUrl https://{region}.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
@@ -1172,6 +1172,43 @@ export class Api extends HttpClient {
1172
1172
  ...params,
1173
1173
  }),
1174
1174
  };
1175
+ paymentRequests = {
1176
+ /**
1177
+ * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
1178
+ *
1179
+ * @tags payment_requests
1180
+ * @name CreatePaymentRequest
1181
+ * @summary Create a payment request
1182
+ * @request POST:/payment_requests
1183
+ * @secure
1184
+ */
1185
+ createPaymentRequest: (data, params = {}) => this.request({
1186
+ path: `/payment_requests`,
1187
+ method: "POST",
1188
+ body: data,
1189
+ secure: true,
1190
+ type: ContentType.Json,
1191
+ format: "json",
1192
+ ...params,
1193
+ }),
1194
+ /**
1195
+ * @description This endpoint is used to list all existing payment requests.
1196
+ *
1197
+ * @tags payment_requests
1198
+ * @name FindAllPaymentRequests
1199
+ * @summary List all payment requests
1200
+ * @request GET:/payment_requests
1201
+ * @secure
1202
+ */
1203
+ findAllPaymentRequests: (query, params = {}) => this.request({
1204
+ path: `/payment_requests`,
1205
+ method: "GET",
1206
+ query: query,
1207
+ secure: true,
1208
+ format: "json",
1209
+ ...params,
1210
+ }),
1211
+ };
1175
1212
  plans = {
1176
1213
  /**
1177
1214
  * @description This endpoint creates a plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.
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": "v1.10.0",
6
+ "version": "v1.11.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",
@@ -1437,10 +1437,10 @@ export interface IntegrationCustomer {
1437
1437
  lago_id?: string;
1438
1438
  /**
1439
1439
  * The integration type used for accounting and tax syncs.
1440
- * Accepted values: `netsuite`.
1440
+ * Accepted values: `netsuite, anrok`.
1441
1441
  * @example "netsuite"
1442
1442
  */
1443
- type?: "netsuite";
1443
+ type?: "netsuite" | "anrok";
1444
1444
  /**
1445
1445
  * Unique code used to identify an integration connection.
1446
1446
  * @example "netsuite-eu-1"
@@ -1670,6 +1670,14 @@ export interface CustomerCreateInput {
1670
1670
  * @example 30
1671
1671
  */
1672
1672
  net_payment_term?: number | null;
1673
+ /**
1674
+ * Specifies how invoices with a zero total amount should be handled:
1675
+ * - `inherit`: (Default) Follows the organization-level configuration.
1676
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
1677
+ * - `skip`: Invoices with a total amount of zero are not finalized.
1678
+ * @example "inherit"
1679
+ */
1680
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
1673
1681
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1674
1682
  billing_configuration?: CustomerBillingConfiguration;
1675
1683
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
@@ -1683,10 +1691,10 @@ export interface CustomerCreateInput {
1683
1691
  id?: string;
1684
1692
  /**
1685
1693
  * The integration type used for accounting and tax syncs.
1686
- * Accepted values: `netsuite`.
1694
+ * Accepted values: `netsuite, anrok, xero`.
1687
1695
  * @example "netsuite"
1688
1696
  */
1689
- integration_type?: "netsuite";
1697
+ integration_type?: "netsuite" | "anrok" | "xero";
1690
1698
  /**
1691
1699
  * Unique code used to identify an integration connection.
1692
1700
  * @example "netsuite-eu-1"
@@ -1764,7 +1772,7 @@ export interface CustomerMetadata {
1764
1772
  */
1765
1773
  created_at: string;
1766
1774
  }
1767
- export interface CustomerObject {
1775
+ export type CustomerObject = {
1768
1776
  /**
1769
1777
  * 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
1770
1778
  * @format uuid
@@ -1877,13 +1885,22 @@ export interface CustomerObject {
1877
1885
  * @example "2022-04-29T08:59:51Z"
1878
1886
  */
1879
1887
  updated_at?: string;
1888
+ /**
1889
+ * Specifies how invoices with a zero total amount should be handled:
1890
+ * - `inherit`: (Default) Follows the organization-level configuration.
1891
+ * - `finalize`: Invoices are issued and finalized even if the total amount is zero.
1892
+ * - `skip`: Invoices with a total amount of zero are not finalized.
1893
+ * @example "inherit"
1894
+ */
1895
+ finalize_zero_amount_invoice?: "inherit" | "skip" | "finalize";
1880
1896
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1881
1897
  billing_configuration?: CustomerBillingConfiguration;
1882
1898
  /** Configuration specific to the payment provider, utilized for billing the customer. This object contains settings and parameters necessary for processing payments and invoicing the customer. */
1883
1899
  shipping_address?: Address;
1884
- integration_customers?: IntegrationCustomer[];
1885
1900
  metadata?: CustomerMetadata[];
1886
- }
1901
+ } & {
1902
+ integration_customers?: IntegrationCustomer[];
1903
+ };
1887
1904
  export type CustomerObjectExtended = CustomerObject & {
1888
1905
  metadata?: CustomerMetadata[];
1889
1906
  /** List of customer taxes */
@@ -2128,6 +2145,16 @@ export interface FeeObject {
2128
2145
  * @example 100
2129
2146
  */
2130
2147
  amount_cents: number;
2148
+ /**
2149
+ * The cost of this specific fee, excluding any applicable taxes, with precision.
2150
+ * @example "1.0001"
2151
+ */
2152
+ precise_amount?: string;
2153
+ /**
2154
+ * The cost of this specific fee, including any applicable taxes, with precision.
2155
+ * @example "1.0212"
2156
+ */
2157
+ precise_total_amount?: string;
2131
2158
  /** The currency of this specific fee. It indicates the monetary unit in which the fee's cost is expressed. */
2132
2159
  amount_currency: Currency;
2133
2160
  /**
@@ -2135,6 +2162,11 @@ export interface FeeObject {
2135
2162
  * @example 20
2136
2163
  */
2137
2164
  taxes_amount_cents: number;
2165
+ /**
2166
+ * The cost of the tax associated with this specific fee, with precision.
2167
+ * @example "0.20123"
2168
+ */
2169
+ taxes_precise_amount?: string;
2138
2170
  /**
2139
2171
  * The tax rate associated with this specific fee.
2140
2172
  * @example 20
@@ -2639,7 +2671,7 @@ export interface InvoiceMetadataObject {
2639
2671
  */
2640
2672
  created_at?: string;
2641
2673
  }
2642
- export interface InvoiceObject {
2674
+ export type InvoiceObject = {
2643
2675
  /**
2644
2676
  * 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.
2645
2677
  * @format uuid
@@ -2769,12 +2801,13 @@ export interface InvoiceObject {
2769
2801
  * @example "https://getlago.com/invoice/file"
2770
2802
  */
2771
2803
  file_url?: string;
2804
+ } & {
2772
2805
  /** The customer on which the invoice applies. It refers to the customer account or entity associated with the invoice. */
2773
2806
  customer?: CustomerObject;
2774
2807
  metadata?: InvoiceMetadataObject[];
2775
2808
  applied_taxes?: InvoiceAppliedTaxObject[];
2776
2809
  applied_usage_thresholds?: AppliedUsageThresholdObject[] | null;
2777
- }
2810
+ };
2778
2811
  export type InvoiceObjectExtended = InvoiceObject & {
2779
2812
  credits?: CreditObject[];
2780
2813
  fees?: FeeObject[];
@@ -2998,6 +3031,11 @@ export interface OrganizationObject {
2998
3031
  billing_configuration: OrganizationBillingConfiguration;
2999
3032
  /** List of default organization taxes */
3000
3033
  taxes?: TaxObject[];
3034
+ /**
3035
+ * Indicates whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
3036
+ * @example false
3037
+ */
3038
+ finalize_zero_amount_invoice?: boolean;
3001
3039
  }
3002
3040
  export interface OrganizationUpdateInput {
3003
3041
  organization: {
@@ -3085,6 +3123,11 @@ export interface OrganizationUpdateInput {
3085
3123
  email_settings?: ("invoice.finalized" | "credit_note.created")[];
3086
3124
  /** The custom billing settings for your organization. */
3087
3125
  billing_configuration?: OrganizationBillingConfiguration;
3126
+ /**
3127
+ * Determines whether invoices with a zero total amount should be finalized. If set to true, zero amount invoices will be finalized. If set to false, zero amount invoices will not be finalized.
3128
+ * @example false
3129
+ */
3130
+ finalize_zero_amount_invoice?: boolean;
3088
3131
  };
3089
3132
  }
3090
3133
  export interface OverdueBalanceObject {
@@ -4544,7 +4587,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
4544
4587
  }
4545
4588
  /**
4546
4589
  * @title Lago API documentation
4547
- * @version 1.10.0
4590
+ * @version 1.11.0
4548
4591
  * @license AGPLv3
4549
4592
  * @baseUrl https://{region}.getlago.com/api/v1
4550
4593
  * @externalDocs https://github.com/getlago
@@ -5534,6 +5577,102 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5534
5577
  */
5535
5578
  updateOrganization: (data: OrganizationUpdateInput, params?: RequestParams) => Promise<HttpResponse<Organization, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
5536
5579
  };
5580
+ paymentRequests: {
5581
+ /**
5582
+ * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
5583
+ *
5584
+ * @tags payment_requests
5585
+ * @name CreatePaymentRequest
5586
+ * @summary Create a payment request
5587
+ * @request POST:/payment_requests
5588
+ * @secure
5589
+ */
5590
+ createPaymentRequest: (data: {
5591
+ payment_request: {
5592
+ /**
5593
+ * The customer external unique identifier (provided by your own application)
5594
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5595
+ */
5596
+ customer_external_id?: string;
5597
+ /**
5598
+ * The customer's email address used for sending dunning notifications
5599
+ * @format email
5600
+ * @example "dinesh@piedpiper.test"
5601
+ */
5602
+ email: string;
5603
+ /** A list of Lago IDs for the customer's overdue invoices to start the dunning process */
5604
+ lago_invoice_ids: string[];
5605
+ };
5606
+ }, params?: RequestParams) => Promise<HttpResponse<{
5607
+ payment_request: {
5608
+ /**
5609
+ * Unique identifier of the payment request, created by Lago.
5610
+ * @format uuid
5611
+ * @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
5612
+ */
5613
+ lago_id: string;
5614
+ /**
5615
+ * The customer's email address used for sending dunning notifications
5616
+ * @format email
5617
+ * @example "dinesh@piedpiper.test"
5618
+ */
5619
+ email: string;
5620
+ /**
5621
+ * The sum of the total amounts of all the invoices included in the payment request, expressed in cents.
5622
+ * @example 100
5623
+ */
5624
+ amount_cents: number;
5625
+ /** The currency of the payment request. */
5626
+ amount_currency: Currency;
5627
+ /**
5628
+ * The status of the payment associated with the payment request. It can have one of the following values:
5629
+ * - `pending`: the payment is pending, waiting for payment processing in the payment provider or when the invoice is emitted but users have not updated the payment status through the endpoint.
5630
+ * - `succeeded`: the payment of the payment request has been successfully processed.
5631
+ * - `failed`: the payment of the payment request has failed or encountered an error during processing.
5632
+ * @example "succeeded"
5633
+ */
5634
+ payment_status: "pending" | "succeeded" | "failed";
5635
+ /**
5636
+ * The date and time when the payment request 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 payment request was initially created.
5637
+ * @format date-time
5638
+ * @example "2022-04-29T08:59:51Z"
5639
+ */
5640
+ created_at: string;
5641
+ /** The customer on which the payment request applies. It refers to the customer account or entity associated with the payment request. */
5642
+ customer: any;
5643
+ invoices: any[];
5644
+ };
5645
+ }, ApiErrorBadRequest | ApiErrorUnauthorized | ApiErrorUnprocessableEntity>>;
5646
+ /**
5647
+ * @description This endpoint is used to list all existing payment requests.
5648
+ *
5649
+ * @tags payment_requests
5650
+ * @name FindAllPaymentRequests
5651
+ * @summary List all payment requests
5652
+ * @request GET:/payment_requests
5653
+ * @secure
5654
+ */
5655
+ findAllPaymentRequests: (query?: {
5656
+ /**
5657
+ * Page number.
5658
+ * @example 1
5659
+ */
5660
+ page?: number;
5661
+ /**
5662
+ * Number of records per page.
5663
+ * @example 20
5664
+ */
5665
+ per_page?: number;
5666
+ /**
5667
+ * Unique identifier assigned to the customer in your application.
5668
+ * @example "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba"
5669
+ */
5670
+ external_customer_id?: string;
5671
+ }, params?: RequestParams) => Promise<HttpResponse<{
5672
+ payment_requests: any[];
5673
+ meta: PaginationMeta;
5674
+ }, ApiErrorUnauthorized>>;
5675
+ };
5537
5676
  plans: {
5538
5677
  /**
5539
5678
  * @description This endpoint creates a plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 1.10.0
155
+ * @version 1.11.0
156
156
  * @license AGPLv3
157
157
  * @baseUrl https://{region}.getlago.com/api/v1
158
158
  * @externalDocs https://github.com/getlago
@@ -1176,6 +1176,43 @@ class Api extends HttpClient {
1176
1176
  ...params,
1177
1177
  }),
1178
1178
  };
1179
+ paymentRequests = {
1180
+ /**
1181
+ * @description This endpoint is used to create a payment request to collect payments of overdue invoices of a given customer
1182
+ *
1183
+ * @tags payment_requests
1184
+ * @name CreatePaymentRequest
1185
+ * @summary Create a payment request
1186
+ * @request POST:/payment_requests
1187
+ * @secure
1188
+ */
1189
+ createPaymentRequest: (data, params = {}) => this.request({
1190
+ path: `/payment_requests`,
1191
+ method: "POST",
1192
+ body: data,
1193
+ secure: true,
1194
+ type: ContentType.Json,
1195
+ format: "json",
1196
+ ...params,
1197
+ }),
1198
+ /**
1199
+ * @description This endpoint is used to list all existing payment requests.
1200
+ *
1201
+ * @tags payment_requests
1202
+ * @name FindAllPaymentRequests
1203
+ * @summary List all payment requests
1204
+ * @request GET:/payment_requests
1205
+ * @secure
1206
+ */
1207
+ findAllPaymentRequests: (query, params = {}) => this.request({
1208
+ path: `/payment_requests`,
1209
+ method: "GET",
1210
+ query: query,
1211
+ secure: true,
1212
+ format: "json",
1213
+ ...params,
1214
+ }),
1215
+ };
1179
1216
  plans = {
1180
1217
  /**
1181
1218
  * @description This endpoint creates a plan with subscription and usage-based charges. It supports flexible billing cadence (in-advance or in-arrears) and allows for both recurring and metered charges.