lago-javascript-client 0.30.0-beta → 0.32.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -148,7 +148,7 @@ export class HttpClient {
148
148
  }
149
149
  /**
150
150
  * @title Lago API documentation
151
- * @version 0.29.0-beta
151
+ * @version 0.30.0-beta
152
152
  * @baseUrl https://api.getlago.com/api/v1
153
153
  * @externalDocs https://github.com/getlago
154
154
  * @contact <tech@getlago.com>
@@ -567,12 +567,12 @@ export class Api extends HttpClient {
567
567
  * @description Return the deleted customer
568
568
  *
569
569
  * @tags customers
570
- * @name DeleteCustomer
570
+ * @name DestroyCustomer
571
571
  * @summary Delete a customer
572
572
  * @request DELETE:/customers/{external_id}
573
573
  * @secure
574
574
  */
575
- deleteCustomer: (externalId, params = {}) => this.request({
575
+ destroyCustomer: (externalId, params = {}) => this.request({
576
576
  path: `/customers/${externalId}`,
577
577
  method: "DELETE",
578
578
  secure: true,
@@ -758,7 +758,7 @@ export class Api extends HttpClient {
758
758
  *
759
759
  * @tags plans
760
760
  * @name FindPlan
761
- * @summary Fin plan by code
761
+ * @summary Find plan by code
762
762
  * @request GET:/plans/{code}
763
763
  * @secure
764
764
  */
@@ -875,6 +875,24 @@ export class Api extends HttpClient {
875
875
  }),
876
876
  };
877
877
  invoices = {
878
+ /**
879
+ * @description Create a new one off Invoice
880
+ *
881
+ * @tags invoices
882
+ * @name CreateInvoice
883
+ * @summary Create a new invoice
884
+ * @request POST:/invoices
885
+ * @secure
886
+ */
887
+ createInvoice: (data, params = {}) => this.request({
888
+ path: `/invoices`,
889
+ method: "POST",
890
+ body: data,
891
+ secure: true,
892
+ type: ContentType.Json,
893
+ format: "json",
894
+ ...params,
895
+ }),
878
896
  /**
879
897
  * @description Find all invoices in certain organisation
880
898
  *
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "types": "./types/mod.d.ts",
5
5
  "name": "lago-javascript-client",
6
6
  "sideEffects": false,
7
- "version": "v0.30.0-beta",
7
+ "version": "v0.32.0-beta",
8
8
  "description": "Lago JavaScript API Client",
9
9
  "repository": {
10
10
  "type": "git",
@@ -152,7 +152,7 @@ class HttpClient {
152
152
  exports.HttpClient = HttpClient;
153
153
  /**
154
154
  * @title Lago API documentation
155
- * @version 0.29.0-beta
155
+ * @version 0.30.0-beta
156
156
  * @baseUrl https://api.getlago.com/api/v1
157
157
  * @externalDocs https://github.com/getlago
158
158
  * @contact <tech@getlago.com>
@@ -571,12 +571,12 @@ class Api extends HttpClient {
571
571
  * @description Return the deleted customer
572
572
  *
573
573
  * @tags customers
574
- * @name DeleteCustomer
574
+ * @name DestroyCustomer
575
575
  * @summary Delete a customer
576
576
  * @request DELETE:/customers/{external_id}
577
577
  * @secure
578
578
  */
579
- deleteCustomer: (externalId, params = {}) => this.request({
579
+ destroyCustomer: (externalId, params = {}) => this.request({
580
580
  path: `/customers/${externalId}`,
581
581
  method: "DELETE",
582
582
  secure: true,
@@ -762,7 +762,7 @@ class Api extends HttpClient {
762
762
  *
763
763
  * @tags plans
764
764
  * @name FindPlan
765
- * @summary Fin plan by code
765
+ * @summary Find plan by code
766
766
  * @request GET:/plans/{code}
767
767
  * @secure
768
768
  */
@@ -879,6 +879,24 @@ class Api extends HttpClient {
879
879
  }),
880
880
  };
881
881
  invoices = {
882
+ /**
883
+ * @description Create a new one off Invoice
884
+ *
885
+ * @tags invoices
886
+ * @name CreateInvoice
887
+ * @summary Create a new invoice
888
+ * @request POST:/invoices
889
+ * @secure
890
+ */
891
+ createInvoice: (data, params = {}) => this.request({
892
+ path: `/invoices`,
893
+ method: "POST",
894
+ body: data,
895
+ secure: true,
896
+ type: ContentType.Json,
897
+ format: "json",
898
+ ...params,
899
+ }),
882
900
  /**
883
901
  * @description Find all invoices in certain organisation
884
902
  *
@@ -947,6 +947,8 @@ export interface CreditObject {
947
947
  amount_cents: number;
948
948
  /** @example "EUR" */
949
949
  amount_currency: string;
950
+ /** @example false */
951
+ before_vat: boolean;
950
952
  item: {
951
953
  /**
952
954
  * @format uuid
@@ -1085,36 +1087,68 @@ export interface InvoiceObject {
1085
1087
  sequential_id: number;
1086
1088
  /** @example "222345" */
1087
1089
  number: string;
1088
- /**
1089
- * @format date-time
1090
- * @example "2022-09-14T16:35:31Z"
1091
- */
1092
- charges_from_date: string;
1093
1090
  /**
1094
1091
  * @format date-time
1095
1092
  * @example "2022-09-14T16:35:31Z"
1096
1093
  */
1097
1094
  issuing_date: string;
1098
- invoice_type?: "subscription" | "add_on" | "credit";
1095
+ invoice_type: "subscription" | "add_on" | "credit";
1099
1096
  status: "draft" | "finalized";
1100
1097
  payment_status: "pending" | "succeeded" | "failed";
1101
- /** @example 1200 */
1102
- amount_cents: number;
1103
1098
  /** @example "EUR" */
1104
- amount_currency: string;
1099
+ currency: string;
1100
+ /** @example 20 */
1101
+ fees_amount_cents: number;
1102
+ /** @example 20 */
1103
+ coupons_amount_cents: number;
1104
+ /** @example 20 */
1105
+ credit_notes_amount_cents: number;
1106
+ /** @example 20 */
1107
+ sub_total_vat_excluded_amount_cents: number;
1105
1108
  /** @example 20 */
1106
1109
  vat_amount_cents: number;
1107
- /** @example "EUR" */
1108
- vat_amount_currency: string;
1109
1110
  /** @example 20 */
1111
+ sub_total_vat_included_amount_cents: number;
1112
+ /** @example 20 */
1113
+ prepaid_credit_amount_cents: number;
1114
+ /** @example 20 */
1115
+ total_amount_cents: number;
1116
+ /** @example 2 */
1117
+ version_number: number;
1118
+ /**
1119
+ * @deprecated
1120
+ * @example 1200
1121
+ */
1122
+ amount_cents: number;
1123
+ /**
1124
+ * @deprecated
1125
+ * @example "EUR"
1126
+ */
1127
+ amount_currency: string;
1128
+ /**
1129
+ * @deprecated
1130
+ * @example "EUR"
1131
+ */
1132
+ vat_amount_currency: string;
1133
+ /**
1134
+ * @deprecated
1135
+ * @example 20
1136
+ */
1110
1137
  credit_amount_cents: number;
1111
- /** @example "EUR" */
1138
+ /**
1139
+ * @deprecated
1140
+ * @example "EUR"
1141
+ */
1112
1142
  credit_amount_currency: string;
1113
- /** @example 1220 */
1114
- total_amount_cents: number;
1115
- /** @example "EUR" */
1143
+ /**
1144
+ * @deprecated
1145
+ * @example "EUR"
1146
+ */
1116
1147
  total_amount_currency: string;
1117
- /** @example true */
1148
+ /**
1149
+ * @deprecated
1150
+ * @example true
1151
+ */
1118
1152
  legacy: boolean;
1119
1153
  /** @example "https://example.com" */
1120
1154
  file_url?: string;
@@ -1129,9 +1163,6 @@ export type InvoiceObjectExtended = InvoiceObject & {
1129
1163
  export interface Invoice {
1130
1164
  invoice: InvoiceObjectExtended;
1131
1165
  }
1132
- export interface Invoices {
1133
- invoices: InvoiceObject[];
1134
- }
1135
1166
  export interface InvoicesPaginated {
1136
1167
  invoices: InvoiceObject[];
1137
1168
  meta: PaginationMeta;
@@ -1139,7 +1170,7 @@ export interface InvoicesPaginated {
1139
1170
  export interface InvoiceInput {
1140
1171
  invoice: {
1141
1172
  /** Status */
1142
- payment_status: "pending" | "succeeded" | "failed";
1173
+ payment_status?: "pending" | "succeeded" | "failed";
1143
1174
  metadata?: {
1144
1175
  /**
1145
1176
  * @format uuid
@@ -1153,6 +1184,24 @@ export interface InvoiceInput {
1153
1184
  }[];
1154
1185
  };
1155
1186
  }
1187
+ export interface InvoiceOneOffInput {
1188
+ invoice: {
1189
+ /** @example "_ID_" */
1190
+ external_customer_id: string;
1191
+ /** @example "EUR" */
1192
+ currency?: string;
1193
+ fees?: {
1194
+ /** @example "12345" */
1195
+ add_on_code: string;
1196
+ /** @example 1200 */
1197
+ unit_amount_cents?: number;
1198
+ /** @example 2.5 */
1199
+ units?: number;
1200
+ /** @example "This is description" */
1201
+ description?: string;
1202
+ }[];
1203
+ };
1204
+ }
1156
1205
  export interface WalletObject {
1157
1206
  /**
1158
1207
  * @format uuid
@@ -1280,9 +1329,6 @@ export interface WalletTransactionObject {
1280
1329
  */
1281
1330
  created_at: string;
1282
1331
  }
1283
- export interface WalletTransaction {
1284
- wallet_transaction: WalletTransactionObject;
1285
- }
1286
1332
  export interface WalletTransactions {
1287
1333
  wallet_transactions: WalletTransactionObject[];
1288
1334
  }
@@ -1344,30 +1390,52 @@ export interface CreditNoteObject {
1344
1390
  reason: "duplicated_charge" | "product_unsatisfactory" | "order_change" | "order_cancellation" | "fraudulent_charge" | "other";
1345
1391
  /** @example "description" */
1346
1392
  description?: string;
1393
+ /** @example "EUR" */
1394
+ currency: string;
1347
1395
  /** @example 1220 */
1348
1396
  total_amount_cents: number;
1349
- /** @example "EUR" */
1397
+ /**
1398
+ * @deprecated
1399
+ * @example "EUR"
1400
+ */
1350
1401
  total_amount_currency: string;
1351
1402
  /** @example 20 */
1352
1403
  vat_amount_cents: number;
1353
- /** @example "EUR" */
1404
+ /**
1405
+ * @deprecated
1406
+ * @example "EUR"
1407
+ */
1354
1408
  vat_amount_currency: string;
1355
1409
  /** @example 1000 */
1356
1410
  sub_total_vat_excluded_amount_cents: number;
1357
- /** @example "EUR" */
1411
+ /**
1412
+ * @deprecated
1413
+ * @example "EUR"
1414
+ */
1358
1415
  sub_total_vat_excluded_amount_currency: string;
1359
1416
  /** @example 20 */
1360
1417
  balance_amount_cents: number;
1361
- /** @example "EUR" */
1418
+ /**
1419
+ * @deprecated
1420
+ * @example "EUR"
1421
+ */
1362
1422
  balance_amount_currency: string;
1363
1423
  /** @example 20 */
1364
1424
  credit_amount_cents: number;
1365
- /** @example "EUR" */
1425
+ /**
1426
+ * @deprecated
1427
+ * @example "EUR"
1428
+ */
1366
1429
  credit_amount_currency: string;
1367
1430
  /** @example 20 */
1368
1431
  refund_amount_cents: number;
1369
- /** @example "EUR" */
1432
+ /**
1433
+ * @deprecated
1434
+ * @example "EUR"
1435
+ */
1370
1436
  refund_amount_currency: string;
1437
+ /** @example 20 */
1438
+ coupons_adjustement_amount_cents: number;
1371
1439
  /**
1372
1440
  * @format date-time
1373
1441
  * @example "2022-09-14T16:35:31Z"
@@ -1555,7 +1623,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
1555
1623
  }
1556
1624
  /**
1557
1625
  * @title Lago API documentation
1558
- * @version 0.29.0-beta
1626
+ * @version 0.30.0-beta
1559
1627
  * @baseUrl https://api.getlago.com/api/v1
1560
1628
  * @externalDocs https://github.com/getlago
1561
1629
  * @contact <tech@getlago.com>
@@ -1883,12 +1951,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1883
1951
  * @description Return the deleted customer
1884
1952
  *
1885
1953
  * @tags customers
1886
- * @name DeleteCustomer
1954
+ * @name DestroyCustomer
1887
1955
  * @summary Delete a customer
1888
1956
  * @request DELETE:/customers/{external_id}
1889
1957
  * @secure
1890
1958
  */
1891
- deleteCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiResponseUnauthorized | ApiResponseNotFound>>;
1959
+ destroyCustomer: (externalId: string, params?: RequestParams) => Promise<HttpResponse<Customer, ApiResponseUnauthorized | ApiResponseNotFound>>;
1892
1960
  /**
1893
1961
  * @description Return a customer current usage
1894
1962
  *
@@ -2020,7 +2088,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
2020
2088
  *
2021
2089
  * @tags plans
2022
2090
  * @name FindPlan
2023
- * @summary Fin plan by code
2091
+ * @summary Find plan by code
2024
2092
  * @request GET:/plans/{code}
2025
2093
  * @secure
2026
2094
  */
@@ -2107,6 +2175,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
2107
2175
  fetchPublicKey: (params?: RequestParams) => Promise<HttpResponse<string, ApiResponseUnauthorized>>;
2108
2176
  };
2109
2177
  invoices: {
2178
+ /**
2179
+ * @description Create a new one off Invoice
2180
+ *
2181
+ * @tags invoices
2182
+ * @name CreateInvoice
2183
+ * @summary Create a new invoice
2184
+ * @request POST:/invoices
2185
+ * @secure
2186
+ */
2187
+ createInvoice: (data: InvoiceOneOffInput, params?: RequestParams) => Promise<HttpResponse<Invoice, ApiResponseBadRequest | ApiResponseUnauthorized | ApiResponseUnprocessableEntity>>;
2110
2188
  /**
2111
2189
  * @description Find all invoices in certain organisation
2112
2190
  *