lago-javascript-client 1.36.0 → 1.43.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.
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 1.36.0
151
+ * @version 1.42.0
152
152
  * @license AGPLv3
153
153
  * @baseUrl https://api.getlago.com/api/v1
154
154
  * @externalDocs https://github.com/getlago
@@ -940,6 +940,74 @@ export class Api extends HttpClient {
940
940
  format: "json",
941
941
  ...params,
942
942
  }),
943
+ /**
944
+ * @description This endpoint replaces all existing metadata on a credit note with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
945
+ *
946
+ * @tags credit_notes
947
+ * @name ReplaceCreditNoteMetadata
948
+ * @summary Replace credit note metadata
949
+ * @request POST:/credit_notes/{lago_id}/metadata
950
+ * @secure
951
+ */
952
+ replaceCreditNoteMetadata: (lagoId, data, params = {}) => this.request({
953
+ path: `/credit_notes/${lagoId}/metadata`,
954
+ method: "POST",
955
+ body: data,
956
+ secure: true,
957
+ type: ContentType.Json,
958
+ format: "json",
959
+ ...params,
960
+ }),
961
+ /**
962
+ * @description This endpoint merges the provided metadata with existing metadata on the credit note. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
963
+ *
964
+ * @tags credit_notes
965
+ * @name MergeCreditNoteMetadata
966
+ * @summary Merge credit note metadata
967
+ * @request PATCH:/credit_notes/{lago_id}/metadata
968
+ * @secure
969
+ */
970
+ mergeCreditNoteMetadata: (lagoId, data, params = {}) => this.request({
971
+ path: `/credit_notes/${lagoId}/metadata`,
972
+ method: "PATCH",
973
+ body: data,
974
+ secure: true,
975
+ type: ContentType.Json,
976
+ format: "json",
977
+ ...params,
978
+ }),
979
+ /**
980
+ * @description This endpoint removes all metadata from a credit note.
981
+ *
982
+ * @tags credit_notes
983
+ * @name DeleteAllCreditNoteMetadata
984
+ * @summary Delete all credit note metadata
985
+ * @request DELETE:/credit_notes/{lago_id}/metadata
986
+ * @secure
987
+ */
988
+ deleteAllCreditNoteMetadata: (lagoId, params = {}) => this.request({
989
+ path: `/credit_notes/${lagoId}/metadata`,
990
+ method: "DELETE",
991
+ secure: true,
992
+ format: "json",
993
+ ...params,
994
+ }),
995
+ /**
996
+ * @description This endpoint removes a single metadata key from a credit note.
997
+ *
998
+ * @tags credit_notes
999
+ * @name DeleteCreditNoteMetadataKey
1000
+ * @summary Delete a metadata key
1001
+ * @request DELETE:/credit_notes/{lago_id}/metadata/{key}
1002
+ * @secure
1003
+ */
1004
+ deleteCreditNoteMetadataKey: (lagoId, key, params = {}) => this.request({
1005
+ path: `/credit_notes/${lagoId}/metadata/${key}`,
1006
+ method: "DELETE",
1007
+ secure: true,
1008
+ format: "json",
1009
+ ...params,
1010
+ }),
943
1011
  };
