orb-billing 4.51.0 → 4.53.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.
@@ -138,6 +138,42 @@ export class Customers extends APIResource {
138
138
  return this._client.get(`/customers/external_customer_id/${externalCustomerId}`, options);
139
139
  }
140
140
 
141
+ /**
142
+ * Sync Orb's payment methods for the customer with their gateway.
143
+ *
144
+ * This method can be called before taking an action that may cause the customer to
145
+ * be charged, ensuring that the most up-to-date payment method is charged.
146
+ *
147
+ * **Note**: This functionality is currently only available for Stripe.
148
+ */
149
+ syncPaymentMethodsFromGateway(
150
+ externalCustomerId: string,
151
+ options?: Core.RequestOptions,
152
+ ): Core.APIPromise<void> {
153
+ return this._client.post(
154
+ `/customers/external_customer_id/${externalCustomerId}/sync_payment_methods_from_gateway`,
155
+ { ...options, headers: { Accept: '*/*', ...options?.headers } },
156
+ );
157
+ }
158
+
159
+ /**
160
+ * Sync Orb's payment methods for the customer with their gateway.
161
+ *
162
+ * This method can be called before taking an action that may cause the customer to
163
+ * be charged, ensuring that the most up-to-date payment method is charged.
164
+ *
165
+ * **Note**: This functionality is currently only available for Stripe.
166
+ */
167
+ syncPaymentMethodsFromGatewayByExternalCustomerId(
168
+ customerId: string,
169
+ options?: Core.RequestOptions,
170
+ ): Core.APIPromise<void> {
171
+ return this._client.post(`/customers/${customerId}/sync_payment_methods_from_gateway`, {
172
+ ...options,
173
+ headers: { Accept: '*/*', ...options?.headers },
174
+ });
175
+ }
176
+
141
177
  /**
142
178
  * This endpoint is used to update customer details given an `external_customer_id`
143
179
  * (see [Customer ID Aliases](/events-and-metrics/customer-aliases)). Note that the
@@ -296,9 +296,10 @@ export interface Invoice {
296
296
  discounts: Array<Shared.InvoiceLevelDiscount>;
297
297
 
298
298
  /**
299
- * When the invoice payment is due.
299
+ * When the invoice payment is due. The due date is null if the invoice is not yet
300
+ * finalized.
300
301
  */
301
- due_date: string;
302
+ due_date: string | null;
302
303
 
303
304
  /**
304
305
  * If the invoice has a status of `draft`, this will be the time that the invoice
@@ -1286,9 +1287,10 @@ export interface InvoiceFetchUpcomingResponse {
1286
1287
  discounts: Array<Shared.InvoiceLevelDiscount>;
1287
1288
 
1288
1289
  /**
1289
- * When the invoice payment is due.
1290
+ * When the invoice payment is due. The due date is null if the invoice is not yet
1291
+ * finalized.
1290
1292
  */
1291
- due_date: string;
1293
+ due_date: string | null;
1292
1294
 
1293
1295
  /**
1294
1296
  * If the invoice has a status of `draft`, this will be the time that the invoice
@@ -2282,7 +2284,7 @@ export interface InvoiceIssueParams {
2282
2284
  /**
2283
2285
  * If true, the invoice will be issued synchronously. If false, the invoice will be
2284
2286
  * issued asynchronously. The synchronous option is only available for invoices
2285
- * containin no usage fees. If the invoice is configured to sync to an external
2287
+ * that have no usage fees. If the invoice is configured to sync to an external
2286
2288
  * provider, a successful response from this endpoint guarantees the invoice is
2287
2289
  * present in the provider.
2288
2290
  */
