orb-billing 5.6.0 → 5.8.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.
Files changed (60) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/core.js +3 -3
  3. package/core.js.map +1 -1
  4. package/core.mjs +3 -3
  5. package/core.mjs.map +1 -1
  6. package/index.d.mts +2 -4
  7. package/index.d.ts +2 -4
  8. package/index.d.ts.map +1 -1
  9. package/index.js.map +1 -1
  10. package/index.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/beta/beta.d.ts +288 -10
  13. package/resources/beta/beta.d.ts.map +1 -1
  14. package/resources/beta/beta.js.map +1 -1
  15. package/resources/beta/beta.mjs.map +1 -1
  16. package/resources/beta/external-plan-id.d.ts +288 -10
  17. package/resources/beta/external-plan-id.d.ts.map +1 -1
  18. package/resources/customers/customers.d.ts +27 -6
  19. package/resources/customers/customers.d.ts.map +1 -1
  20. package/resources/customers/customers.js.map +1 -1
  21. package/resources/customers/customers.mjs.map +1 -1
  22. package/resources/index.d.ts +1 -1
  23. package/resources/index.d.ts.map +1 -1
  24. package/resources/index.js.map +1 -1
  25. package/resources/index.mjs.map +1 -1
  26. package/resources/invoices.d.ts +3 -0
  27. package/resources/invoices.d.ts.map +1 -1
  28. package/resources/invoices.js.map +1 -1
  29. package/resources/invoices.mjs.map +1 -1
  30. package/resources/plans/plans.d.ts +144 -5
  31. package/resources/plans/plans.d.ts.map +1 -1
  32. package/resources/plans/plans.js.map +1 -1
  33. package/resources/plans/plans.mjs.map +1 -1
  34. package/resources/prices/prices.d.ts +926 -123
  35. package/resources/prices/prices.d.ts.map +1 -1
  36. package/resources/prices/prices.js.map +1 -1
  37. package/resources/prices/prices.mjs.map +1 -1
  38. package/resources/shared.d.ts +2474 -338
  39. package/resources/shared.d.ts.map +1 -1
  40. package/resources/shared.js.map +1 -1
  41. package/resources/shared.mjs.map +1 -1
  42. package/resources/subscriptions.d.ts +1369 -174
  43. package/resources/subscriptions.d.ts.map +1 -1
  44. package/resources/subscriptions.js.map +1 -1
  45. package/resources/subscriptions.mjs.map +1 -1
  46. package/src/core.ts +3 -3
  47. package/src/index.ts +0 -4
  48. package/src/resources/beta/beta.ts +348 -20
  49. package/src/resources/beta/external-plan-id.ts +348 -20
  50. package/src/resources/customers/customers.ts +48 -6
  51. package/src/resources/index.ts +0 -1
  52. package/src/resources/invoices.ts +3 -0
  53. package/src/resources/plans/plans.ts +174 -10
  54. package/src/resources/prices/prices.ts +1060 -113
  55. package/src/resources/shared.ts +2792 -288
  56. package/src/resources/subscriptions.ts +1609 -202
  57. package/src/version.ts +1 -1
  58. package/version.d.ts +1 -1
  59. package/version.js +1 -1
  60. package/version.mjs +1 -1