944
1012
  customers = {
945
1013
  /**
@@ -1227,6 +1295,55 @@ export class Api extends HttpClient {
1227
1295
  format: "json",
1228
1296
  ...params,
1229
1297
  }),
1298
+ /**
1299
+ * @description This endpoint retrieves all payment methods of a Customer.
1300
+ *
1301
+ * @tags payment_methods
1302
+ * @name FindAllCustomersPaymentMethods
1303
+ * @summary List all customer payment methods
1304
+ * @request GET:/customers/{external_customer_id}/payment_methods
1305
+ * @secure
1306
+ */
1307
+ findAllCustomersPaymentMethods: (externalCustomerId, query, params = {}) => this.request({
1308
+ path: `/customers/${externalCustomerId}/payment_methods`,
1309
+ method: "GET",
1310
+ query: query,
1311
+ secure: true,
1312
+ format: "json",
1313
+ ...params,
1314
+ }),
1315
+ /**
1316
+ * @description Use the payment method as default when not selected a payment method
1317
+ *
1318
+ * @tags payment_methods
1319
+ * @name PaymentMethodSetAsDefault
1320
+ * @summary Set the payment method as default
1321
+ * @request PUT:/customers/{external_customer_id}/payment_methods/{lago_id}/set_as_default
1322
+ * @secure
1323
+ */
1324
+ paymentMethodSetAsDefault: (lagoId, externalCustomerId, params = {}) => this.request({
1325
+ path: `/customers/${externalCustomerId}/payment_methods/${lagoId}/set_as_default`,
1326
+ method: "PUT",
1327
+ secure: true,
1328
+ format: "json",
1329
+ ...params,
1330
+ }),
1331
+ /**
1332
+ * @description This endpoint deletes a specific payment method for a customer.
1333
+ *
1334
+ * @tags payment_methods
1335
+ * @name DestroyPaymentMethod
1336
+ * @summary Delete a payment method
1337
+ * @request DELETE:/customers/{external_customer_id}/payment_methods/{lago_id}
1338
+ * @secure
1339
+ */
1340
+ destroyPaymentMethod: (lagoId, externalCustomerId, params = {}) => this.request({
1341
+ path: `/customers/${externalCustomerId}/payment_methods/${lagoId}`,
1342
+ method: "DELETE",
1343
+ secure: true,
1344
+ format: "json",
1345
+ ...params,
1346
+ }),
1230
1347
  };
