lago-javascript-client 1.50.0 → 1.52.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.
- package/esm/openapi/client.d.ts +242 -63
- package/esm/openapi/client.js +17 -1
- package/esm/openapi/webhooks.d.ts +391 -65
- package/package.json +1 -1
- package/script/openapi/client.d.ts +242 -63
- package/script/openapi/client.js +17 -1
- package/script/openapi/webhooks.d.ts +391 -65
package/esm/openapi/client.d.ts
CHANGED
|
@@ -2645,6 +2645,54 @@ export interface CustomerBaseObject {
|
|
|
2645
2645
|
shipping_address?: Address;
|
|
2646
2646
|
metadata?: CustomerMetadata[];
|
|
2647
2647
|
}
|
|
2648
|
+
/** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
|
|
2649
|
+
export interface IntegrationCustomer {
|
|
2650
|
+
/**
|
|
2651
|
+
* A unique identifier for the integration customer object in the Lago application.
|
|
2652
|
+
* @format uuid
|
|
2653
|
+
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
2654
|
+
*/
|
|
2655
|
+
lago_id: string;
|
|
2656
|
+
/**
|
|
2657
|
+
* The integration type used for accounting and tax syncs.
|
|
2658
|
+
* Accepted values: `netsuite, anrok`.
|
|
2659
|
+
* @example "netsuite"
|
|
2660
|
+
*/
|
|
2661
|
+
type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
|
|
2662
|
+
/**
|
|
2663
|
+
* Unique code used to identify an integration connection.
|
|
2664
|
+
* @example "netsuite-eu-1"
|
|
2665
|
+
*/
|
|
2666
|
+
integration_code: string;
|
|
2667
|
+
/**
|
|
2668
|
+
* The customer ID within the integration's system. If this field is not provided, Lago has the option to create a new customer record within the integration's system on behalf of the customer.
|
|
2669
|
+
* @example "cus_12345"
|
|
2670
|
+
*/
|
|
2671
|
+
external_customer_id: string;
|
|
2672
|
+
/**
|
|
2673
|
+
* Set this field to `true` if you want to create a customer record in the integration's system. This option is applicable only when the `external_customer_id` is null and the `sync_with_provider` field is set to `true`. By default, the value is set to `false`
|
|
2674
|
+
* @example true
|
|
2675
|
+
*/
|
|
2676
|
+
sync_with_provider?: boolean | null;
|
|
2677
|
+
/**
|
|
2678
|
+
* This optional field is needed only when working with `netsuite` connection.
|
|
2679
|
+
* @example "2"
|
|
2680
|
+
*/
|
|
2681
|
+
subsidiary_id?: string;
|
|
2682
|
+
/**
|
|
2683
|
+
* This optional field is present only when working with `hubspot` connection.
|
|
2684
|
+
* @example "contacts"
|
|
2685
|
+
*/
|
|
2686
|
+
targeted_object?: string | null;
|
|
2687
|
+
/**
|
|
2688
|
+
* This optional field is present only when working with `hubspot` connection.
|
|
2689
|
+
* @example "dinesh@piedpiper.test"
|
|
2690
|
+
*/
|
|
2691
|
+
email?: string | null;
|
|
2692
|
+
}
|
|
2693
|
+
export type CustomerObject = CustomerBaseObject & {
|
|
2694
|
+
integration_customers?: IntegrationCustomer[];
|
|
2695
|
+
};
|
|
2648
2696
|
/**
|
|
2649
2697
|
* Custom metadata stored as key-value pairs.
|
|
2650
2698
|
* Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
|
|
@@ -2699,6 +2747,11 @@ export interface CreditNoteObject {
|
|
|
2699
2747
|
* @example "LAG-1234"
|
|
2700
2748
|
*/
|
|
2701
2749
|
invoice_number: string;
|
|
2750
|
+
/**
|
|
2751
|
+
* The purchase order number of the invoice the credit note belongs to.
|
|
2752
|
+
* @example "PO-123"
|
|
2753
|
+
*/
|
|
2754
|
+
purchase_order_number?: string | null;
|
|
2702
2755
|
/**
|
|
2703
2756
|
* The date of creation of the credit note. It follows the ISO 8601 date format and provides the specific date when the credit note was created.
|
|
2704
2757
|
* @format date
|
|
@@ -2809,7 +2862,7 @@ export interface CreditNoteObject {
|
|
|
2809
2862
|
* @example false
|
|
2810
2863
|
*/
|
|
2811
2864
|
self_billed?: boolean;
|
|
2812
|
-
customer?:
|
|
2865
|
+
customer?: CustomerObject;
|
|
2813
2866
|
/**
|
|
2814
2867
|
* Custom metadata stored as key-value pairs.
|
|
2815
2868
|
* Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
|
|
@@ -2882,7 +2935,7 @@ export interface CreditNoteCreateInput {
|
|
|
2882
2935
|
};
|
|
2883
2936
|
}
|
|
2884
2937
|
export type CreditNoteExtendedObject = CreditNoteObject & {
|
|
2885
|
-
customer?:
|
|
2938
|
+
customer?: CustomerObject;
|
|
2886
2939
|
};
|
|
2887
2940
|
export interface CreditNoteExtended {
|
|
2888
2941
|
credit_note: CreditNoteExtendedObject;
|
|
@@ -3069,54 +3122,6 @@ export interface CreditNoteMetadataResponse {
|
|
|
3069
3122
|
*/
|
|
3070
3123
|
metadata: MetadataObject;
|
|
3071
3124
|
}
|
|
3072
|
-
/** Configuration specific to the accounting and tax integrations. This object contains settings and parameters necessary for syncing documents and payments. */
|
|
3073
|
-
export interface IntegrationCustomer {
|
|
3074
|
-
/**
|
|
3075
|
-
* A unique identifier for the integration customer object in the Lago application.
|
|
3076
|
-
* @format uuid
|
|
3077
|
-
* @example "1a901a90-1a90-1a90-1a90-1a901a901a90"
|
|
3078
|
-
*/
|
|
3079
|
-
lago_id: string;
|
|
3080
|
-
/**
|
|
3081
|
-
* The integration type used for accounting and tax syncs.
|
|
3082
|
-
* Accepted values: `netsuite, anrok`.
|
|
3083
|
-
* @example "netsuite"
|
|
3084
|
-
*/
|
|
3085
|
-
type: "netsuite" | "anrok" | "xero" | "hubspot" | "salesforce";
|
|
3086
|
-
/**
|
|
3087
|
-
* Unique code used to identify an integration connection.
|
|
3088
|
-
* @example "netsuite-eu-1"
|
|
3089
|
-
*/
|
|
3090
|
-
integration_code: string;
|
|
3091
|
-
/**
|
|
3092
|
-
* The customer ID within the integration's system. If this field is not provided, Lago has the option to create a new customer record within the integration's system on behalf of the customer.
|
|
3093
|
-
* @example "cus_12345"
|
|
3094
|
-
*/
|
|
3095
|
-
external_customer_id: string;
|
|
3096
|
-
/**
|
|
3097
|
-
* Set this field to `true` if you want to create a customer record in the integration's system. This option is applicable only when the `external_customer_id` is null and the `sync_with_provider` field is set to `true`. By default, the value is set to `false`
|
|
3098
|
-
* @example true
|
|
3099
|
-
*/
|
|
3100
|
-
sync_with_provider?: boolean | null;
|
|
3101
|
-
/**
|
|
3102
|
-
* This optional field is needed only when working with `netsuite` connection.
|
|
3103
|
-
* @example "2"
|
|
3104
|
-
*/
|
|
3105
|
-
subsidiary_id?: string;
|
|
3106
|
-
/**
|
|
3107
|
-
* This optional field is present only when working with `hubspot` connection.
|
|
3108
|
-
* @example "contacts"
|
|
3109
|
-
*/
|
|
3110
|
-
targeted_object?: string | null;
|
|
3111
|
-
/**
|
|
3112
|
-
* This optional field is present only when working with `hubspot` connection.
|
|
3113
|
-
* @example "dinesh@piedpiper.test"
|
|
3114
|
-
*/
|
|
3115
|
-
email?: string | null;
|
|
3116
|
-
}
|
|
3117
|
-
export type CustomerObject = CustomerBaseObject & {
|
|
3118
|
-
integration_customers?: IntegrationCustomer[];
|
|
3119
|
-
};
|
|
3120
3125
|
export interface ErrorDetailObject {
|
|
3121
3126
|
/**
|
|
3122
3127
|
* Unique identifier assigned to the error_detail within the Lago application. This ID is exclusively created by Lago and serves as a unique identifier for the error's record within the Lago system.
|
|
@@ -3204,7 +3209,8 @@ export interface CustomerCreateInput {
|
|
|
3204
3209
|
*/
|
|
3205
3210
|
logo_url?: string | null;
|
|
3206
3211
|
/**
|
|
3207
|
-
* The full name of the customer
|
|
3212
|
+
* The full name of the customer (255 characters max).
|
|
3213
|
+
* @maxLength 255
|
|
3208
3214
|
* @example "Gavin Belson"
|
|
3209
3215
|
*/
|
|
3210
3216
|
name?: string | null;
|
|
@@ -3372,6 +3378,11 @@ export interface InvoiceBaseObject {
|
|
|
3372
3378
|
* @example "LAG-1234-001-002"
|
|
3373
3379
|
*/
|
|
3374
3380
|
number: string;
|
|
3381
|
+
/**
|
|
3382
|
+
* The purchase order number associated with the invoice. It is inherited from the subscription, wallet or wallet transaction the invoice was generated for.
|
|
3383
|
+
* @example "PO-123"
|
|
3384
|
+
*/
|
|
3385
|
+
purchase_order_number?: string | null;
|
|
3375
3386
|
/**
|
|
3376
3387
|
* The date when the invoice was issued. It is provided in the ISO 8601 date format.
|
|
3377
3388
|
* @format date
|
|
@@ -3412,9 +3423,10 @@ export interface InvoiceBaseObject {
|
|
|
3412
3423
|
* - `voided`: the invoice has been issued and subsequently voided. In this state, events cannot be ingested or added to the invoice anymore.
|
|
3413
3424
|
* - `pending`: the invoice remains pending until the taxes are fetched from the external provider.
|
|
3414
3425
|
* - `failed`: during an attempt of finalization of the invoice, an error happened. This invoice will have an array of error_details, explaining, in which part of the system an error happened and how it's possible to fix it. This invoice can't be edited or updated, only retried. This action will discard current error_details and will create new ones if the finalization failed again.
|
|
3426
|
+
* - `deleted`: the draft invoice has been permanently deleted. This status is only returned by the delete endpoint and its webhook; a deleted invoice is no longer retrievable afterwards.
|
|
3415
3427
|
* @example "finalized"
|
|
3416
3428
|
*/
|
|
3417
|
-
status: "draft" | "finalized" | "voided" | "failed" | "pending";
|
|
3429
|
+
status: "draft" | "finalized" | "voided" | "failed" | "pending" | "deleted";
|
|
3418
3430
|
/**
|
|
3419
3431
|
* The status of the payment associated with the invoice. It can have one of the following values:
|
|
3420
3432
|
* - `pending`: the payment is pending, waiting for payment processing in Stripe or when the invoice is emitted but users have not updated the payment status through the endpoint.
|
|
@@ -3504,6 +3516,12 @@ export interface InvoiceBaseObject {
|
|
|
3504
3516
|
* @example "https://getlago.com/invoice/file"
|
|
3505
3517
|
*/
|
|
3506
3518
|
file_url?: string;
|
|
3519
|
+
/**
|
|
3520
|
+
* Contains the URL to the invoice page in the Lago dashboard. It is `null` for invoices that are not visible in the dashboard (for example while still generating). Use it to link users directly to the invoice overview page.
|
|
3521
|
+
* @format uri
|
|
3522
|
+
* @example "https://app.getlago.com/acme/customer/1a901a90-1a90-1a90-1a90-1a901a901a90/invoice/2b012b01-2b01-2b01-2b01-2b012b012b01/overview"
|
|
3523
|
+
*/
|
|
3524
|
+
web_url?: string | null;
|
|
3507
3525
|
/**
|
|
3508
3526
|
* The date of the invoice creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). The creation_date provides a standardized and internationally recognized timestamp for when the invoice object was created
|
|
3509
3527
|
* @format date-time
|
|
@@ -3530,7 +3548,8 @@ export interface InvoiceMetadataObject {
|
|
|
3530
3548
|
*/
|
|
3531
3549
|
key?: string;
|
|
3532
3550
|
/**
|
|
3533
|
-
* Represents the value of the metadata's key-value pair.
|
|
3551
|
+
* Represents the value of the metadata's key-value pair (140 characters max).
|
|
3552
|
+
* @maxLength 140
|
|
3534
3553
|
* @example "INV-0123456-98765"
|
|
3535
3554
|
*/
|
|
3536
3555
|
value?: string;
|
|
@@ -4057,13 +4076,14 @@ export interface SubscriptionObject {
|
|
|
4057
4076
|
*/
|
|
4058
4077
|
consolidate_invoice?: boolean;
|
|
4059
4078
|
/**
|
|
4060
|
-
* The reason a payment-gated subscription was canceled
|
|
4079
|
+
* The reason a payment-gated subscription was canceled while still `incomplete`. Null unless the subscription was canceled before activation.
|
|
4061
4080
|
*
|
|
4062
4081
|
* - `payment_failed`: the gating payment failed.
|
|
4063
4082
|
* - `timeout`: the activation rule expired before the payment succeeded.
|
|
4083
|
+
* - `manual`: the incomplete subscription was canceled on demand, via a terminate request with `status=incomplete`.
|
|
4064
4084
|
* @example "payment_failed"
|
|
4065
4085
|
*/
|
|
4066
|
-
cancellation_reason?: "payment_failed" | "timeout";
|
|
4086
|
+
cancellation_reason?: "payment_failed" | "timeout" | "manual";
|
|
4067
4087
|
/**
|
|
4068
4088
|
* The date and time when a payment-gated subscription was activated (i.e. moved from `incomplete` to `active` once the gating payment succeeded), represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC). Null while the subscription is still `incomplete`.
|
|
4069
4089
|
* @format date-time
|
|
@@ -4072,11 +4092,24 @@ export interface SubscriptionObject {
|
|
|
4072
4092
|
activated_at?: string | null;
|
|
4073
4093
|
/** The activation rules attached to the subscription. A payment activation rule gates activation on a successful first payment, keeping the subscription in the `incomplete` state until the payment succeeds or the rule expires. */
|
|
4074
4094
|
activation_rules?: SubscriptionActivationRuleObject[];
|
|
4095
|
+
/**
|
|
4096
|
+
* The purchase order number associated with the subscription. It will be added to invoices generated for this subscription.
|
|
4097
|
+
* @example "PO-123"
|
|
4098
|
+
*/
|
|
4099
|
+
purchase_order_number?: string | null;
|
|
4075
4100
|
}
|
|
4076
4101
|
export interface SubscriptionsPaginated {
|
|
4077
4102
|
subscriptions: SubscriptionObject[];
|
|
4078
4103
|
meta: PaginationMeta;
|
|
4079
4104
|
}
|
|
4105
|
+
/**
|
|
4106
|
+
* Fee type to which a wallet can be restricted. It can be any of the following values:
|
|
4107
|
+
* - `charge`
|
|
4108
|
+
* - `subscription`
|
|
4109
|
+
* - `commitment`
|
|
4110
|
+
* - `fixed_charge`
|
|
4111
|
+
*/
|
|
4112
|
+
export type WalletFeeTypeEnum = "charge" | "subscription" | "commitment" | "fixed_charge";
|
|
4080
4113
|
/** Object that represents rule for wallet recurring transactions. */
|
|
4081
4114
|
export interface WalletRecurringTransactionRule {
|
|
4082
4115
|
/**
|
|
@@ -4181,6 +4214,11 @@ export interface WalletRecurringTransactionRule {
|
|
|
4181
4214
|
applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
|
|
4182
4215
|
/** The payment method assigned to this recurring transaction rule for processing top-up payments. */
|
|
4183
4216
|
payment_method?: PaymentMethodReference;
|
|
4217
|
+
/**
|
|
4218
|
+
* The purchase order number associated with this recurring transaction rule. It will be added to invoices generated for the resulting wallet top-ups. If not set, falls back to the wallet's `purchase_order_number`.
|
|
4219
|
+
* @example "PO-123"
|
|
4220
|
+
*/
|
|
4221
|
+
purchase_order_number?: string | null;
|
|
4184
4222
|
}
|
|
4185
4223
|
export interface WalletObject {
|
|
4186
4224
|
/**
|
|
@@ -4296,7 +4334,7 @@ export interface WalletObject {
|
|
|
4296
4334
|
* An array of fee types to which the wallet is applicable. By specifying the fee types in this field, you can restrict the wallet's usage to specific fee types only.
|
|
4297
4335
|
* @example ["charge"]
|
|
4298
4336
|
*/
|
|
4299
|
-
fee_types?:
|
|
4337
|
+
fee_types?: WalletFeeTypeEnum[];
|
|
4300
4338
|
/**
|
|
4301
4339
|
* An array of billable metric codes to which the wallet is applicable. By specifying the billable metric codes in this field, you can restrict the wallet's usage to specific metrics only.
|
|
4302
4340
|
* @example ["bm1"]
|
|
@@ -4341,6 +4379,11 @@ export interface WalletObject {
|
|
|
4341
4379
|
applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
|
|
4342
4380
|
/** The payment method assigned to this wallet for processing top-up payments. */
|
|
4343
4381
|
payment_method?: PaymentMethodReference;
|
|
4382
|
+
/**
|
|
4383
|
+
* The purchase order number associated with the wallet. It will be added to invoices generated for wallet top-ups, unless a more specific purchase order number is set on the wallet transaction or recurring transaction rule that triggered the top-up.
|
|
4384
|
+
* @example "PO-123"
|
|
4385
|
+
*/
|
|
4386
|
+
purchase_order_number?: string | null;
|
|
4344
4387
|
/**
|
|
4345
4388
|
* Custom metadata stored as key-value pairs.
|
|
4346
4389
|
* Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.
|
|
@@ -4437,6 +4480,11 @@ export interface WalletCreateInput {
|
|
|
4437
4480
|
* @example "Tokens for models 'high-fidelity-boost'"
|
|
4438
4481
|
*/
|
|
4439
4482
|
transaction_name?: string | null;
|
|
4483
|
+
/**
|
|
4484
|
+
* The purchase order number associated with the wallet. It will be added to invoices generated for wallet top-ups, unless a more specific purchase order number is set on the wallet transaction or recurring transaction rule that triggered the top-up.
|
|
4485
|
+
* @example "PO-123"
|
|
4486
|
+
*/
|
|
4487
|
+
purchase_order_number?: string | null;
|
|
4440
4488
|
/** Set wallet limitations to fee types. */
|
|
4441
4489
|
applies_to?: {
|
|
4442
4490
|
/**
|
|
@@ -4513,6 +4561,11 @@ export interface WalletUpdateInput {
|
|
|
4513
4561
|
* @example "default"
|
|
4514
4562
|
*/
|
|
4515
4563
|
billing_entity_code?: string;
|
|
4564
|
+
/**
|
|
4565
|
+
* The purchase order number associated with the wallet. It will be added to invoices generated for wallet top-ups, unless a more specific purchase order number is set on the wallet transaction or recurring transaction rule that triggered the top-up.
|
|
4566
|
+
* @example "PO-123"
|
|
4567
|
+
*/
|
|
4568
|
+
purchase_order_number?: string | null;
|
|
4516
4569
|
/** Configuration for invoice custom sections to apply to invoices generated by this resource. */
|
|
4517
4570
|
invoice_custom_section?: InvoiceCustomSectionInput;
|
|
4518
4571
|
/** List of recurring transaction rules. Currently, we only allow one recurring rule per wallet. */
|
|
@@ -4599,6 +4652,11 @@ export interface WalletUpdateInput {
|
|
|
4599
4652
|
* @example "Tokens for models 'high-fidelity-boost'"
|
|
4600
4653
|
*/
|
|
4601
4654
|
transaction_name?: string | null;
|
|
4655
|
+
/**
|
|
4656
|
+
* The purchase order number associated with this recurring transaction rule. It will be added to invoices generated for the resulting wallet top-ups. If not set, falls back to the wallet's `purchase_order_number`.
|
|
4657
|
+
* @example "PO-123"
|
|
4658
|
+
*/
|
|
4659
|
+
purchase_order_number?: string | null;
|
|
4602
4660
|
/** Configuration for invoice custom sections to apply to invoices generated by this resource. */
|
|
4603
4661
|
invoice_custom_section?: InvoiceCustomSectionInput;
|
|
4604
4662
|
/** Optional payment method to use for processing recurring top-up payments. */
|
|
@@ -5712,6 +5770,11 @@ export interface InvoiceOneOffCreateInput {
|
|
|
5712
5770
|
* @example "EUR"
|
|
5713
5771
|
*/
|
|
5714
5772
|
currency?: Currency;
|
|
5773
|
+
/**
|
|
5774
|
+
* The purchase order number to associate with the invoice.
|
|
5775
|
+
* @example "PO-123"
|
|
5776
|
+
*/
|
|
5777
|
+
purchase_order_number?: string | null;
|
|
5715
5778
|
fees: {
|
|
5716
5779
|
/**
|
|
5717
5780
|
* The code of the add-on used as invoice item.
|
|
@@ -5844,7 +5907,8 @@ export interface InvoiceUpdateInput {
|
|
|
5844
5907
|
*/
|
|
5845
5908
|
key?: string;
|
|
5846
5909
|
/**
|
|
5847
|
-
* The value in the key-value pair of the metadata.
|
|
5910
|
+
* The value in the key-value pair of the metadata (140 characters max).
|
|
5911
|
+
* @maxLength 140
|
|
5848
5912
|
* @example "INV-0123456-98765"
|
|
5849
5913
|
*/
|
|
5850
5914
|
value?: string;
|
|
@@ -7906,7 +7970,10 @@ export interface PlanOverridesObject {
|
|
|
7906
7970
|
/** List of taxes applied to the fixed charge. */
|
|
7907
7971
|
tax_codes?: TaxCodes;
|
|
7908
7972
|
}[];
|
|
7909
|
-
/**
|
|
7973
|
+
/**
|
|
7974
|
+
* **Deprecated.** Managing usage thresholds through `plan_overrides` is deprecated and its behavior is inconsistent: an empty array does not reliably clear thresholds (it is ignored the first time a subscription is overridden), and it never affects thresholds inherited from a parent plan. Use the top-level `usage_thresholds` array on the subscription instead, or `progressive_billing_disabled` to switch progressive billing off.
|
|
7975
|
+
* @deprecated
|
|
7976
|
+
*/
|
|
7910
7977
|
usage_thresholds?: UsageThresholdInput[];
|
|
7911
7978
|
/** Metadata to set as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null. */
|
|
7912
7979
|
metadata?: MetadataInput;
|
|
@@ -8003,6 +8070,25 @@ export interface SubscriptionCreateInput {
|
|
|
8003
8070
|
* @example true
|
|
8004
8071
|
*/
|
|
8005
8072
|
consolidate_invoice?: boolean;
|
|
8073
|
+
/**
|
|
8074
|
+
* The purchase order number associated with the subscription. It will be added to invoices generated for this subscription.
|
|
8075
|
+
* @example "PO-123"
|
|
8076
|
+
*/
|
|
8077
|
+
purchase_order_number?: string | null;
|
|
8078
|
+
/**
|
|
8079
|
+
* Disables progressive billing for this subscription, regardless of any usage thresholds defined on the plan (including thresholds inherited from a parent plan when the subscription runs on a plan override).
|
|
8080
|
+
*
|
|
8081
|
+
* Set to `true` to switch progressive billing off for this subscription specifically, without changing the plan's thresholds.
|
|
8082
|
+
* @default false
|
|
8083
|
+
* @example true
|
|
8084
|
+
*/
|
|
8085
|
+
progressive_billing_disabled?: boolean;
|
|
8086
|
+
/**
|
|
8087
|
+
* Usage thresholds managed directly on the subscription. This is the recommended way to set progressive billing thresholds per subscription; when present, they take precedence over the thresholds defined on the plan.
|
|
8088
|
+
*
|
|
8089
|
+
* This field cannot be combined with `plan_overrides.usage_thresholds` in the same request.
|
|
8090
|
+
*/
|
|
8091
|
+
usage_thresholds?: UsageThresholdInput[];
|
|
8006
8092
|
/** Optional list of activation rules that gate the subscription activation. When a `payment` rule is provided and the plan is paid in advance (and the subscription is not in a trial), the subscription is created in the `incomplete` state and is only activated once the gating payment succeeds. If the payment fails or the rule's `timeout_hours` elapses, the subscription is canceled. */
|
|
8007
8093
|
activation_rules?: SubscriptionActivationRuleInput[];
|
|
8008
8094
|
};
|
|
@@ -8075,6 +8161,25 @@ export interface SubscriptionUpdateInput {
|
|
|
8075
8161
|
* @example "default"
|
|
8076
8162
|
*/
|
|
8077
8163
|
billing_entity_code?: string;
|
|
8164
|
+
/**
|
|
8165
|
+
* The purchase order number associated with the subscription. It will be added to invoices generated for this subscription.
|
|
8166
|
+
* @example "PO-123"
|
|
8167
|
+
*/
|
|
8168
|
+
purchase_order_number?: string | null;
|
|
8169
|
+
/**
|
|
8170
|
+
* Disables progressive billing for this subscription, regardless of any usage thresholds defined on the plan (including thresholds inherited from a parent plan when the subscription runs on a plan override).
|
|
8171
|
+
*
|
|
8172
|
+
* Set to `true` to switch progressive billing off for this subscription specifically. This is the recommended way to stop progressive billing on a subscription that inherits thresholds from its plan, since clearing `usage_thresholds` only removes subscription-level thresholds and does not remove those defined on (or inherited from) the plan.
|
|
8173
|
+
* @default false
|
|
8174
|
+
* @example true
|
|
8175
|
+
*/
|
|
8176
|
+
progressive_billing_disabled?: boolean;
|
|
8177
|
+
/**
|
|
8178
|
+
* Usage thresholds managed directly on the subscription. This is the recommended way to set progressive billing thresholds per subscription; when present, they take precedence over the thresholds defined on the plan.
|
|
8179
|
+
*
|
|
8180
|
+
* Sending an empty array removes all subscription-level thresholds. This field cannot be combined with `plan_overrides.usage_thresholds` in the same request. To fully disable progressive billing on a subscription that inherits thresholds from its plan, use `progressive_billing_disabled` instead.
|
|
8181
|
+
*/
|
|
8182
|
+
usage_thresholds?: UsageThresholdInput[];
|
|
8078
8183
|
/** Optional list of activation rules that gate the subscription activation. Activation rules can only be set or modified while the subscription is `pending` (future-dated and not yet activated); the request is rejected for `incomplete`, `active`, or `terminated` subscriptions. */
|
|
8079
8184
|
activation_rules?: SubscriptionActivationRuleInput[];
|
|
8080
8185
|
};
|
|
@@ -8417,6 +8522,11 @@ export interface WalletTransactionCreateInput {
|
|
|
8417
8522
|
* @example false
|
|
8418
8523
|
*/
|
|
8419
8524
|
ignore_paid_top_up_limits?: boolean;
|
|
8525
|
+
/**
|
|
8526
|
+
* The purchase order number associated with this wallet transaction. It will be added to invoices generated for the resulting wallet top-up. If not set, falls back to the wallet's `purchase_order_number`.
|
|
8527
|
+
* @example "PO-123"
|
|
8528
|
+
*/
|
|
8529
|
+
purchase_order_number?: string | null;
|
|
8420
8530
|
/** Configuration for invoice custom sections to apply to invoices generated by this resource. */
|
|
8421
8531
|
invoice_custom_section?: InvoiceCustomSectionInput;
|
|
8422
8532
|
/** Optional payment method to use for processing the wallet transaction payment. */
|
|
@@ -8549,6 +8659,11 @@ export interface WalletTransactionObject {
|
|
|
8549
8659
|
applied_invoice_custom_sections?: AppliedInvoiceCustomSectionObject[];
|
|
8550
8660
|
/** The payment method assigned to this wallet transaction for processing the payment. */
|
|
8551
8661
|
payment_method: PaymentMethodReference;
|
|
8662
|
+
/**
|
|
8663
|
+
* The purchase order number associated with this wallet transaction. It will be added to invoices generated for the resulting wallet top-up. If not set, falls back to the wallet's `purchase_order_number`.
|
|
8664
|
+
* @example "PO-123"
|
|
8665
|
+
*/
|
|
8666
|
+
purchase_order_number?: string | null;
|
|
8552
8667
|
}
|
|
8553
8668
|
export interface WalletTransactions {
|
|
8554
8669
|
wallet_transactions: WalletTransactionObject[];
|
|
@@ -8674,8 +8789,8 @@ export interface WebhookEndpointObject {
|
|
|
8674
8789
|
*/
|
|
8675
8790
|
lago_organization_id: string;
|
|
8676
8791
|
/**
|
|
8677
|
-
* The
|
|
8678
|
-
* @example "
|
|
8792
|
+
* The URL of the webhook endpoint.
|
|
8793
|
+
* @example "https://foo.bar"
|
|
8679
8794
|
*/
|
|
8680
8795
|
webhook_url: string;
|
|
8681
8796
|
/**
|
|
@@ -8683,6 +8798,16 @@ export interface WebhookEndpointObject {
|
|
|
8683
8798
|
* @example "hmac"
|
|
8684
8799
|
*/
|
|
8685
8800
|
signature_algo?: "jwt" | "hmac";
|
|
8801
|
+
/**
|
|
8802
|
+
* The name of the webhook.
|
|
8803
|
+
* @example "EC2-production"
|
|
8804
|
+
*/
|
|
8805
|
+
name?: string | null;
|
|
8806
|
+
/**
|
|
8807
|
+
* A list of event types that will trigger the webhook. Passing null means that all event types will be sent.
|
|
8808
|
+
* @example ["invoice.voided","customer.created"]
|
|
8809
|
+
*/
|
|
8810
|
+
event_types?: any[] | null;
|
|
8686
8811
|
/**
|
|
8687
8812
|
* The date of the webhook endpoint creation, represented in ISO 8601 datetime format and expressed in Coordinated Universal Time (UTC).
|
|
8688
8813
|
* @format date-time
|
|
@@ -8706,6 +8831,16 @@ export interface WebhookEndpointCreateInput {
|
|
|
8706
8831
|
* @example "hmac"
|
|
8707
8832
|
*/
|
|
8708
8833
|
signature_algo?: "jwt" | "hmac";
|
|
8834
|
+
/**
|
|
8835
|
+
* The name of the webhook.
|
|
8836
|
+
* @example "EC2-production"
|
|
8837
|
+
*/
|
|
8838
|
+
name?: string | null;
|
|
8839
|
+
/**
|
|
8840
|
+
* A list of event types that will trigger the webhook. Passing null means that all event types will be sent.
|
|
8841
|
+
* @example ["invoice.voided","customer.created"]
|
|
8842
|
+
*/
|
|
8843
|
+
event_types?: any[] | null;
|
|
8709
8844
|
};
|
|
8710
8845
|
}
|
|
8711
8846
|
export interface WebhookEndpoint {
|
|
@@ -8723,6 +8858,16 @@ export interface WebhookEndpointUpdateInput {
|
|
|
8723
8858
|
* @example "hmac"
|
|
8724
8859
|
*/
|
|
8725
8860
|
signature_algo?: "jwt" | "hmac";
|
|
8861
|
+
/**
|
|
8862
|
+
* The name of the webhook.
|
|
8863
|
+
* @example "EC2-production"
|
|
8864
|
+
*/
|
|
8865
|
+
name?: string | null;
|
|
8866
|
+
/**
|
|
8867
|
+
* A list of event types that will trigger the webhook. Passing null means that all event types will be sent.
|
|
8868
|
+
* @example ["invoice.voided","customer.created"]
|
|
8869
|
+
*/
|
|
8870
|
+
event_types?: any[] | null;
|
|
8726
8871
|
};
|
|
8727
8872
|
}
|
|
8728
8873
|
export interface TriggeredAlertObject {
|
|
@@ -9242,7 +9387,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
9242
9387
|
}
|
|
9243
9388
|
/**
|
|
9244
9389
|
* @title Lago API documentation
|
|
9245
|
-
* @version 1.
|
|
9390
|
+
* @version 1.52.0
|
|
9246
9391
|
* @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
|
|
9247
9392
|
* @baseUrl https://api.getlago.com/api/v1
|
|
9248
9393
|
* @externalDocs https://github.com/getlago
|
|
@@ -10005,6 +10150,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10005
10150
|
* @example "INV-001-002"
|
|
10006
10151
|
*/
|
|
10007
10152
|
invoice_number?: string;
|
|
10153
|
+
/**
|
|
10154
|
+
* Filter by the invoice purchase order number. The match is exact but case-insensitive.
|
|
10155
|
+
* @example "PO-123"
|
|
10156
|
+
*/
|
|
10157
|
+
purchase_order_number?: string;
|
|
10008
10158
|
/**
|
|
10009
10159
|
* Filter credit notes of at least a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types.
|
|
10010
10160
|
* @example 9000
|
|
@@ -10313,6 +10463,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10313
10463
|
* @example "INV-001-002"
|
|
10314
10464
|
*/
|
|
10315
10465
|
invoice_number?: string;
|
|
10466
|
+
/**
|
|
10467
|
+
* Filter by the invoice purchase order number. The match is exact but case-insensitive.
|
|
10468
|
+
* @example "PO-123"
|
|
10469
|
+
*/
|
|
10470
|
+
purchase_order_number?: string;
|
|
10316
10471
|
/**
|
|
10317
10472
|
* Filter credit notes of at least a specific amount. This parameter must be defined in cents to ensure consistent handling for all currency types.
|
|
10318
10473
|
* @example 9000
|
|
@@ -10402,6 +10557,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10402
10557
|
* @example "someValue"
|
|
10403
10558
|
*/
|
|
10404
10559
|
"metadata[key]"?: string;
|
|
10560
|
+
/**
|
|
10561
|
+
* Filter by the invoice purchase order number. The match is exact but case-insensitive.
|
|
10562
|
+
* @example "PO-123"
|
|
10563
|
+
*/
|
|
10564
|
+
purchase_order_number?: string;
|
|
10405
10565
|
}, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized | ApiErrorUnprocessableEntity | ApiErrorNotFound>>;
|
|
10406
10566
|
/**
|
|
10407
10567
|
* @description This endpoint is used to list all payments of a customer
|
|
@@ -11208,6 +11368,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11208
11368
|
* @example "someValue"
|
|
11209
11369
|
*/
|
|
11210
11370
|
"metadata[key]"?: string;
|
|
11371
|
+
/**
|
|
11372
|
+
* Filter by the invoice purchase order number. The match is exact but case-insensitive.
|
|
11373
|
+
* @example "PO-123"
|
|
11374
|
+
*/
|
|
11375
|
+
purchase_order_number?: string;
|
|
11211
11376
|
}, params?: RequestParams) => Promise<HttpResponse<InvoicesPaginated, ApiErrorUnauthorized>>;
|
|
11212
11377
|
/**
|
|
11213
11378
|
* @description This endpoint is used for updating an existing invoice.
|
|
@@ -11229,6 +11394,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11229
11394
|
* @secure
|
|
11230
11395
|
*/
|
|
11231
11396
|
findInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound>>;
|
|
11397
|
+
/**
|
|
11398
|
+
* @description This endpoint is used for permanently deleting a `draft` invoice. Deleting a draft invoice removes it entirely: it never becomes accounts receivable, consumes no invoice number, and disappears from every list, export, and analytics surface. Only invoices in the `draft` status can be deleted; for a `finalized` invoice, void it instead.
|
|
11399
|
+
*
|
|
11400
|
+
* @tags invoices
|
|
11401
|
+
* @name DeleteInvoice
|
|
11402
|
+
* @summary Delete a draft invoice
|
|
11403
|
+
* @request DELETE:/invoices/{lago_id}
|
|
11404
|
+
* @secure
|
|
11405
|
+
*/
|
|
11406
|
+
deleteInvoice: (lagoId: string, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiErrorUnauthorized | ApiErrorNotFound | ApiErrorNotAllowed>>;
|
|
11232
11407
|
/**
|
|
11233
11408
|
* @description This endpoint is used for downloading a specific invoice PDF document.
|
|
11234
11409
|
*
|
|
@@ -11940,8 +12115,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
11940
12115
|
*/
|
|
11941
12116
|
destroySubscription: (externalId: string, query?: {
|
|
11942
12117
|
/**
|
|
11943
|
-
*
|
|
11944
|
-
*
|
|
12118
|
+
* Selects which subscription to terminate for the given `external_id`, based on its status. If the field is not defined, Lago targets only `active` subscriptions.
|
|
12119
|
+
*
|
|
12120
|
+
* - `pending`: cancel a subscription scheduled for a future activation (include `status=pending`).
|
|
12121
|
+
* - `incomplete`: cancel a payment-gated subscription that is still awaiting its activation payment (include `status=incomplete`). The subscription is canceled with `cancellation_reason: manual`, its invoice is closed and nothing is billed, and any pending payment is canceled on a best-effort basis with the payment provider (some provider statuses cannot be canceled). Applied coupons, credit notes and wallet credits are recredited. Termination behaviours (`on_termination_credit_note`, `on_termination_invoice`) are ignored, as an incomplete subscription has never been billed.
|
|
12122
|
+
* @default "active"
|
|
12123
|
+
* @example "incomplete"
|
|
11945
12124
|
*/
|
|
11946
12125
|
status?: string;
|
|
11947
12126
|
/**
|
package/esm/openapi/client.js
CHANGED
|
@@ -156,7 +156,7 @@ export class HttpClient {
|
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
158
|
* @title Lago API documentation
|
|
159
|
-
* @version 1.
|
|
159
|
+
* @version 1.52.0
|
|
160
160
|
* @license AGPLv3 (https://github.com/getlago/lago-openapi/blob/main/LICENSE)
|
|
161
161
|
* @baseUrl https://api.getlago.com/api/v1
|
|
162
162
|
* @externalDocs https://github.com/getlago
|
|
@@ -1852,6 +1852,22 @@ export class Api extends HttpClient {
|
|
|
1852
1852
|
format: "json",
|
|
1853
1853
|
...params,
|
|
1854
1854
|
}),
|
|
1855
|
+
/**
|
|
1856
|
+
* @description This endpoint is used for permanently deleting a `draft` invoice. Deleting a draft invoice removes it entirely: it never becomes accounts receivable, consumes no invoice number, and disappears from every list, export, and analytics surface. Only invoices in the `draft` status can be deleted; for a `finalized` invoice, void it instead.
|
|
1857
|
+
*
|
|
1858
|
+
* @tags invoices
|
|
1859
|
+
* @name DeleteInvoice
|
|
1860
|
+
* @summary Delete a draft invoice
|
|
1861
|
+
* @request DELETE:/invoices/{lago_id}
|
|
1862
|
+
* @secure
|
|
1863
|
+
*/
|
|
1864
|
+
deleteInvoice: (lagoId, params = {}) => this.request({
|
|
1865
|
+
path: `/invoices/${lagoId}`,
|
|
1866
|
+
method: "DELETE",
|
|
1867
|
+
secure: true,
|
|
1868
|
+
format: "json",
|
|
1869
|
+
...params,
|
|
1870
|
+
}),
|
|
1855
1871
|
/**
|
|
1856
1872
|
* @description This endpoint is used for downloading a specific invoice PDF document.
|
|
1857
1873
|
*
|