@@ -320,53 +320,190 @@ export namespace PlanCreateParams {
320
320
  plan_phase_order?: number | null;
321
321
 
322
322
  /**
323
- * The price to add to the plan
323
+ * New plan price request body params.
324
324
  */
325
325
  price?:
326
326
  | Shared.NewPlanUnitPrice
327
- | Shared.NewPlanPackagePrice
328
- | Shared.NewPlanMatrixPrice
329
327
  | Shared.NewPlanTieredPrice
330
328
  | Shared.NewPlanBulkPrice
329
+ | Shared.NewPlanPackagePrice
330
+ | Shared.NewPlanMatrixPrice
331
331
  | Shared.NewPlanThresholdTotalAmountPrice
332
332
  | Shared.NewPlanTieredPackagePrice
333
333
  | Shared.NewPlanTieredWithMinimumPrice
334
- | Shared.NewPlanUnitWithPercentPrice
334
+ | Shared.NewPlanGroupedTieredPrice
335
+ | Shared.NewPlanTieredPackageWithMinimumPrice
335
336
  | Shared.NewPlanPackageWithAllocationPrice
336
- | Shared.NewPlanTierWithProrationPrice
337
+ | Shared.NewPlanUnitWithPercentPrice
338
+ | Shared.NewPlanMatrixWithAllocationPrice
339
+ | Price.NewPlanTieredWithProrationPrice
337
340
  | Shared.NewPlanUnitWithProrationPrice
338
341
  | Shared.NewPlanGroupedAllocationPrice
342
+ | Shared.NewPlanBulkWithProrationPrice
339
343
  | Shared.NewPlanGroupedWithProratedMinimumPrice
340
344
  | Shared.NewPlanGroupedWithMeteredMinimumPrice
341
345
  | Price.NewPlanGroupedWithMinMaxThresholdsPrice
342
346
  | Shared.NewPlanMatrixWithDisplayNamePrice
343
- | Shared.NewPlanBulkWithProrationPrice
344
347
  | Shared.NewPlanGroupedTieredPackagePrice
345
348
  | Shared.NewPlanMaxGroupTieredPackagePrice
346
349
  | Shared.NewPlanScalableMatrixWithUnitPricingPrice
347
350
  | Shared.NewPlanScalableMatrixWithTieredPricingPrice
348
351
  | Shared.NewPlanCumulativeGroupedBulkPrice
349
- | Shared.NewPlanTieredPackageWithMinimumPrice
350
- | Shared.NewPlanMatrixWithAllocationPrice
351
- | Shared.NewPlanGroupedTieredPrice
352
352
  | Shared.NewPlanMinimumCompositePrice
353
353
  | null;
354
354
  }
355
355
 