@@ -497,7 +497,7 @@ export interface PlanCreateParams {
497
497
  | PlanCreateParams.NewPlanMatrixWithDisplayNamePrice
498
498
  | PlanCreateParams.NewPlanBulkWithProrationPrice
499
499
  | PlanCreateParams.NewPlanGroupedTieredPackagePrice
500
- | PlanCreateParams.NewPlanMaxGroupTieredPrice
500
+ | PlanCreateParams.NewPlanMaxGroupTieredPackagePrice
501
501
  >;
502
502
 
503
503
  /**
@@ -3073,7 +3073,7 @@ export namespace PlanCreateParams {
3073
3073
  }
3074
3074
  }
3075
3075
 
3076
- export interface NewPlanMaxGroupTieredPrice {
3076
+ export interface NewPlanMaxGroupTieredPackagePrice {
3077
3077
  /**
3078
3078
  * The cadence to bill for this price on.
3079
3079
  */
@@ -3084,9 +3084,9 @@ export namespace PlanCreateParams {
3084
3084
  */
3085
3085
  item_id: string;
3086
3086
 
3087
- max_group_tiered_config: Record<string, unknown>;
3087
+ max_group_tiered_package_config: Record<string, unknown>;
3088
3088
 
3089
- model_type: 'max_group_tiered';
3089
+ model_type: 'max_group_tiered_package';
3090
3090
 
3091
3091
  /**
3092
3092
  * The name of the price.
@@ -3109,7 +3109,7 @@ export namespace PlanCreateParams {
3109
3109
  * For custom cadence: specifies the duration of the billing period in days or
3110
3110
  * months.
3111
3111
  */
3112
- billing_cycle_configuration?: NewPlanMaxGroupTieredPrice.BillingCycleConfiguration | null;
3112
+ billing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.BillingCycleConfiguration | null;
3113
3113
 
3114
3114
  /**
3115
3115
  * The per unit conversion rate of the price currency to the invoicing currency.
@@ -3142,7 +3142,7 @@ export namespace PlanCreateParams {
3142
3142
  * Within each billing cycle, specifies the cadence at which invoices are produced.
3143
3143
  * If unspecified, a single invoice is produced per billing cycle.
3144
3144
  */
3145
- invoicing_cycle_configuration?: NewPlanMaxGroupTieredPrice.InvoicingCycleConfiguration | null;
3145
+ invoicing_cycle_configuration?: NewPlanMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null;
3146
3146
 
3147
3147
  /**
3148
3148
  * User-specified key/value pairs for the resource. Individual keys can be removed
@@ -3152,7 +3152,7 @@ export namespace PlanCreateParams {
3152
3152
  metadata?: Record<string, string | null> | null;
3153
3153
  }
3154
3154
 
3155
- export namespace NewPlanMaxGroupTieredPrice {
3155
+ export namespace NewPlanMaxGroupTieredPackagePrice {
3156
3156
  /**
3157
3157
  * For custom cadence: specifies the duration of the billing period in days or
3158
3158
  * months.
@@ -147,7 +147,7 @@ export type Price =
147
147
  | Price.MatrixWithDisplayNamePrice
148
148
  | Price.BulkWithProrationPrice
149
149
  | Price.GroupedTieredPackagePrice
150
- | Price.MaxGroupTieredPrice;
150
+ | Price.MaxGroupTieredPackagePrice;
151
151
 
152
152
  export namespace Price {
153
153
  export interface UnitPrice {
@@ -2999,12 +2999,12 @@ export namespace Price {
2999
2999
  }
3000
3000
  }
3001
3001
 
3002
- export interface MaxGroupTieredPrice {
3002
+ export interface MaxGroupTieredPackagePrice {
3003
3003
  id: string;
3004
3004
 
3005
- billable_metric: MaxGroupTieredPrice.BillableMetric | null;
3005
+ billable_metric: MaxGroupTieredPackagePrice.BillableMetric | null;
3006
3006
 
3007
- billing_cycle_configuration: MaxGroupTieredPrice.BillingCycleConfiguration;
3007
+ billing_cycle_configuration: MaxGroupTieredPackagePrice.BillingCycleConfiguration;
3008
3008
 
3009
3009
  cadence: 'one_time' | 'monthly' | 'quarterly' | 'semi_annual' | 'annual' | 'custom';
3010
3010
 
@@ -3012,7 +3012,7 @@ export namespace Price {
3012
3012
 
3013
3013
  created_at: string;
3014
3014
 
3015
- credit_allocation: MaxGroupTieredPrice.CreditAllocation | null;
3015
+ credit_allocation: MaxGroupTieredPackagePrice.CreditAllocation | null;
3016
3016
 
3017
3017
  currency: string;
3018
3018
 
@@ -3022,13 +3022,13 @@ export namespace Price {
3022
3022
 
3023
3023
  fixed_price_quantity: number | null;
3024
3024
 
3025
- invoicing_cycle_configuration: MaxGroupTieredPrice.InvoicingCycleConfiguration | null;
3025
+ invoicing_cycle_configuration: MaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null;
3026
3026
 
3027
- item: MaxGroupTieredPrice.Item;
3027
+ item: MaxGroupTieredPackagePrice.Item;
3028
3028
 
3029
- max_group_tiered_config: Record<string, unknown>;
3029
+ max_group_tiered_package_config: Record<string, unknown>;
3030
3030
 
3031
- maximum: MaxGroupTieredPrice.Maximum | null;
3031
+ maximum: MaxGroupTieredPackagePrice.Maximum | null;
3032
3032
 
3033
3033
  maximum_amount: string | null;
3034
3034
 
@@ -3040,11 +3040,11 @@ export namespace Price {
3040
3040
  */
3041
3041
  metadata: Record<string, string>;
3042
3042
 
3043
- minimum: MaxGroupTieredPrice.Minimum | null;
3043
+ minimum: MaxGroupTieredPackagePrice.Minimum | null;
3044
3044
 
3045
3045
  minimum_amount: string | null;
3046
3046
 
3047
- model_type: 'max_group_tiered';
3047
+ model_type: 'max_group_tiered_package';
3048
3048
 
3049
3049
  name: string;
3050
3050
 
@@ -3053,7 +3053,7 @@ export namespace Price {
3053
3053
  price_type: 'usage_price' | 'fixed_price';
3054
3054
  }
3055
3055
 
3056
- export namespace MaxGroupTieredPrice {
3056
+ export namespace MaxGroupTieredPackagePrice {
3057
3057
  export interface BillableMetric {
3058
3058
  id: string;
3059
3059
  }
@@ -3127,7 +3127,7 @@ export type PriceCreateParams =
3127
3127
  | PriceCreateParams.NewFloatingThresholdTotalAmountPrice
3128
3128
  | PriceCreateParams.NewFloatingTieredPackagePrice
3129
3129
  | PriceCreateParams.NewFloatingGroupedTieredPrice
3130
- | PriceCreateParams.NewFloatingMaxGroupTieredPrice
3130
+ | PriceCreateParams.NewFloatingMaxGroupTieredPackagePrice
3131
3131
  | PriceCreateParams.NewFloatingTieredWithMinimumPrice
3132
3132
  | PriceCreateParams.NewFloatingPackageWithAllocationPrice
3133
3133
  | PriceCreateParams.NewFloatingTieredPackageWithMinimumPrice
@@ -4695,7 +4695,7 @@ export declare namespace PriceCreateParams {
4695
4695
  }
4696
4696
  }
4697
4697
 
4698
- export interface NewFloatingMaxGroupTieredPrice {
4698
+ export interface NewFloatingMaxGroupTieredPackagePrice {
4699
4699
  /**
4700
4700
  * The cadence to bill for this price on.
4701
4701
  */
@@ -4711,9 +4711,9 @@ export declare namespace PriceCreateParams {
4711
4711
  */
4712
4712
  item_id: string;
4713
4713
 
4714
- max_group_tiered_config: Record<string, unknown>;
4714
+ max_group_tiered_package_config: Record<string, unknown>;
4715
4715
 
4716
- model_type: 'max_group_tiered';
4716
+ model_type: 'max_group_tiered_package';
4717
4717
 
4718
4718
  /**
4719
4719
  * The name of the price.
@@ -4736,7 +4736,7 @@ export declare namespace PriceCreateParams {
4736
4736
  * For custom cadence: specifies the duration of the billing period in days or
4737
4737
  * months.
4738
4738
  */
4739
- billing_cycle_configuration?: PriceCreateParams.NewFloatingMaxGroupTieredPrice.BillingCycleConfiguration | null;
4739
+ billing_cycle_configuration?: PriceCreateParams.NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null;
4740
4740
 
4741
4741
  /**
4742
4742
  * The per unit conversion rate of the price currency to the invoicing currency.
@@ -4763,7 +4763,7 @@ export declare namespace PriceCreateParams {
4763
4763
  * Within each billing cycle, specifies the cadence at which invoices are produced.
4764
4764
  * If unspecified, a single invoice is produced per billing cycle.
4765
4765
  */
4766
- invoicing_cycle_configuration?: PriceCreateParams.NewFloatingMaxGroupTieredPrice.InvoicingCycleConfiguration | null;
4766
+ invoicing_cycle_configuration?: PriceCreateParams.NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null;
4767
4767
 
4768
4768
  /**
4769
4769
  * User-specified key/value pairs for the resource. Individual keys can be removed
@@ -4773,7 +4773,7 @@ export declare namespace PriceCreateParams {
4773
4773
  metadata?: Record<string, string | null> | null;
4774
4774
  }
4775
4775
 
4776
- export namespace NewFloatingMaxGroupTieredPrice {
4776
+ export namespace NewFloatingMaxGroupTieredPackagePrice {
4777
4777
  /**
4778
4778
  * For custom cadence: specifies the duration of the billing period in days or
4779
4779
  * months.
@@ -13351,7 +13351,7 @@ export namespace SubscriptionPriceIntervalsParams {
13351
13351
  | Add.NewFloatingThresholdTotalAmountPrice
13352
13352
  | Add.NewFloatingTieredPackagePrice
13353
13353
  | Add.NewFloatingGroupedTieredPrice
13354
- | Add.NewFloatingMaxGroupTieredPrice
13354
+ | Add.NewFloatingMaxGroupTieredPackagePrice
13355
13355
  | Add.NewFloatingTieredWithMinimumPrice
13356
13356
  | Add.NewFloatingPackageWithAllocationPrice
13357
13357
  | Add.NewFloatingTieredPackageWithMinimumPrice
@@ -14994,7 +14994,7 @@ export namespace SubscriptionPriceIntervalsParams {
14994
14994
  }
14995
14995
  }
14996
14996
 
14997
- export interface NewFloatingMaxGroupTieredPrice {
14997
+ export interface NewFloatingMaxGroupTieredPackagePrice {
14998
14998
  /**
14999
14999
  * The cadence to bill for this price on.
15000
15000
  */
@@ -15010,9 +15010,9 @@ export namespace SubscriptionPriceIntervalsParams {
15010
15010
  */
15011
15011
  item_id: string;
15012
15012
 
15013
- max_group_tiered_config: Record<string, unknown>;
15013
+ max_group_tiered_package_config: Record<string, unknown>;
15014
15014
 
15015
- model_type: 'max_group_tiered';
15015
+ model_type: 'max_group_tiered_package';
15016
15016
 
15017
15017
  /**
15018
15018
  * The name of the price.
@@ -15035,7 +15035,7 @@ export namespace SubscriptionPriceIntervalsParams {
15035
15035
  * For custom cadence: specifies the duration of the billing period in days or
15036
15036
  * months.
15037
15037
  */
15038
- billing_cycle_configuration?: NewFloatingMaxGroupTieredPrice.BillingCycleConfiguration | null;
15038
+ billing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.BillingCycleConfiguration | null;
15039
15039
 
15040
15040
  /**
15041
15041
  * The per unit conversion rate of the price currency to the invoicing currency.
@@ -15062,7 +15062,7 @@ export namespace SubscriptionPriceIntervalsParams {
15062
15062
  * Within each billing cycle, specifies the cadence at which invoices are produced.
15063
15063
  * If unspecified, a single invoice is produced per billing cycle.
15064
15064
  */
15065
- invoicing_cycle_configuration?: NewFloatingMaxGroupTieredPrice.InvoicingCycleConfiguration | null;
15065
+ invoicing_cycle_configuration?: NewFloatingMaxGroupTieredPackagePrice.InvoicingCycleConfiguration | null;
15066
15066
 
15067
15067
  /**
15068
15068
  * User-specified key/value pairs for the resource. Individual keys can be removed
@@ -15072,7 +15072,7 @@ export namespace SubscriptionPriceIntervalsParams {
15072
15072
  metadata?: Record<string, string | null> | null;
15073
15073
  }
15074
15074
 
15075
- export namespace NewFloatingMaxGroupTieredPrice {
15075
+ export namespace NewFloatingMaxGroupTieredPackagePrice {
15076
15076
  /**
15077
15077
  * For custom cadence: specifies the duration of the billing period in days or
15078
15078
  * months.
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '4.51.0'; // x-release-please-version
1
+ export const VERSION = '4.53.0'; // x-release-please-version
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "4.51.0";
1
+ export declare const VERSION = "4.53.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.51.0'; // x-release-please-version
4
+ exports.VERSION = '4.53.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '4.51.0'; // x-release-please-version
1
+ export const VERSION = '4.53.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map