orb-billing 4.17.0 → 4.18.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.
@@ -50,6 +50,10 @@ export class Invoices extends APIResource {
50
50
  * the next page of results if they exist.
51
51
  *
52
52
  * By default, this only returns invoices that are `issued`, `paid`, or `synced`.
53
+ *
54
+ * When fetching any `draft` invoices, this returns the last-computed invoice
55
+ * values for each draft invoice, which may not always be up-to-date since Orb
56
+ * regularly refreshes invoices asynchronously.
53
57
  */
54
58
  list(query?: InvoiceListParams, options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
55
59
  list(options?: Core.RequestOptions): Core.PagePromise<InvoicesPage, Invoice>;
@@ -284,9 +288,9 @@ export interface Invoice {
284
288
  * provided, the first discount in the list will be returned. If the list is empty,
285
289
  * `None` will be returned.
286
290
  */
287
- discount: Shared.Discount | null;
291
+ discount: Invoice.PercentageDiscount | Invoice.AmountDiscount | Invoice.TrialDiscount | null;
288
292
 
289
- discounts: Array<Shared.Discount>;
293
+ discounts: Array<Invoice.PercentageDiscount | Invoice.AmountDiscount | Invoice.TrialDiscount>;
290
294
 
291
295
  /**
292
296
  * When the invoice payment is due.
@@ -301,7 +305,8 @@ export interface Invoice {
301
305
  eligible_to_issue_at: string | null;
302
306
 
303
307
  /**
304
- * A URL for the invoice portal.
308
+ * A URL for the customer-facing invoice portal. This URL expires 30 days after the
309
+ * invoice's due date, or 60 days after being re-generated through the UI.
305
310
  */
306
311
  hosted_invoice_url: string | null;
307
312
 
@@ -826,6 +831,120 @@ export namespace Invoice {
826
831
  value: string;
827
832
  }
828
833
 
834
+ export interface PercentageDiscount {
835
+ /**
836
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
837
+ * this can be a subset of prices.
838
+ */
839
+ applies_to_price_ids: Array<string>;
840
+
841
+ discount_type: 'percentage';
842
+
843
+ /**
844
+ * Only available if discount_type is `percentage`. This is a number between 0
845
+ * and 1.
846
+ */
847
+ percentage_discount: number;
848
+
849
+ reason?: string | null;
850
+ }
851
+
852
+ export interface AmountDiscount {
853
+ /**
854
+ * Only available if discount_type is `amount`.
855
+ */
856
+ amount_discount: string;
857
+
858
+ /**
859
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
860
+ * this can be a subset of prices.
861
+ */
862
+ applies_to_price_ids: Array<string>;
863
+
864
+ discount_type: 'amount';
865
+
866
+ reason?: string | null;
867
+ }
868
+
869
+ export interface TrialDiscount {
870
+ /**
871
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
872
+ * this can be a subset of prices.
873
+ */
874
+ applies_to_price_ids: Array<string>;
875
+
876
+ discount_type: 'trial';
877
+
878
+ reason?: string | null;
879
+
880
+ /**
881
+ * Only available if discount_type is `trial`
882
+ */
883
+ trial_amount_discount?: string | null;
884
+
885
+ /**
886
+ * Only available if discount_type is `trial`
887
+ */
888
+ trial_percentage_discount?: number | null;
889
+ }
890
+
891
+ export interface PercentageDiscount {
892
+ /**
893
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
894
+ * this can be a subset of prices.
895
+ */
896
+ applies_to_price_ids: Array<string>;
897
+
898
+ discount_type: 'percentage';
899
+
900
+ /**
901
+ * Only available if discount_type is `percentage`. This is a number between 0
902
+ * and 1.
903
+ */
904
+ percentage_discount: number;
905
+
906
+ reason?: string | null;
907
+ }
908
+
909
+ export interface AmountDiscount {
910
+ /**
911
+ * Only available if discount_type is `amount`.
912
+ */
913
+ amount_discount: string;
914
+
915
+ /**
916
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
917
+ * this can be a subset of prices.
918
+ */
919
+ applies_to_price_ids: Array<string>;
920
+
921
+ discount_type: 'amount';
922
+
923
+ reason?: string | null;
924
+ }
925
+
926
+ export interface TrialDiscount {
927
+ /**
928
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
929
+ * this can be a subset of prices.
930
+ */
931
+ applies_to_price_ids: Array<string>;
932
+
933
+ discount_type: 'trial';
934
+
935
+ reason?: string | null;
936
+
937
+ /**
938
+ * Only available if discount_type is `trial`
939
+ */
940
+ trial_amount_discount?: string | null;
941
+
942
+ /**
943
+ * Only available if discount_type is `trial`
944
+ */
945
+ trial_percentage_discount?: number | null;
946
+ }
947
+
829
948
  export interface LineItem {
830
949
  /**
831
950
  * A unique ID for this line item.
@@ -1457,9 +1576,17 @@ export interface InvoiceFetchUpcomingResponse {
1457
1576
  * provided, the first discount in the list will be returned. If the list is empty,
1458
1577
  * `None` will be returned.
1459
1578
  */
1460
- discount: Shared.Discount | null;
1579
+ discount:
1580
+ | InvoiceFetchUpcomingResponse.PercentageDiscount
1581
+ | InvoiceFetchUpcomingResponse.AmountDiscount
1582
+ | InvoiceFetchUpcomingResponse.TrialDiscount
1583
+ | null;
1461
1584
 
1462
- discounts: Array<Shared.Discount>;
1585
+ discounts: Array<
1586
+ | InvoiceFetchUpcomingResponse.PercentageDiscount
1587
+ | InvoiceFetchUpcomingResponse.AmountDiscount
1588
+ | InvoiceFetchUpcomingResponse.TrialDiscount
1589
+ >;
1463
1590
 
1464
1591
  /**
1465
1592
  * When the invoice payment is due.
@@ -1474,7 +1601,8 @@ export interface InvoiceFetchUpcomingResponse {
1474
1601
  eligible_to_issue_at: string | null;
1475
1602
 
1476
1603
  /**
1477
- * A URL for the invoice portal.
1604
+ * A URL for the customer-facing invoice portal. This URL expires 30 days after the
1605
+ * invoice's due date, or 60 days after being re-generated through the UI.
1478
1606
  */
1479
1607
  hosted_invoice_url: string | null;
1480
1608
 
@@ -1999,6 +2127,120 @@ export namespace InvoiceFetchUpcomingResponse {
1999
2127
  value: string;
2000
2128
  }
2001
2129
 
2130
+ export interface PercentageDiscount {
2131
+ /**
2132
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
2133
+ * this can be a subset of prices.
2134
+ */
2135
+ applies_to_price_ids: Array<string>;
2136
+
2137
+ discount_type: 'percentage';
2138
+
2139
+ /**
2140
+ * Only available if discount_type is `percentage`. This is a number between 0
2141
+ * and 1.
2142
+ */
2143
+ percentage_discount: number;
2144
+
2145
+ reason?: string | null;
2146
+ }
2147
+
2148
+ export interface AmountDiscount {
2149
+ /**
2150
+ * Only available if discount_type is `amount`.
2151
+ */
2152
+ amount_discount: string;
2153
+
2154
+ /**
2155
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
2156
+ * this can be a subset of prices.
2157
+ */
2158
+ applies_to_price_ids: Array<string>;
2159
+
2160
+ discount_type: 'amount';
2161
+
2162
+ reason?: string | null;
2163
+ }
2164
+
2165
+ export interface TrialDiscount {
2166
+ /**
2167
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
2168
+ * this can be a subset of prices.
2169
+ */
2170
+ applies_to_price_ids: Array<string>;
2171
+
2172
+ discount_type: 'trial';
2173
+
2174
+ reason?: string | null;
2175
+
2176
+ /**
2177
+ * Only available if discount_type is `trial`
2178
+ */
2179
+ trial_amount_discount?: string | null;
2180
+
2181
+ /**
2182
+ * Only available if discount_type is `trial`
2183
+ */
2184
+ trial_percentage_discount?: number | null;
2185
+ }
2186
+
2187
+ export interface PercentageDiscount {
2188
+ /**
2189
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
2190
+ * this can be a subset of prices.
2191
+ */
2192
+ applies_to_price_ids: Array<string>;
2193
+
2194
+ discount_type: 'percentage';
2195
+
2196
+ /**
2197
+ * Only available if discount_type is `percentage`. This is a number between 0
2198
+ * and 1.
2199
+ */
2200
+ percentage_discount: number;
2201
+
2202
+ reason?: string | null;
2203
+ }
2204
+
2205
+ export interface AmountDiscount {
2206
+ /**
2207
+ * Only available if discount_type is `amount`.
2208
+ */
2209
+ amount_discount: string;
2210
+
2211
+ /**
2212
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
2213
+ * this can be a subset of prices.
2214
+ */
2215
+ applies_to_price_ids: Array<string>;
2216
+
2217
+ discount_type: 'amount';
2218
+
2219
+ reason?: string | null;
2220
+ }
2221
+
2222
+ export interface TrialDiscount {
2223
+ /**
2224
+ * List of price_ids that this discount applies to. For plan/plan phase discounts,
2225
+ * this can be a subset of prices.
2226
+ */
2227
+ applies_to_price_ids: Array<string>;
2228
+
2229
+ discount_type: 'trial';
2230
+
2231
+ reason?: string | null;
2232
+
2233
+ /**
2234
+ * Only available if discount_type is `trial`
2235
+ */
2236
+ trial_amount_discount?: string | null;
2237
+
2238
+ /**
2239
+ * Only available if discount_type is `trial`
2240
+ */
2241
+ trial_percentage_discount?: number | null;
2242
+ }
2243
+
2002
2244
  export interface LineItem {
2003
2245
  /**
2004
2246
  * A unique ID for this line item.
@@ -103,8 +103,8 @@ export interface Plan {
103
103
  created_at: string;
104
104
 
105
105
  /**
106
- * An ISO 4217 currency string or custom pricing unit (`credits`) for this plan's
107
- * prices.
106
+ * @deprecated: An ISO 4217 currency string or custom pricing unit (`credits`) for
107
+ * this plan's prices.
108
108
  */
109
109
  currency: string;
110
110
 
@@ -93,11 +93,11 @@ export class Subscriptions extends APIResource {
93
93
  * "tiers": [
94
94
  * {
95
95
  * "first_unit":"1",
96
- * "last_unit": "10",
96
+ * "last_unit": "11",
97
97
  * "unit_amount": "0.50"
98
98
  * },
99
99
  * {
100
- * "first_unit": "10",
100
+ * "first_unit": "11",
101
101
  * "last_unit": null,
102
102
  * "unit_amount": "0.10"
103
103
  * }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '4.17.0'; // x-release-please-version
1
+ export const VERSION = '4.18.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.17.0";
1
+ export declare const VERSION = "4.18.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '4.17.0'; // x-release-please-version
4
+ exports.VERSION = '4.18.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '4.17.0'; // x-release-please-version
1
+ export const VERSION = '4.18.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map