orb-billing 5.5.1 → 5.6.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.
- package/CHANGELOG.md +14 -0
- package/index.d.mts +4 -13
- package/index.d.ts +4 -13
- package/index.d.ts.map +1 -1
- package/index.js.map +1 -1
- package/index.mjs.map +1 -1
- package/package.json +4 -1
- package/resources/alerts.d.ts +1 -1
- package/resources/beta/beta.d.ts +168 -2
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/external-plan-id.d.ts +168 -2
- package/resources/beta/external-plan-id.d.ts.map +1 -1
- package/resources/customers/balance-transactions.d.ts +2 -2
- package/resources/customers/balance-transactions.d.ts.map +1 -1
- package/resources/customers/balance-transactions.js.map +1 -1
- package/resources/customers/balance-transactions.mjs.map +1 -1
- package/resources/customers/credits/ledger.d.ts +22 -8
- package/resources/customers/credits/ledger.d.ts.map +1 -1
- package/resources/customers/credits/ledger.js.map +1 -1
- package/resources/customers/credits/ledger.mjs.map +1 -1
- package/resources/customers/customers.d.ts +27 -0
- package/resources/customers/customers.d.ts.map +1 -1
- package/resources/customers/customers.js.map +1 -1
- package/resources/customers/customers.mjs.map +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.d.ts +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.js +1 -1
- package/resources/dimensional-price-groups/dimensional-price-groups.mjs +1 -1
- package/resources/events/backfills.d.ts +2 -2
- package/resources/events/backfills.js +2 -2
- package/resources/events/backfills.mjs +2 -2
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoice-line-items.d.ts +1 -1
- package/resources/invoices.d.ts +36 -11
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +4 -4
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +4 -4
- package/resources/invoices.mjs.map +1 -1
- package/resources/plans/plans.d.ts +84 -1
- package/resources/plans/plans.d.ts.map +1 -1
- package/resources/plans/plans.js.map +1 -1
- package/resources/plans/plans.mjs.map +1 -1
- package/resources/prices/prices.d.ts +262 -166
- package/resources/prices/prices.d.ts.map +1 -1
- package/resources/prices/prices.js.map +1 -1
- package/resources/prices/prices.mjs.map +1 -1
- package/resources/shared.d.ts +216 -615
- package/resources/shared.d.ts.map +1 -1
- package/resources/shared.js.map +1 -1
- package/resources/shared.mjs.map +1 -1
- package/resources/subscriptions.d.ts +460 -192
- package/resources/subscriptions.d.ts.map +1 -1
- package/resources/subscriptions.js +1 -1
- package/resources/subscriptions.js.map +1 -1
- package/resources/subscriptions.mjs +1 -1
- package/resources/subscriptions.mjs.map +1 -1
- package/src/index.ts +5 -17
- package/src/resources/alerts.ts +1 -1
- package/src/resources/beta/beta.ts +198 -6
- package/src/resources/beta/external-plan-id.ts +198 -6
- package/src/resources/customers/balance-transactions.ts +4 -2
- package/src/resources/customers/credits/ledger.ts +24 -8
- package/src/resources/customers/customers.ts +31 -0
- package/src/resources/dimensional-price-groups/dimensional-price-groups.ts +1 -1
- package/src/resources/events/backfills.ts +2 -2
- package/src/resources/index.ts +1 -3
- package/src/resources/invoice-line-items.ts +1 -1
- package/src/resources/invoices.ts +41 -11
- package/src/resources/plans/plans.ts +99 -3
- package/src/resources/prices/prices.ts +283 -179
- package/src/resources/shared.ts +260 -747
- package/src/resources/subscriptions.ts +540 -238
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -136,7 +136,7 @@ export interface InvoiceLineItemCreateResponse {
|
|
|
136
136
|
sub_line_items: Array<Shared.MatrixSubLineItem | Shared.TierSubLineItem | Shared.OtherSubLineItem>;
|
|
137
137
|
|
|
138
138
|
/**
|
|
139
|
-
* The line amount before
|
|
139
|
+
* The line amount before any adjustments.
|
|
140
140
|
*/
|
|
141
141
|
subtotal: string;
|
|
142
142
|
|
|
@@ -107,8 +107,8 @@ export class Invoices extends APIResource {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* This endpoint allows an invoice's status to be set the `paid` status. This
|
|
111
|
-
* only be done to invoices that are in the `issued` status.
|
|
110
|
+
* This endpoint allows an invoice's status to be set to the `paid` status. This
|
|
111
|
+
* can only be done to invoices that are in the `issued` or `synced` status.
|
|
112
112
|
*/
|
|
113
113
|
markPaid(
|
|
114
114
|
invoiceId: string,
|
|
@@ -127,8 +127,8 @@ export class Invoices extends APIResource {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
|
-
* This endpoint allows an invoice's status to be set the `void` status. This
|
|
131
|
-
* only be done to invoices that are in the `issued` status.
|
|
130
|
+
* This endpoint allows an invoice's status to be set to the `void` status. This
|
|
131
|
+
* can only be done to invoices that are in the `issued` status.
|
|
132
132
|
*
|
|
133
133
|
* If the associated invoice has used the customer balance to change the amount
|
|
134
134
|
* due, the customer balance operation will be reverted. For example, if the
|
|
@@ -543,7 +543,8 @@ export namespace InvoiceFetchUpcomingResponse {
|
|
|
543
543
|
| 'credit_note_applied'
|
|
544
544
|
| 'credit_note_voided'
|
|
545
545
|
| 'overpayment_refund'
|
|
546
|
-
| 'external_payment'
|
|
546
|
+
| 'external_payment'
|
|
547
|
+
| 'small_invoice_carryover';
|
|
547
548
|
|
|
548
549
|
/**
|
|
549
550
|
* The value of the amount changed in the transaction.
|
|
@@ -698,7 +699,7 @@ export namespace InvoiceFetchUpcomingResponse {
|
|
|
698
699
|
sub_line_items: Array<Shared.MatrixSubLineItem | Shared.TierSubLineItem | Shared.OtherSubLineItem>;
|
|
699
700
|
|
|
700
701
|
/**
|
|
701
|
-
* The line amount before
|
|
702
|
+
* The line amount before any adjustments.
|
|
702
703
|
*/
|
|
703
704
|
subtotal: string;
|
|
704
705
|
|
|
@@ -740,6 +741,12 @@ export namespace InvoiceFetchUpcomingResponse {
|
|
|
740
741
|
*/
|
|
741
742
|
payment_provider_id: string | null;
|
|
742
743
|
|
|
744
|
+
/**
|
|
745
|
+
* URL to the downloadable PDF version of the receipt. This field will be `null`
|
|
746
|
+
* for payment attempts that did not succeed.
|
|
747
|
+
*/
|
|
748
|
+
receipt_pdf: string | null;
|
|
749
|
+
|
|
743
750
|
/**
|
|
744
751
|
* Whether the payment attempt succeeded.
|
|
745
752
|
*/
|
|
@@ -773,6 +780,12 @@ export interface InvoiceCreateParams {
|
|
|
773
780
|
*/
|
|
774
781
|
discount?: Shared.Discount | null;
|
|
775
782
|
|
|
783
|
+
/**
|
|
784
|
+
* An optional custom due date for the invoice. If not set, the due date will be
|
|
785
|
+
* calculated based on the `net_terms` value.
|
|
786
|
+
*/
|
|
787
|
+
due_date?: (string & {}) | (string & {}) | null;
|
|
788
|
+
|
|
776
789
|
/**
|
|
777
790
|
* The `external_customer_id` of the `Customer` to create this invoice for. One of
|
|
778
791
|
* `customer_id` and `external_customer_id` are required.
|
|
@@ -780,7 +793,8 @@ export interface InvoiceCreateParams {
|
|
|
780
793
|
external_customer_id?: string | null;
|
|
781
794
|
|
|
782
795
|
/**
|
|
783
|
-
* An optional memo to attach to the invoice.
|
|
796
|
+
* An optional memo to attach to the invoice. If no memo is provided, we will
|
|
797
|
+
* attach the default memo
|
|
784
798
|
*/
|
|
785
799
|
memo?: string | null;
|
|
786
800
|
|
|
@@ -792,10 +806,11 @@ export interface InvoiceCreateParams {
|
|
|
792
806
|
metadata?: { [key: string]: string | null } | null;
|
|
793
807
|
|
|
794
808
|
/**
|
|
795
|
-
*
|
|
796
|
-
*
|
|
797
|
-
*
|
|
798
|
-
* 30
|
|
809
|
+
* The net terms determines the due date of the invoice. Due date is calculated
|
|
810
|
+
* based on the invoice or issuance date, depending on the account's configured due
|
|
811
|
+
* date calculation method. A value of '0' here represents that the invoice is due
|
|
812
|
+
* on issue, whereas a value of '30' represents that the customer has 30 days to
|
|
813
|
+
* pay the invoice. Do not set this field if you want to set a custom due date.
|
|
799
814
|
*/
|
|
800
815
|
net_terms?: number | null;
|
|
801
816
|
|
|
@@ -838,12 +853,27 @@ export namespace InvoiceCreateParams {
|
|
|
838
853
|
}
|
|
839
854
|
|
|
840
855
|
export interface InvoiceUpdateParams {
|
|
856
|
+
/**
|
|
857
|
+
* An optional custom due date for the invoice. If not set, the due date will be
|
|
858
|
+
* calculated based on the `net_terms` value.
|
|
859
|
+
*/
|
|
860
|
+
due_date?: (string & {}) | (string & {}) | null;
|
|
861
|
+
|
|
841
862
|
/**
|
|
842
863
|
* User-specified key/value pairs for the resource. Individual keys can be removed
|
|
843
864
|
* by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
844
865
|
* by setting `metadata` to `null`.
|
|
845
866
|
*/
|
|
846
867
|
metadata?: { [key: string]: string | null } | null;
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* The net terms determines the due date of the invoice. Due date is calculated
|
|
871
|
+
* based on the invoice or issuance date, depending on the account's configured due
|
|
872
|
+
* date calculation method. A value of '0' here represents that the invoice is due
|
|
873
|
+
* on issue, whereas a value of '30' represents that the customer has 30 days to
|
|
874
|
+
* pay the invoice. Do not set this field if you want to set a custom due date.
|
|
875
|
+
*/
|
|
876
|
+
net_terms?: number | null;
|
|
847
877
|
}
|
|
848
878
|
|
|
849
879
|
export interface InvoiceListParams extends PageParams {
|
|
@@ -327,9 +327,6 @@ export namespace PlanCreateParams {
|
|
|
327
327
|
| Shared.NewPlanPackagePrice
|
|
328
328
|
| Shared.NewPlanMatrixPrice
|
|
329
329
|
| Shared.NewPlanTieredPrice
|
|
330
|
-
| Shared.NewPlanTieredBPSPrice
|
|
331
|
-
| Shared.NewPlanBPSPrice
|
|
332
|
-
| Shared.NewPlanBulkBPSPrice
|
|
333
330
|
| Shared.NewPlanBulkPrice
|
|
334
331
|
| Shared.NewPlanThresholdTotalAmountPrice
|
|
335
332
|
| Shared.NewPlanTieredPackagePrice
|
|
@@ -341,6 +338,7 @@ export namespace PlanCreateParams {
|
|
|
341
338
|
| Shared.NewPlanGroupedAllocationPrice
|
|
342
339
|
| Shared.NewPlanGroupedWithProratedMinimumPrice
|
|
343
340
|
| Shared.NewPlanGroupedWithMeteredMinimumPrice
|
|
341
|
+
| Price.NewPlanGroupedWithMinMaxThresholdsPrice
|
|
344
342
|
| Shared.NewPlanMatrixWithDisplayNamePrice
|
|
345
343
|
| Shared.NewPlanBulkWithProrationPrice
|
|
346
344
|
| Shared.NewPlanGroupedTieredPackagePrice
|
|
@@ -351,9 +349,107 @@ export namespace PlanCreateParams {
|
|
|
351
349
|
| Shared.NewPlanTieredPackageWithMinimumPrice
|
|
352
350
|
| Shared.NewPlanMatrixWithAllocationPrice
|
|
353
351
|
| Shared.NewPlanGroupedTieredPrice
|
|
352
|
+
| Shared.NewPlanMinimumCompositePrice
|
|
354
353
|
| null;
|
|
355
354
|
}
|
|
356
355
|
|
|
356
|
+
export namespace Price {
|
|
357
|
+
export interface NewPlanGroupedWithMinMaxThresholdsPrice {
|
|
358
|
+
/**
|
|
359
|
+
* The cadence to bill for this price on.
|
|
360
|
+
*/
|
|
361
|
+
cadence: 'annual' | 'semi_annual' | 'monthly' | 'quarterly' | 'one_time' | 'custom';
|
|
362
|
+
|
|
363
|
+
grouped_with_min_max_thresholds_config: { [key: string]: unknown };
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* The id of the item the price will be associated with.
|
|
367
|
+
*/
|
|
368
|
+
item_id: string;
|
|
369
|
+
|
|
370
|
+
model_type: 'grouped_with_min_max_thresholds';
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* The name of the price.
|
|
374
|
+
*/
|
|
375
|
+
name: string;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* The id of the billable metric for the price. Only needed if the price is
|
|
379
|
+
* usage-based.
|
|
380
|
+
*/
|
|
381
|
+
billable_metric_id?: string | null;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* If the Price represents a fixed cost, the price will be billed in-advance if
|
|
385
|
+
* this is true, and in-arrears if this is false.
|
|
386
|
+
*/
|
|
387
|
+
billed_in_advance?: boolean | null;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* For custom cadence: specifies the duration of the billing period in days or
|
|
391
|
+
* months.
|
|
392
|
+
*/
|
|
393
|
+
billing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* The per unit conversion rate of the price currency to the invoicing currency.
|
|
397
|
+
*/
|
|
398
|
+
conversion_rate?: number | null;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* The configuration for the rate of the price currency to the invoicing currency.
|
|
402
|
+
*/
|
|
403
|
+
conversion_rate_config?: Shared.UnitConversionRateConfig | Shared.TieredConversionRateConfig | null;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* An ISO 4217 currency string, or custom pricing unit identifier, in which this
|
|
407
|
+
* price is billed.
|
|
408
|
+
*/
|
|
409
|
+
currency?: string | null;
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* For dimensional price: specifies a price group and dimension values
|
|
413
|
+
*/
|
|
414
|
+
dimensional_price_configuration?: Shared.NewDimensionalPriceConfiguration | null;
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* An alias for the price.
|
|
418
|
+
*/
|
|
419
|
+
external_price_id?: string | null;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* If the Price represents a fixed cost, this represents the quantity of units
|
|
423
|
+
* applied.
|
|
424
|
+
*/
|
|
425
|
+
fixed_price_quantity?: number | null;
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* The property used to group this price on an invoice
|
|
429
|
+
*/
|
|
430
|
+
invoice_grouping_key?: string | null;
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Within each billing cycle, specifies the cadence at which invoices are produced.
|
|
434
|
+
* If unspecified, a single invoice is produced per billing cycle.
|
|
435
|
+
*/
|
|
436
|
+
invoicing_cycle_configuration?: Shared.NewBillingCycleConfiguration | null;
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* User-specified key/value pairs for the resource. Individual keys can be removed
|
|
440
|
+
* by setting the value to `null`, and the entire metadata mapping can be cleared
|
|
441
|
+
* by setting `metadata` to `null`.
|
|
442
|
+
*/
|
|
443
|
+
metadata?: { [key: string]: string | null } | null;
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* A transient ID that can be used to reference this price when adding adjustments
|
|
447
|
+
* in the same API call.
|
|
448
|
+
*/
|
|
449
|
+
reference_id?: string | null;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
357
453
|
export interface Adjustment {
|
|
358
454
|
/**
|
|
359
455
|
* The definition of a new adjustment to create and add to the plan.
|