1231
1348
  events = {
1232
1349
  /**
@@ -1337,7 +1454,7 @@ export class Api extends HttpClient {
1337
1454
  ...params,
1338
1455
  }),
1339
1456
  /**
1340
- * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription.
1457
+ * @description This endpoint is used for retrieving a specific usage measurement event that has been sent to a customer or a subscription. Note that transaction_id is unique per external_subscription_id so multiple subscriptions can share the same transaction_id. This endpoint will only return the first event found with the given transaction_id. WARNING: If your Lago organization is configured to use the Clickhouse-based event pipeline, multiple events can share the same `transaction_id` (with different timestamps). This endpoint will only return the first event found.
1341
1458
  *
1342
1459
  * @tags events
1343
1460
  * @name FindEvent
@@ -1615,10 +1732,12 @@ export class Api extends HttpClient {
1615
1732
  * @request POST:/invoices/{lago_id}/retry_payment
1616
1733
  * @secure
1617
1734
  */
1618
- retryPayment: (lagoId, params = {}) => this.request({
1735
+ retryPayment: (lagoId, data, params = {}) => this.request({
1619
1736
  path: `/invoices/${lagoId}/retry_payment`,
1620
1737
  method: "POST",
1738
+ body: data,
1621
1739
  secure: true,
1740
+ type: ContentType.Json,
1622
1741
  ...params,
1623
1742
  }),
1624
1743
  /**
@@ -1987,6 +2106,74 @@ export class Api extends HttpClient {
1987
2106
  format: "json",
1988
2107
  ...params,
1989
2108
  }),
2109
+ /**
2110
+ * @description This endpoint replaces all existing metadata on a plan with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
2111
+ *
2112
+ * @tags plans
2113
+ * @name ReplacePlanMetadata
2114
+ * @summary Replace plan metadata
2115
+ * @request POST:/plans/{code}/metadata
2116
+ * @secure
2117
+ */
2118
+ replacePlanMetadata: (code, data, params = {}) => this.request({
2119
+ path: `/plans/${code}/metadata`,
2120
+ method: "POST",
2121
+ body: data,
2122
+ secure: true,
2123
+ type: ContentType.Json,
2124
+ format: "json",
2125
+ ...params,
2126
+ }),
2127
+ /**
2128
+ * @description This endpoint merges the provided metadata with existing metadata on the plan. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
2129
+ *
2130
+ * @tags plans
2131
+ * @name MergePlanMetadata
2132
+ * @summary Merge plan metadata
2133
+ * @request PATCH:/plans/{code}/metadata
2134
+ * @secure
2135
+ */
2136
+ mergePlanMetadata: (code, data, params = {}) => this.request({
2137
+ path: `/plans/${code}/metadata`,
2138
+ method: "PATCH",
2139
+ body: data,
2140
+ secure: true,
2141
+ type: ContentType.Json,
2142
+ format: "json",
2143
+ ...params,
2144
+ }),
2145
+ /**
2146
+ * @description This endpoint removes all metadata from a plan.
2147
+ *
2148
+ * @tags plans
2149
+ * @name DeleteAllPlanMetadata
2150
+ * @summary Delete all plan metadata
2151
+ * @request DELETE:/plans/{code}/metadata
2152
+ * @secure
2153
+ */
2154
+ deleteAllPlanMetadata: (code, params = {}) => this.request({
2155
+ path: `/plans/${code}/metadata`,
2156
+ method: "DELETE",
2157
+ secure: true,
2158
+ format: "json",
2159
+ ...params,
2160
+ }),
2161
+ /**
2162
+ * @description This endpoint removes a single metadata key from a plan.
2163
+ *
2164
+ * @tags plans
2165
+ * @name DeletePlanMetadataKey
2166
+ * @summary Delete a metadata key
2167
+ * @request DELETE:/plans/{code}/metadata/{key}
2168
+ * @secure
2169
+ */
2170
+ deletePlanMetadataKey: (code, key, params = {}) => this.request({
2171
+ path: `/plans/${code}/metadata/${key}`,
2172
+ method: "DELETE",
2173
+ secure: true,
2174
+ format: "json",
2175
+ ...params,
2176
+ }),
1990
2177
  };
1991
2178
  subscriptions = {
1992
2179
  /**
@@ -2128,11 +2315,11 @@ export class Api extends HttpClient {
2128
2315
  ...params,
2129
2316
  }),
2130
2317
  /**
2131
- * @description This endpoint allows you to create a new alert for a subscription.
2318
+ * @description This endpoint allows you to create alerts for a subscription. Send a single alert object wrapped in `alert` key to create one alert, or an array of alert objects wrapped in `alerts` key to create multiple alerts atomically.
2132
2319
  *
2133
2320
  * @tags subscriptions
2134
2321
  * @name CreateSubscriptionAlert
2135
- * @summary Create a subscription alert
2322
+ * @summary Create subscription alert(s)
2136
2323
  * @request POST:/subscriptions/{external_id}/alerts
2137
2324
  * @secure
2138
2325
  */
@@ -2145,6 +2332,21 @@ export class Api extends HttpClient {
2145
2332
  format: "json",
2146
2333
  ...params,
2147
2334
  }),
2335
+ /**
2336
+ * @description This endpoint allows you to delete all alerts for a subscription.
2337
+ *
2338
+ * @tags subscriptions
2339
+ * @name DeleteAllSubscriptionAlerts
2340
+ * @summary Delete all subscription alerts
2341
+ * @request DELETE:/subscriptions/{external_id}/alerts
2342
+ * @secure
2343
+ */
2344
+ deleteAllSubscriptionAlerts: (externalId, params = {}) => this.request({
2345
+ path: `/subscriptions/${externalId}/alerts`,
2346
+ method: "DELETE",
2347
+ secure: true,
2348
+ ...params,
2349
+ }),
2148
2350
  /**
2149
2351
  * @description This endpoint enables the retrieval of a specific alert for a subscription.
2150
2352
  *
@@ -2261,6 +2463,22 @@ export class Api extends HttpClient {
2261
2463
  format: "json",
2262
2464
  ...params,
2263
2465
  }),
2466
+ /**
2467
+ * @description This endpoint retrieves all fixed charges for a specific subscription.
2468
+ *
2469
+ * @tags subscriptions
2470
+ * @name FindAllSubscriptionFixedCharges
2471
+ * @summary List subscription fixed charges
2472
+ * @request GET:/subscriptions/{external_id}/fixed_charges
2473
+ * @secure
2474
+ */
2475
+ findAllSubscriptionFixedCharges: (externalId, params = {}) => this.request({
2476
+ path: `/subscriptions/${externalId}/fixed_charges`,
2477
+ method: "GET",
2478
+ secure: true,
2479
+ format: "json",
2480
+ ...params,
2481
+ }),
2264
2482
  };
2265
2483
  taxes = {
2266
2484
  /**
@@ -2435,6 +2653,74 @@ export class Api extends HttpClient {
2435
2653
  format: "json",
2436
2654
  ...params,
2437
2655
  }),
2656
+ /**
2657
+ * @description This endpoint replaces all existing metadata on a wallet with the provided key-value pairs. Any existing metadata keys not included in the request will be removed.
2658
+ *
2659
+ * @tags wallets
2660
+ * @name ReplaceWalletMetadata
2661
+ * @summary Replace wallet metadata
2662
+ * @request POST:/wallets/{lago_id}/metadata
2663
+ * @secure
2664
+ */
2665
+ replaceWalletMetadata: (lagoId, data, params = {}) => this.request({
2666
+ path: `/wallets/${lagoId}/metadata`,
2667
+ method: "POST",
2668
+ body: data,
2669
+ secure: true,
2670
+ type: ContentType.Json,
2671
+ format: "json",
2672
+ ...params,
2673
+ }),
2674
+ /**
2675
+ * @description This endpoint merges the provided metadata with existing metadata on the wallet. Existing keys not in the request are preserved. New keys are added, existing keys are updated.
2676
+ *
2677
+ * @tags wallets
2678
+ * @name MergeWalletMetadata
2679
+ * @summary Merge wallet metadata
2680
+ * @request PATCH:/wallets/{lago_id}/metadata
2681
+ * @secure
2682
+ */
2683
+ mergeWalletMetadata: (lagoId, data, params = {}) => this.request({
2684
+ path: `/wallets/${lagoId}/metadata`,
2685
+ method: "PATCH",
2686
+ body: data,
2687
+ secure: true,
2688
+ type: ContentType.Json,
2689
+ format: "json",
2690
+ ...params,
2691
+ }),
2692
+ /**
2693
+ * @description This endpoint removes all metadata from a wallet.
2694
+ *
2695
+ * @tags wallets
2696
+ * @name DeleteAllWalletMetadata
2697
+ * @summary Delete all wallet metadata
2698
+ * @request DELETE:/wallets/{lago_id}/metadata
2699
+ * @secure
2700
+ */
2701
+ deleteAllWalletMetadata: (lagoId, params = {}) => this.request({
2702
+ path: `/wallets/${lagoId}/metadata`,
2703
+ method: "DELETE",
2704
+ secure: true,
2705
+ format: "json",
2706
+ ...params,
2707
+ }),
2708
+ /**
2709
+ * @description This endpoint removes a single metadata key from a wallet.
2710
+ *
2711
+ * @tags wallets
2712
+ * @name DeleteWalletMetadataKey
2713
+ * @summary Delete a metadata key
2714
+ * @request DELETE:/wallets/{lago_id}/metadata/{key}
2715
+ * @secure
2716
+ */
2717
+ deleteWalletMetadataKey: (lagoId, key, params = {}) => this.request({
2718
+ path: `/wallets/${lagoId}/metadata/${key}`,
2719
+ method: "DELETE",
2720
+ secure: true,
2721
+ format: "json",
2722
+ ...params,
2723
+ }),
2438
2724
  /**
2439
2725
  * @description This endpoint is used to list all wallet transactions.
2440
2726
  *
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.36.0",
6
+ "version": "v1.43.0",
7
7
  "description": "Lago JavaScript API Client",
8
8
  "repository": {
9
9
  "type": "git",