356
356
  export namespace Price {
357
+ export interface NewPlanTieredWithProrationPrice {
358
+ /**
359
+ * The cadence to bill for this price on.
360
+ */
361
+ cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
362
+
363
+ /**
364
+ * The id of the item the price will be associated with.
365
+ */
366
+ item_id: string;
367
+
368
+ /**
369
+ * The pricing model type
370
+ */
371
+ model_type: 'tiered_with_proration';
372
+
373
+ /**
374
+ * The name of the price.
375
+ */
376
+ name: string;
377
+
378
+ /**
379
+ * Configuration for tiered_with_proration pricing
380
+ */
381
+ tiered_with_proration_config: NewPlanTieredWithProrationPrice.TieredWithProrationConfig;
382
+
383
+ /**
384
+ * The id of the billable metric for the price. Only needed if the price is
385
+ * usage-based.
386
+ */
387
+ billable_metric_id?: string | null;
388
+
389
+ /**
390
+ * If the Price represents a fixed cost, the price will be billed in-advance if
391
+ * this is true, and in-arrears if this is false.
392
+ */
393
+ billed_in_advance?: boolean | null;
394
+
395
+ /**
396
+ * For custom cadence: specifies the duration of the billing period in days or
397
+ * months.
398
+ */
399
+ billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
400
+
401
+ /**
402
+ * The per unit conversion rate of the price currency to the invoicing currency.
403
+ */
404
+ conversion_rate?: number | null;
405
+
406
+ /**
407
+ * The configuration for the rate of the price currency to the invoicing currency.
408
+ */
409
+ conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
410
+
411
+ /**
412
+ * An ISO 4217 currency string, or custom pricing unit identifier, in which this
413
+ * price is billed.
414
+ */
415
+ currency?: string | null;
416
+
417
+ /**
418
+ * For dimensional price: specifies a price group and dimension values
419
+ */
420
+ dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
421
+
422
+ /**
423
+ * An alias for the price.
424
+ */
425
+ external_price_id?: string | null;
426
+
427
+ /**
428
+ * If the Price represents a fixed cost, this represents the quantity of units
429
+ * applied.
430
+ */
431
+ fixed_price_quantity?: number | null;
432
+
433
+ /**
434
+ * The property used to group this price on an invoice
435
+ */
436
+ invoice_grouping_key?: string | null;
437
+
438
+ /**
439
+ * Within each billing cycle, specifies the cadence at which invoices are produced.
440
+ * If unspecified, a single invoice is produced per billing cycle.
441
+ */
442
+ invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
443
+
444
+ /**
445
+ * User-specified key/value pairs for the resource. Individual keys can be removed
446
+ * by setting the value to `null`, and the entire metadata mapping can be cleared
447
+ * by setting `metadata` to `null`.
448
+ */
449
+ metadata?: { [key: string]: string | null } | null;
450
+
451
+ /**
452
+ * A transient ID that can be used to reference this price when adding adjustments
453
+ * in the same API call.
454
+ */
455
+ reference_id?: string | null;
456
+ }
457
+
458
+ export namespace NewPlanTieredWithProrationPrice {
459
+ /**
460
+ * Configuration for tiered_with_proration pricing
461
+ */
462
+ export interface TieredWithProrationConfig {
463
+ /**
464
+ * Tiers for rating based on total usage quantities into the specified tier with
465
+ * proration
466
+ */
467
+ tiers: Array<TieredWithProrationConfig.Tier>;
468
+ }
469
+
470
+ export namespace TieredWithProrationConfig {
471
+ /**
472
+ * Configuration for a single tiered with proration tier
473
+ */
474
+ export interface Tier {
475
+ /**
476
+ * Inclusive tier starting value
477
+ */
478
+ tier_lower_bound: string;
479
+
480
+ /**
481
+ * Amount per unit
482
+ */
483
+ unit_amount: string;
484
+ }
485
+ }
486
+ }
487
+
357
488
  export interface NewPlanGroupedWithMinMaxThresholdsPrice {
358
489
  /**
359
490
  * The cadence to bill for this price on.
360
491
  */
361
492
  cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
362
493
 
363
- grouped_with_min_max_thresholds_config: { [key: string]: unknown };
494
+ /**
495
+ * Configuration for grouped_with_min_max_thresholds pricing
496
+ */
497
+ grouped_with_min_max_thresholds_config: NewPlanGroupedWithMinMaxThresholdsPrice.GroupedWithMinMaxThresholdsConfig;
364
498
 
365
499
  /**
366
500
  * The id of the item the price will be associated with.
367
501
  */
368
502
  item_id: string;
369
503
 
504
+ /**
505
+ * The pricing model type
506
+ */
370
507
  model_type: 'grouped_with_min_max_thresholds';
371
508
 
372
509
  /**
@@ -448,6 +585,33 @@ export namespace PlanCreateParams {
448
585
  */
449
586
  reference_id?: string | null;
450
587
  }
588
+
589
+ export namespace NewPlanGroupedWithMinMaxThresholdsPrice {
590
+ /**
591
+ * Configuration for grouped_with_min_max_thresholds pricing
592
+ */
593
+ export interface GroupedWithMinMaxThresholdsConfig {
594
+ /**
595
+ * The event property used to group before applying thresholds
596
+ */
597
+ grouping_key: string;
598
+
599
+ /**
600
+ * The maximum amount to charge each group
601
+ */
602
+ maximum_charge: string;
603
+
604
+ /**
605
+ * The minimum amount to charge each group, regardless of usage
606
+ */
607
+ minimum_charge: string;
608
+
609
+ /**
610
+ * The base price charged per group
611
+ */
612
+ per_unit_rate: string;
613
+ }
614
+ }
451
615
  }
452
616
 
453
617
  export interface Adjustment {