@openmeter/client 1.0.0-beta-32aecbad2ac6 → 1.0.0-beta-8b2581c1dca5
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/dist/index.d.ts +1 -1
- package/dist/lib/version.d.ts +1 -1
- package/dist/lib/version.js +1 -1
- package/dist/models/schemas.d.ts +78869 -37373
- package/dist/models/schemas.js +3713 -469
- package/dist/models/types.d.ts +1953 -241
- package/package.json +1 -1
package/dist/models/types.d.ts
CHANGED
|
@@ -441,6 +441,255 @@ export interface NotificationEventDeliveryAttemptResponse {
|
|
|
441
441
|
/** The URL the event was delivered to. Only set for webhook channels. */
|
|
442
442
|
url?: string;
|
|
443
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* Set of key-value pairs. Metadata can be used to store additional information
|
|
446
|
+
* about a resource.
|
|
447
|
+
*/
|
|
448
|
+
export type NotificationEventV1Metadata = Record<string, string>;
|
|
449
|
+
/** Set of key-value pairs managed by the system. Cannot be modified by user. */
|
|
450
|
+
export type NotificationEventV1Annotations = Record<string, unknown>;
|
|
451
|
+
/** A period with a start and end time. */
|
|
452
|
+
export interface NotificationEventV1Period {
|
|
453
|
+
/** Period start time. */
|
|
454
|
+
from: Date;
|
|
455
|
+
/** Period end time. */
|
|
456
|
+
to: Date;
|
|
457
|
+
}
|
|
458
|
+
/** A filter for a string field. */
|
|
459
|
+
export interface NotificationEventV1FilterString {
|
|
460
|
+
/** The field must be equal to the provided value. */
|
|
461
|
+
$eq?: string | null;
|
|
462
|
+
/** The field must not be equal to the provided value. */
|
|
463
|
+
$ne?: string | null;
|
|
464
|
+
/** The field must be in the provided list of values. */
|
|
465
|
+
$in?: string[] | null;
|
|
466
|
+
/** The field must not be in the provided list of values. */
|
|
467
|
+
$nin?: string[] | null;
|
|
468
|
+
/** The field must match the provided value. */
|
|
469
|
+
$like?: string | null;
|
|
470
|
+
/** The field must not match the provided value. */
|
|
471
|
+
$nlike?: string | null;
|
|
472
|
+
/** The field must match the provided value, ignoring case. */
|
|
473
|
+
$ilike?: string | null;
|
|
474
|
+
/** The field must not match the provided value, ignoring case. */
|
|
475
|
+
$nilike?: string | null;
|
|
476
|
+
/** The field must be greater than the provided value. */
|
|
477
|
+
$gt?: string | null;
|
|
478
|
+
/** The field must be greater than or equal to the provided value. */
|
|
479
|
+
$gte?: string | null;
|
|
480
|
+
/** The field must be less than the provided value. */
|
|
481
|
+
$lt?: string | null;
|
|
482
|
+
/** The field must be less than or equal to the provided value. */
|
|
483
|
+
$lte?: string | null;
|
|
484
|
+
/** Provide a list of filters to be combined with a logical AND. */
|
|
485
|
+
$and?: NotificationEventV1FilterString[] | null;
|
|
486
|
+
/** Provide a list of filters to be combined with a logical OR. */
|
|
487
|
+
$or?: NotificationEventV1FilterString[] | null;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* A subject is a unique identifier for a usage attribution by its key. Subjects
|
|
491
|
+
* only exist in the concept of metering. Subjects are optional to create and work
|
|
492
|
+
* as an enrichment for the subject key like displayName, metadata, etc. Subjects
|
|
493
|
+
* are useful when you are reporting usage events with your own database ID but
|
|
494
|
+
* want to enrich the subject with a human-readable name or metadata. For most use
|
|
495
|
+
* cases, a subject is equivalent to a customer.
|
|
496
|
+
*
|
|
497
|
+
* ⚠️ **Deprecated**: Subjects as managable entities are being depracated, use
|
|
498
|
+
* customers with subject key usage attribution instead.
|
|
499
|
+
*/
|
|
500
|
+
export interface NotificationEventV1Subject {
|
|
501
|
+
/** Timestamp of when the resource was created. */
|
|
502
|
+
createdAt: Date;
|
|
503
|
+
/** Timestamp of when the resource was last updated. */
|
|
504
|
+
updatedAt: Date;
|
|
505
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
506
|
+
deletedAt?: Date;
|
|
507
|
+
/** A unique identifier for the subject. */
|
|
508
|
+
id: string;
|
|
509
|
+
/**
|
|
510
|
+
* A unique, human-readable identifier for the subject. This is typically a
|
|
511
|
+
* database ID or a customer key.
|
|
512
|
+
*/
|
|
513
|
+
key: string;
|
|
514
|
+
/** A human-readable display name for the subject. */
|
|
515
|
+
displayName?: string | null;
|
|
516
|
+
/** Metadata for the subject. */
|
|
517
|
+
metadata?: Record<string, unknown> | null;
|
|
518
|
+
/** The start of the current period for the subject. */
|
|
519
|
+
currentPeriodStart?: Date;
|
|
520
|
+
/** The end of the current period for the subject. */
|
|
521
|
+
currentPeriodEnd?: Date;
|
|
522
|
+
/** The Stripe customer ID for the subject. */
|
|
523
|
+
stripeCustomerId?: string | null;
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Entitlements are the core of OpenMeter access management. They define access to
|
|
527
|
+
* features for subjects. Entitlements can be metered, boolean, or static.
|
|
528
|
+
*/
|
|
529
|
+
export interface NotificationEventV1EntitlementValue {
|
|
530
|
+
/**
|
|
531
|
+
* Whether the subject has access to the feature. Shared accross all entitlement
|
|
532
|
+
* types.
|
|
533
|
+
*/
|
|
534
|
+
hasAccess: boolean;
|
|
535
|
+
/**
|
|
536
|
+
* Only available for metered entitlements. Metered entitlements are built around a
|
|
537
|
+
* balance calculation where feature usage is deducted from the issued grants.
|
|
538
|
+
* Balance represents the remaining balance of the entitlement, it's value never
|
|
539
|
+
* turns negative.
|
|
540
|
+
*/
|
|
541
|
+
balance?: number;
|
|
542
|
+
/**
|
|
543
|
+
* Only available for metered entitlements. Returns the total feature usage in the
|
|
544
|
+
* current period.
|
|
545
|
+
*/
|
|
546
|
+
usage?: number;
|
|
547
|
+
/**
|
|
548
|
+
* Only available for metered entitlements. Overage represents the usage that
|
|
549
|
+
* wasn't covered by grants, e.g. if the subject had a total feature usage of 100
|
|
550
|
+
* in the period but they were only granted 80, there would be 20 overage.
|
|
551
|
+
*/
|
|
552
|
+
overage?: number;
|
|
553
|
+
/**
|
|
554
|
+
* Only available for metered entitlements. The summed amount of all grant active
|
|
555
|
+
* at query time PLUS the used amount of since inactive grants.
|
|
556
|
+
*/
|
|
557
|
+
totalAvailableGrantAmount?: number;
|
|
558
|
+
/**
|
|
559
|
+
* Only available for static entitlements. The JSON parsable config of the
|
|
560
|
+
* entitlement.
|
|
561
|
+
*/
|
|
562
|
+
config?: string;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Mapping to attribute metered usage to the customer. One customer can have zero
|
|
566
|
+
* or more subjects, but one subject can only belong to one customer.
|
|
567
|
+
*/
|
|
568
|
+
export interface NotificationEventV1CustomerUsageAttribution {
|
|
569
|
+
/**
|
|
570
|
+
* The subjects that are attributed to the customer. Can be empty when no subjects
|
|
571
|
+
* are associated with the customer.
|
|
572
|
+
*/
|
|
573
|
+
subjectKeys: string[] | null;
|
|
574
|
+
}
|
|
575
|
+
/** Alignment configuration for a plan or subscription. */
|
|
576
|
+
export interface NotificationEventV1Alignment {
|
|
577
|
+
/**
|
|
578
|
+
* Whether all Billable items and RateCards must align. Alignment means the Price's
|
|
579
|
+
* BillingCadence must align for both duration and anchor time.
|
|
580
|
+
*/
|
|
581
|
+
billablesMustAlign?: boolean;
|
|
582
|
+
}
|
|
583
|
+
/** References an exact plan. */
|
|
584
|
+
export interface NotificationEventV1PlanReference {
|
|
585
|
+
/** The plan ID. */
|
|
586
|
+
id: string;
|
|
587
|
+
/** The plan key. */
|
|
588
|
+
key: string;
|
|
589
|
+
/** The plan version. */
|
|
590
|
+
version: number;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* InvoiceAvailableActionInvoiceDetails represents the details of the invoice
|
|
594
|
+
* action for non-gathering invoices.
|
|
595
|
+
*/
|
|
596
|
+
export interface NotificationEventV1InvoiceAvailableActionDetails {
|
|
597
|
+
/**
|
|
598
|
+
* The state the invoice will reach if the action is activated and all intermediate
|
|
599
|
+
* steps are successful.
|
|
600
|
+
*
|
|
601
|
+
* For example advancing a draft_created invoice will result in a
|
|
602
|
+
* draft_manual_approval_needed invoice.
|
|
603
|
+
*/
|
|
604
|
+
resultingState: string;
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* InvoiceAvailableActionInvoiceDetails represents the details of the invoice
|
|
608
|
+
* action for gathering invoices.
|
|
609
|
+
*/
|
|
610
|
+
export type NotificationEventV1InvoiceAvailableActionInvoiceDetails = Record<string, never>;
|
|
611
|
+
/**
|
|
612
|
+
* BillingWorkflowCollectionAlignmentSubscription specifies the alignment for
|
|
613
|
+
* collecting the pending line items into an invoice.
|
|
614
|
+
*/
|
|
615
|
+
export interface NotificationEventV1BillingWorkflowCollectionAlignmentSubscription {
|
|
616
|
+
/** The type of alignment. */
|
|
617
|
+
type: 'subscription';
|
|
618
|
+
}
|
|
619
|
+
/** The tax config for Stripe. */
|
|
620
|
+
export interface NotificationEventV1StripeTaxConfig {
|
|
621
|
+
/**
|
|
622
|
+
* Product tax code.
|
|
623
|
+
*
|
|
624
|
+
* See: https://docs.stripe.com/tax/tax-codes
|
|
625
|
+
*/
|
|
626
|
+
code: string;
|
|
627
|
+
}
|
|
628
|
+
/** Custom invoicing tax config. */
|
|
629
|
+
export interface NotificationEventV1CustomInvoicingTaxConfig {
|
|
630
|
+
/**
|
|
631
|
+
* Tax code.
|
|
632
|
+
*
|
|
633
|
+
* The tax code should be interpreted by the custom invoicing provider.
|
|
634
|
+
*/
|
|
635
|
+
code: string;
|
|
636
|
+
}
|
|
637
|
+
/** BillingWorkflowTaxSettings represents the tax settings for a billing workflow */
|
|
638
|
+
export interface NotificationEventV1BillingWorkflowTaxSettings {
|
|
639
|
+
/**
|
|
640
|
+
* Enable automatic tax calculation when tax is supported by the app. For example,
|
|
641
|
+
* with Stripe Invoicing when enabled, tax is calculated via Stripe Tax.
|
|
642
|
+
*/
|
|
643
|
+
enabled?: boolean;
|
|
644
|
+
/**
|
|
645
|
+
* Enforce tax calculation when tax is supported by the app. When enabled,
|
|
646
|
+
* OpenMeter will not allow to create an invoice without tax calculation.
|
|
647
|
+
* Enforcement is different per apps, for example, Stripe app requires customer to
|
|
648
|
+
* have a tax location when starting a paid subscription.
|
|
649
|
+
*/
|
|
650
|
+
enforced?: boolean;
|
|
651
|
+
}
|
|
652
|
+
/** The reason for the discount is a maximum spend. */
|
|
653
|
+
export interface NotificationEventV1DiscountReasonMaximumSpend {
|
|
654
|
+
/** type. */
|
|
655
|
+
type: 'maximum_spend';
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* InvoiceLineAppExternalIds contains the external IDs of the invoice in other apps
|
|
659
|
+
* such as Stripe.
|
|
660
|
+
*/
|
|
661
|
+
export interface NotificationEventV1InvoiceLineAppExternalIds {
|
|
662
|
+
/** The external ID of the invoice in the invoicing app if available. */
|
|
663
|
+
invoicing?: string;
|
|
664
|
+
/** The external ID of the invoice in the tax app if available. */
|
|
665
|
+
tax?: string;
|
|
666
|
+
}
|
|
667
|
+
/** IDResource is a resouce with an ID. */
|
|
668
|
+
export interface NotificationEventV1IdResource {
|
|
669
|
+
/** A unique identifier for the resource. */
|
|
670
|
+
id: string;
|
|
671
|
+
}
|
|
672
|
+
/** PaymentTermInstant defines the terms for payment on receipt of invoice. */
|
|
673
|
+
export interface NotificationEventV1PaymentTermInstant {
|
|
674
|
+
/** Type of terms to be applied. */
|
|
675
|
+
type: 'instant';
|
|
676
|
+
/** Text detail of the chosen payment terms. */
|
|
677
|
+
detail?: string;
|
|
678
|
+
/** Description of the conditions for payment. */
|
|
679
|
+
notes?: string;
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* InvoiceAppExternalIds contains the external IDs of the invoice in other apps
|
|
683
|
+
* such as Stripe.
|
|
684
|
+
*/
|
|
685
|
+
export interface NotificationEventV1InvoiceAppExternalIds {
|
|
686
|
+
/** The external ID of the invoice in the invoicing app if available. */
|
|
687
|
+
invoicing?: string;
|
|
688
|
+
/** The external ID of the invoice in the tax app if available. */
|
|
689
|
+
tax?: string;
|
|
690
|
+
/** The external ID of the invoice in the payment app if available. */
|
|
691
|
+
payment?: string;
|
|
692
|
+
}
|
|
444
693
|
/**
|
|
445
694
|
* A query filter for an integer attribute. Operators are mutually exclusive, only
|
|
446
695
|
* one operator is allowed at a time.
|
|
@@ -1066,20 +1315,6 @@ export interface UpdateResourceReference {
|
|
|
1066
1315
|
export interface NotificationChannelReference {
|
|
1067
1316
|
id: string;
|
|
1068
1317
|
}
|
|
1069
|
-
/** A reference to the feature of an entitlement notification event. */
|
|
1070
|
-
export interface NotificationEventFeatureReference {
|
|
1071
|
-
/** The unique identifier of the feature. */
|
|
1072
|
-
id: string;
|
|
1073
|
-
/** The immutable key of the feature. */
|
|
1074
|
-
key: string;
|
|
1075
|
-
}
|
|
1076
|
-
/** A reference to the invoice of an invoice notification event. */
|
|
1077
|
-
export interface NotificationEventInvoiceReference {
|
|
1078
|
-
/** The unique identifier of the invoice. */
|
|
1079
|
-
id: string;
|
|
1080
|
-
/** The human-readable invoice number. */
|
|
1081
|
-
number: string;
|
|
1082
|
-
}
|
|
1083
1318
|
/** Customer reference. */
|
|
1084
1319
|
export interface BillingCustomerReference {
|
|
1085
1320
|
/** The ID of the customer. */
|
|
@@ -2513,111 +2748,521 @@ export interface NotificationEventDeliveryAttempt {
|
|
|
2513
2748
|
/** When the attempt was made. */
|
|
2514
2749
|
timestamp: Date;
|
|
2515
2750
|
}
|
|
2516
|
-
/**
|
|
2517
|
-
export interface
|
|
2518
|
-
/**
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
* unchanged.
|
|
2523
|
-
*/
|
|
2524
|
-
stripe?: AppCustomerDataStripe | null;
|
|
2525
|
-
/**
|
|
2526
|
-
* Used if the customer has a linked external invoicing app.
|
|
2527
|
-
*
|
|
2528
|
-
* Set to `null` to remove the external invoicing data of the customer; omit to
|
|
2529
|
-
* leave it unchanged.
|
|
2530
|
-
*/
|
|
2531
|
-
externalInvoicing?: AppCustomerDataExternalInvoicing | null;
|
|
2751
|
+
/** A fixed per-unit cost amount. */
|
|
2752
|
+
export interface NotificationEventV1FeatureManualUnitCost {
|
|
2753
|
+
/** type. */
|
|
2754
|
+
type: 'manual';
|
|
2755
|
+
/** Fixed per-unit cost amount in USD. */
|
|
2756
|
+
amount: string;
|
|
2532
2757
|
}
|
|
2533
|
-
/**
|
|
2534
|
-
export interface
|
|
2758
|
+
/** Resolved per-token pricing from the LLM cost database. */
|
|
2759
|
+
export interface NotificationEventV1FeatureLlmUnitCostPricing {
|
|
2760
|
+
/** Cost per input token in USD. */
|
|
2761
|
+
inputPerToken: string;
|
|
2762
|
+
/** Cost per output token in USD. */
|
|
2763
|
+
outputPerToken: string;
|
|
2764
|
+
/** Cost per cache read token in USD. */
|
|
2765
|
+
cacheReadPerToken?: string;
|
|
2766
|
+
/** Cost per reasoning token in USD. */
|
|
2767
|
+
reasoningPerToken?: string;
|
|
2768
|
+
/** Cost per cache write token in USD. */
|
|
2769
|
+
cacheWritePerToken?: string;
|
|
2770
|
+
}
|
|
2771
|
+
/** Totals contains the summaries of all calculations for the invoice. */
|
|
2772
|
+
export interface NotificationEventV1InvoiceTotals {
|
|
2773
|
+
/** The total value of the line before taxes, discounts and commitments. */
|
|
2774
|
+
amount: string;
|
|
2775
|
+
/** The amount of value of the line that are due to additional charges. */
|
|
2776
|
+
chargesTotal: string;
|
|
2777
|
+
/** The amount of value of the line that are due to discounts. */
|
|
2778
|
+
discountsTotal: string;
|
|
2779
|
+
/** The amount of value of the line that are due to credits. */
|
|
2780
|
+
creditsTotal: string;
|
|
2781
|
+
/** The total amount of taxes that are included in the line. */
|
|
2782
|
+
taxesInclusiveTotal: string;
|
|
2783
|
+
/** The total amount of taxes that are added on top of amount from the line. */
|
|
2784
|
+
taxesExclusiveTotal: string;
|
|
2785
|
+
/** The total amount of taxes for this line. */
|
|
2786
|
+
taxesTotal: string;
|
|
2787
|
+
/** The total amount value of the line after taxes, discounts and commitments. */
|
|
2788
|
+
total: string;
|
|
2789
|
+
}
|
|
2790
|
+
/** The reason for the discount is a ratecard usage. */
|
|
2791
|
+
export interface NotificationEventV1DiscountReasonRatecardUsage {
|
|
2792
|
+
/** type. */
|
|
2793
|
+
type: 'ratecard_usage';
|
|
2535
2794
|
/**
|
|
2536
|
-
*
|
|
2795
|
+
* The quantity of the usage discount.
|
|
2537
2796
|
*
|
|
2538
|
-
*
|
|
2539
|
-
* unchanged.
|
|
2797
|
+
* Must be positive.
|
|
2540
2798
|
*/
|
|
2541
|
-
|
|
2799
|
+
quantity: string;
|
|
2542
2800
|
/**
|
|
2543
|
-
*
|
|
2801
|
+
* Correlation ID for the discount.
|
|
2544
2802
|
*
|
|
2545
|
-
*
|
|
2546
|
-
*
|
|
2803
|
+
* This is used to link discounts across different invoices (progressive billing
|
|
2804
|
+
* use case).
|
|
2805
|
+
*
|
|
2806
|
+
* If not provided, the invoicing engine will auto-generate one. When editing an
|
|
2807
|
+
* invoice line, please make sure to keep the same correlation ID of the discount
|
|
2808
|
+
* or in progressive billing setups the discount amounts might be incorrect.
|
|
2547
2809
|
*/
|
|
2548
|
-
|
|
2810
|
+
correlationId?: string;
|
|
2549
2811
|
}
|
|
2550
2812
|
/**
|
|
2551
|
-
*
|
|
2552
|
-
*
|
|
2553
|
-
*
|
|
2554
|
-
* Supported use-cases:
|
|
2555
|
-
*
|
|
2556
|
-
* - Usage correction
|
|
2813
|
+
* InvoiceLineCreditAllocation represents a credit amount allocated to the line
|
|
2814
|
+
* before taxes are applied.
|
|
2557
2815
|
*/
|
|
2558
|
-
export interface
|
|
2816
|
+
export interface NotificationEventV1InvoiceLineCreditAllocation {
|
|
2817
|
+
/** Amount allocated from credits. */
|
|
2818
|
+
amount: string;
|
|
2819
|
+
/** Text description as to why the credit was allocated. */
|
|
2820
|
+
description?: string;
|
|
2821
|
+
}
|
|
2822
|
+
/** Unit price with spend commitments. */
|
|
2823
|
+
export interface NotificationEventV1UnitPriceWithCommitments {
|
|
2824
|
+
/** The type of the price. */
|
|
2825
|
+
type: 'unit';
|
|
2826
|
+
/** The amount of the unit price. */
|
|
2827
|
+
amount: string;
|
|
2828
|
+
/** The customer is committed to spend at least the amount. */
|
|
2829
|
+
minimumAmount?: string;
|
|
2830
|
+
/** The customer is limited to spend at most the amount. */
|
|
2831
|
+
maximumAmount?: string;
|
|
2832
|
+
}
|
|
2833
|
+
/** Flat price. */
|
|
2834
|
+
export interface NotificationEventV1FlatPrice {
|
|
2835
|
+
/** The type of the price. */
|
|
2836
|
+
type: 'flat';
|
|
2837
|
+
/** The amount of the flat price. */
|
|
2838
|
+
amount: string;
|
|
2839
|
+
}
|
|
2840
|
+
/** Unit price. */
|
|
2841
|
+
export interface NotificationEventV1UnitPrice {
|
|
2842
|
+
/** The type of the price. */
|
|
2843
|
+
type: 'unit';
|
|
2844
|
+
/** The amount of the unit price. */
|
|
2845
|
+
amount: string;
|
|
2846
|
+
}
|
|
2847
|
+
/** Dynamic price with spend commitments. */
|
|
2848
|
+
export interface NotificationEventV1DynamicPriceWithCommitments {
|
|
2849
|
+
/** The type of the price. */
|
|
2850
|
+
type: 'dynamic';
|
|
2559
2851
|
/**
|
|
2560
|
-
*
|
|
2852
|
+
* The multiplier to apply to the base price to get the dynamic price.
|
|
2561
2853
|
*
|
|
2562
|
-
*
|
|
2563
|
-
*/
|
|
2564
|
-
name: string;
|
|
2565
|
-
/**
|
|
2566
|
-
* Optional description of the resource.
|
|
2854
|
+
* Examples:
|
|
2567
2855
|
*
|
|
2568
|
-
*
|
|
2856
|
+
* - 0.0: the price is zero
|
|
2857
|
+
* - 0.5: the price is 50% of the base price
|
|
2858
|
+
* - 1.0: the price is the same as the base price
|
|
2859
|
+
* - 1.5: the price is 150% of the base price
|
|
2569
2860
|
*/
|
|
2570
|
-
|
|
2571
|
-
|
|
2861
|
+
multiplier?: string;
|
|
2862
|
+
/** The customer is committed to spend at least the amount. */
|
|
2863
|
+
minimumAmount?: string;
|
|
2864
|
+
/** The customer is limited to spend at most the amount. */
|
|
2865
|
+
maximumAmount?: string;
|
|
2572
2866
|
}
|
|
2573
|
-
/**
|
|
2574
|
-
export interface
|
|
2575
|
-
/**
|
|
2576
|
-
|
|
2577
|
-
/**
|
|
2578
|
-
|
|
2579
|
-
/**
|
|
2580
|
-
|
|
2581
|
-
/**
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
* `exists=false` for grants without feature restrictions.
|
|
2586
|
-
*/
|
|
2587
|
-
featureKey?: StringFieldFilter;
|
|
2867
|
+
/** Package price with spend commitments. */
|
|
2868
|
+
export interface NotificationEventV1PackagePriceWithCommitments {
|
|
2869
|
+
/** The type of the price. */
|
|
2870
|
+
type: 'package';
|
|
2871
|
+
/** The price of one package. */
|
|
2872
|
+
amount: string;
|
|
2873
|
+
/** The quantity per package. */
|
|
2874
|
+
quantityPerPackage: string;
|
|
2875
|
+
/** The customer is committed to spend at least the amount. */
|
|
2876
|
+
minimumAmount?: string;
|
|
2877
|
+
/** The customer is limited to spend at most the amount. */
|
|
2878
|
+
maximumAmount?: string;
|
|
2588
2879
|
}
|
|
2589
|
-
/**
|
|
2590
|
-
export interface
|
|
2880
|
+
/** A usage discount. */
|
|
2881
|
+
export interface NotificationEventV1BillingDiscountUsage {
|
|
2591
2882
|
/**
|
|
2592
|
-
*
|
|
2883
|
+
* The quantity of the usage discount.
|
|
2593
2884
|
*
|
|
2594
|
-
*
|
|
2885
|
+
* Must be positive.
|
|
2595
2886
|
*/
|
|
2596
|
-
|
|
2887
|
+
quantity: string;
|
|
2597
2888
|
/**
|
|
2598
|
-
*
|
|
2889
|
+
* Correlation ID for the discount.
|
|
2599
2890
|
*
|
|
2600
|
-
*
|
|
2891
|
+
* This is used to link discounts across different invoices (progressive billing
|
|
2892
|
+
* use case).
|
|
2893
|
+
*
|
|
2894
|
+
* If not provided, the invoicing engine will auto-generate one. When editing an
|
|
2895
|
+
* invoice line, please make sure to keep the same correlation ID of the discount
|
|
2896
|
+
* or in progressive billing setups the discount amounts might be incorrect.
|
|
2601
2897
|
*/
|
|
2602
|
-
|
|
2603
|
-
labels?: Labels;
|
|
2604
|
-
/** The currency of the granted credits. */
|
|
2605
|
-
currency: BillingCurrencyCode;
|
|
2606
|
-
/** Granted credit amount. */
|
|
2607
|
-
amount: string;
|
|
2898
|
+
correlationId?: string;
|
|
2608
2899
|
}
|
|
2609
|
-
/**
|
|
2610
|
-
export interface
|
|
2611
|
-
/**
|
|
2612
|
-
|
|
2900
|
+
/** A cost basis pinned to a custom-currency pair for the subscription. */
|
|
2901
|
+
export interface NotificationEventV1SubscriptionCostBasisPin {
|
|
2902
|
+
/** The managed custom currency ID. */
|
|
2903
|
+
customCurrencyId: string;
|
|
2904
|
+
/** The fiat currency in which the subscription is invoiced. */
|
|
2905
|
+
invoiceCurrency: string;
|
|
2906
|
+
/** The pinned cost basis resource ID. */
|
|
2907
|
+
costBasisId: string;
|
|
2908
|
+
}
|
|
2909
|
+
/** Address */
|
|
2910
|
+
export interface NotificationEventV1Address {
|
|
2613
2911
|
/**
|
|
2614
|
-
*
|
|
2615
|
-
*
|
|
2912
|
+
* Country code in [ISO 3166-1](https://www.iso.org/iso-3166-country-codes.html)
|
|
2913
|
+
* alpha-2 format.
|
|
2616
2914
|
*/
|
|
2617
|
-
|
|
2618
|
-
/**
|
|
2619
|
-
|
|
2620
|
-
|
|
2915
|
+
country?: string;
|
|
2916
|
+
/** Postal code. */
|
|
2917
|
+
postalCode?: string;
|
|
2918
|
+
/** State or province. */
|
|
2919
|
+
state?: string;
|
|
2920
|
+
/** City. */
|
|
2921
|
+
city?: string;
|
|
2922
|
+
/** First line of the address. */
|
|
2923
|
+
line1?: string;
|
|
2924
|
+
/** Second line of the address. */
|
|
2925
|
+
line2?: string;
|
|
2926
|
+
/** Phone number. */
|
|
2927
|
+
phoneNumber?: string;
|
|
2928
|
+
}
|
|
2929
|
+
/** Configuration for pro-rating behavior. */
|
|
2930
|
+
export interface NotificationEventV1ProRatingConfig {
|
|
2931
|
+
/** Whether pro-rating is enabled for this plan. */
|
|
2932
|
+
enabled: boolean;
|
|
2933
|
+
/** How to handle pro-rating for billing period changes. */
|
|
2934
|
+
mode: 'prorate_prices';
|
|
2935
|
+
}
|
|
2936
|
+
/** Threshold value with multiple supported types. */
|
|
2937
|
+
export interface NotificationEventV1RuleBalanceThresholdValue {
|
|
2938
|
+
/** Value of the threshold. */
|
|
2939
|
+
value: number;
|
|
2940
|
+
/** Type of the threshold. */
|
|
2941
|
+
type: 'PERCENT' | 'NUMBER' | 'balance_value' | 'usage_percentage' | 'usage_value';
|
|
2942
|
+
}
|
|
2943
|
+
/**
|
|
2944
|
+
* Identity stores the details required to identify an entity for tax purposes in a
|
|
2945
|
+
* specific country.
|
|
2946
|
+
*/
|
|
2947
|
+
export interface NotificationEventV1BillingPartyTaxIdentity {
|
|
2948
|
+
/** Normalized tax code shown on the original identity document. */
|
|
2949
|
+
code?: string;
|
|
2950
|
+
}
|
|
2951
|
+
/** Reference to an invoice. */
|
|
2952
|
+
export interface NotificationEventV1InvoiceReference {
|
|
2953
|
+
/** The ID of the invoice. */
|
|
2954
|
+
id: string;
|
|
2955
|
+
/** The number of the invoice. */
|
|
2956
|
+
number?: string;
|
|
2957
|
+
}
|
|
2958
|
+
/**
|
|
2959
|
+
* InvoiceDocumentRef is used to describe a reference to an existing document
|
|
2960
|
+
* (invoice).
|
|
2961
|
+
*
|
|
2962
|
+
* The v1 schema describes credit note references with issued_at, number and url,
|
|
2963
|
+
* but the v1 API only ever sends the generic fields below.
|
|
2964
|
+
*/
|
|
2965
|
+
export interface NotificationEventV1InvoiceDocumentRef {
|
|
2966
|
+
/** Type of the document referenced. */
|
|
2967
|
+
type: 'credit_note_original_invoice';
|
|
2968
|
+
/** Human readable description on why this reference is here or needs to be used. */
|
|
2969
|
+
reason?: string;
|
|
2970
|
+
/** Additional details about the document. */
|
|
2971
|
+
description?: string;
|
|
2972
|
+
}
|
|
2973
|
+
/**
|
|
2974
|
+
* Omitted fields: period: Tax period in which the referred document had an effect
|
|
2975
|
+
* required by some tax regimes and formats. stamps: Seals of approval from other
|
|
2976
|
+
* organisations that may need to be listed. ext: Extensions for additional codes
|
|
2977
|
+
* that may be required.
|
|
2978
|
+
*/
|
|
2979
|
+
export interface NotificationEventV1InvoiceGenericDocumentRef {
|
|
2980
|
+
/** Type of the document referenced. */
|
|
2981
|
+
type: 'credit_note_original_invoice';
|
|
2982
|
+
/** Human readable description on why this reference is here or needs to be used. */
|
|
2983
|
+
reason?: string;
|
|
2984
|
+
/** Additional details about the document. */
|
|
2985
|
+
description?: string;
|
|
2986
|
+
}
|
|
2987
|
+
/**
|
|
2988
|
+
* InvoiceAvailableActions represents the actions that can be performed on the
|
|
2989
|
+
* invoice.
|
|
2990
|
+
*/
|
|
2991
|
+
export interface NotificationEventV1InvoiceAvailableActions {
|
|
2992
|
+
/** Advance the invoice to the next status. */
|
|
2993
|
+
advance?: NotificationEventV1InvoiceAvailableActionDetails;
|
|
2994
|
+
/** Approve an invoice that requires manual approval. */
|
|
2995
|
+
approve?: NotificationEventV1InvoiceAvailableActionDetails;
|
|
2996
|
+
/** Delete the invoice (only non-issued invoices can be deleted). */
|
|
2997
|
+
delete?: NotificationEventV1InvoiceAvailableActionDetails;
|
|
2998
|
+
/** Retry an invoice issuing step that failed. */
|
|
2999
|
+
retry?: NotificationEventV1InvoiceAvailableActionDetails;
|
|
3000
|
+
/** Snapshot quantities for usage based line items. */
|
|
3001
|
+
snapshotQuantities?: NotificationEventV1InvoiceAvailableActionDetails;
|
|
3002
|
+
/** Void an already issued invoice. */
|
|
3003
|
+
void?: NotificationEventV1InvoiceAvailableActionDetails;
|
|
3004
|
+
/** Invoice a gathering invoice */
|
|
3005
|
+
invoice?: NotificationEventV1InvoiceAvailableActionInvoiceDetails;
|
|
3006
|
+
}
|
|
3007
|
+
/**
|
|
3008
|
+
* App capability.
|
|
3009
|
+
*
|
|
3010
|
+
* Capabilities only exist in config so they don't extend the Resource model.
|
|
3011
|
+
*/
|
|
3012
|
+
export interface NotificationEventV1AppCapability {
|
|
3013
|
+
/** The capability type. */
|
|
3014
|
+
type: 'reportUsage' | 'reportEvents' | 'calculateTax' | 'invoiceCustomers' | 'collectPayments';
|
|
3015
|
+
/** Key */
|
|
3016
|
+
key: string;
|
|
3017
|
+
/** The capability name. */
|
|
3018
|
+
name: string;
|
|
3019
|
+
/** The capability description. */
|
|
3020
|
+
description: string;
|
|
3021
|
+
}
|
|
3022
|
+
/** Set of provider specific tax configs. */
|
|
3023
|
+
export interface NotificationEventV1TaxConfig {
|
|
3024
|
+
/**
|
|
3025
|
+
* Tax behavior.
|
|
3026
|
+
*
|
|
3027
|
+
* If not specified the billing profile is used to determine the tax behavior. If
|
|
3028
|
+
* not specified in the billing profile, the provider's default behavior is used.
|
|
3029
|
+
*/
|
|
3030
|
+
behavior?: 'inclusive' | 'exclusive';
|
|
3031
|
+
/** Stripe tax config. */
|
|
3032
|
+
stripe?: NotificationEventV1StripeTaxConfig;
|
|
3033
|
+
/** Custom invoicing tax config. */
|
|
3034
|
+
customInvoicing?: NotificationEventV1CustomInvoicingTaxConfig;
|
|
3035
|
+
/**
|
|
3036
|
+
* Tax code reference.
|
|
3037
|
+
*
|
|
3038
|
+
* When both `taxCodeId` and `stripe.code` are provided, `taxCodeId` takes
|
|
3039
|
+
* precedence: the referenced tax code entity is used and `stripe.code` is ignored.
|
|
3040
|
+
*/
|
|
3041
|
+
taxCodeId?: string;
|
|
3042
|
+
}
|
|
3043
|
+
/**
|
|
3044
|
+
* BillingWorkflowPaymentSettings represents the payment settings for a billing
|
|
3045
|
+
* workflow
|
|
3046
|
+
*/
|
|
3047
|
+
export interface NotificationEventV1BillingWorkflowPaymentSettings {
|
|
3048
|
+
/** The payment method for the invoice. */
|
|
3049
|
+
collectionMethod?: 'charge_automatically' | 'send_invoice';
|
|
3050
|
+
}
|
|
3051
|
+
/** The reason for the discount is a ratecard percentage. */
|
|
3052
|
+
export interface NotificationEventV1DiscountReasonRatecardPercentage {
|
|
3053
|
+
/** type. */
|
|
3054
|
+
type: 'ratecard_percentage';
|
|
3055
|
+
/** The percentage of the discount. */
|
|
3056
|
+
percentage: number;
|
|
3057
|
+
/**
|
|
3058
|
+
* Correlation ID for the discount.
|
|
3059
|
+
*
|
|
3060
|
+
* This is used to link discounts across different invoices (progressive billing
|
|
3061
|
+
* use case).
|
|
3062
|
+
*
|
|
3063
|
+
* If not provided, the invoicing engine will auto-generate one. When editing an
|
|
3064
|
+
* invoice line, please make sure to keep the same correlation ID of the discount
|
|
3065
|
+
* or in progressive billing setups the discount amounts might be incorrect.
|
|
3066
|
+
*/
|
|
3067
|
+
correlationId?: string;
|
|
3068
|
+
}
|
|
3069
|
+
/** A percentage discount. */
|
|
3070
|
+
export interface NotificationEventV1BillingDiscountPercentage {
|
|
3071
|
+
/** The percentage of the discount. */
|
|
3072
|
+
percentage: number;
|
|
3073
|
+
/**
|
|
3074
|
+
* Correlation ID for the discount.
|
|
3075
|
+
*
|
|
3076
|
+
* This is used to link discounts across different invoices (progressive billing
|
|
3077
|
+
* use case).
|
|
3078
|
+
*
|
|
3079
|
+
* If not provided, the invoicing engine will auto-generate one. When editing an
|
|
3080
|
+
* invoice line, please make sure to keep the same correlation ID of the discount
|
|
3081
|
+
* or in progressive billing setups the discount amounts might be incorrect.
|
|
3082
|
+
*/
|
|
3083
|
+
correlationId?: string;
|
|
3084
|
+
}
|
|
3085
|
+
/** PaymentDueDate contains an amount that should be paid by the given date. */
|
|
3086
|
+
export interface NotificationEventV1PaymentDueDate {
|
|
3087
|
+
/** When the payment is due. */
|
|
3088
|
+
dueAt: Date;
|
|
3089
|
+
/** Other details to take into account for the due date. */
|
|
3090
|
+
notes?: string;
|
|
3091
|
+
/** How much needs to be paid by the date. */
|
|
3092
|
+
amount: string;
|
|
3093
|
+
/** Percentage of the total that should be paid by the date. */
|
|
3094
|
+
percent?: number;
|
|
3095
|
+
/** If different from the parent document's base currency. */
|
|
3096
|
+
currency?: string;
|
|
3097
|
+
}
|
|
3098
|
+
/**
|
|
3099
|
+
* InvoiceLineSubscriptionReference contains the references to the subscription
|
|
3100
|
+
* that this line is related to.
|
|
3101
|
+
*/
|
|
3102
|
+
export interface NotificationEventV1InvoiceLineSubscriptionReference {
|
|
3103
|
+
/** The subscription. */
|
|
3104
|
+
subscription: NotificationEventV1IdResource;
|
|
3105
|
+
/** The phase of the subscription. */
|
|
3106
|
+
phase: NotificationEventV1IdResource;
|
|
3107
|
+
/** The item this line is related to. */
|
|
3108
|
+
item: NotificationEventV1IdResource;
|
|
3109
|
+
/**
|
|
3110
|
+
* The billing period of the subscription. In case the subscription item's billing
|
|
3111
|
+
* period is different from the subscription's billing period, this field will
|
|
3112
|
+
* contain the billing period of the subscription itself.
|
|
3113
|
+
*
|
|
3114
|
+
* For example, in case of:
|
|
3115
|
+
*
|
|
3116
|
+
* - A monthly billed subscription anchored to 2025-01-01
|
|
3117
|
+
* - A subscription item billed daily
|
|
3118
|
+
*
|
|
3119
|
+
* An example line would have the period of 2025-01-02 to 2025-01-03 as the item is
|
|
3120
|
+
* billed daily, but the subscription's billing period will be 2025-01-01 to
|
|
3121
|
+
* 2025-01-31.
|
|
3122
|
+
*/
|
|
3123
|
+
billingPeriod: NotificationEventV1Period;
|
|
3124
|
+
}
|
|
3125
|
+
/** Flat price with payment term. */
|
|
3126
|
+
export interface NotificationEventV1FlatPriceWithPaymentTerm {
|
|
3127
|
+
/** The type of the price. */
|
|
3128
|
+
type: 'flat';
|
|
3129
|
+
/** The amount of the flat price. */
|
|
3130
|
+
amount: string;
|
|
3131
|
+
/** The payment term of the flat price. Defaults to in advance. */
|
|
3132
|
+
paymentTerm?: 'in_advance' | 'in_arrears';
|
|
3133
|
+
}
|
|
3134
|
+
/**
|
|
3135
|
+
* ValidationIssue captures any validation issues related to the invoice.
|
|
3136
|
+
*
|
|
3137
|
+
* Issues with severity "critical" will prevent the invoice from being issued.
|
|
3138
|
+
*/
|
|
3139
|
+
export interface NotificationEventV1ValidationIssue {
|
|
3140
|
+
/** Timestamp of when the resource was created. */
|
|
3141
|
+
createdAt: Date;
|
|
3142
|
+
/** Timestamp of when the resource was last updated. */
|
|
3143
|
+
updatedAt: Date;
|
|
3144
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
3145
|
+
deletedAt?: Date;
|
|
3146
|
+
/** ID of the charge or discount. */
|
|
3147
|
+
id: string;
|
|
3148
|
+
/** The severity of the issue. */
|
|
3149
|
+
severity: 'critical' | 'warning';
|
|
3150
|
+
/** The field that the issue is related to, if available in JSON path format. */
|
|
3151
|
+
field?: string;
|
|
3152
|
+
/** Machine indentifiable code for the issue, if available. */
|
|
3153
|
+
code?: string;
|
|
3154
|
+
/** Component reporting the issue. */
|
|
3155
|
+
component: string;
|
|
3156
|
+
/** A human-readable description of the issue. */
|
|
3157
|
+
message: string;
|
|
3158
|
+
/** Additional context for the issue. */
|
|
3159
|
+
metadata?: NotificationEventV1Metadata;
|
|
3160
|
+
}
|
|
3161
|
+
/** App customer data. */
|
|
3162
|
+
export interface AppCustomerData {
|
|
3163
|
+
/**
|
|
3164
|
+
* Used if the customer has a linked Stripe app.
|
|
3165
|
+
*
|
|
3166
|
+
* Set to `null` to remove the Stripe data of the customer; omit to leave it
|
|
3167
|
+
* unchanged.
|
|
3168
|
+
*/
|
|
3169
|
+
stripe?: AppCustomerDataStripe | null;
|
|
3170
|
+
/**
|
|
3171
|
+
* Used if the customer has a linked external invoicing app.
|
|
3172
|
+
*
|
|
3173
|
+
* Set to `null` to remove the external invoicing data of the customer; omit to
|
|
3174
|
+
* leave it unchanged.
|
|
3175
|
+
*/
|
|
3176
|
+
externalInvoicing?: AppCustomerDataExternalInvoicing | null;
|
|
3177
|
+
}
|
|
3178
|
+
/** AppCustomerData upsert request. */
|
|
3179
|
+
export interface UpsertAppCustomerDataRequest {
|
|
3180
|
+
/**
|
|
3181
|
+
* Used if the customer has a linked Stripe app.
|
|
3182
|
+
*
|
|
3183
|
+
* Set to `null` to remove the Stripe data of the customer; omit to leave it
|
|
3184
|
+
* unchanged.
|
|
3185
|
+
*/
|
|
3186
|
+
stripe?: AppCustomerDataStripe | null;
|
|
3187
|
+
/**
|
|
3188
|
+
* Used if the customer has a linked external invoicing app.
|
|
3189
|
+
*
|
|
3190
|
+
* Set to `null` to remove the external invoicing data of the customer; omit to
|
|
3191
|
+
* leave it unchanged.
|
|
3192
|
+
*/
|
|
3193
|
+
externalInvoicing?: AppCustomerDataExternalInvoicing | null;
|
|
3194
|
+
}
|
|
3195
|
+
/**
|
|
3196
|
+
* A credit adjustment can be used to make manual adjustments to a customer's
|
|
3197
|
+
* credit balance.
|
|
3198
|
+
*
|
|
3199
|
+
* Supported use-cases:
|
|
3200
|
+
*
|
|
3201
|
+
* - Usage correction
|
|
3202
|
+
*/
|
|
3203
|
+
export interface CreditAdjustment {
|
|
3204
|
+
/**
|
|
3205
|
+
* Display name of the resource.
|
|
3206
|
+
*
|
|
3207
|
+
* Between 1 and 256 characters.
|
|
3208
|
+
*/
|
|
3209
|
+
name: string;
|
|
3210
|
+
/**
|
|
3211
|
+
* Optional description of the resource.
|
|
3212
|
+
*
|
|
3213
|
+
* Maximum 1024 characters.
|
|
3214
|
+
*/
|
|
3215
|
+
description?: string;
|
|
3216
|
+
labels?: Labels;
|
|
3217
|
+
}
|
|
3218
|
+
/** Filter options for listing credit grants. */
|
|
3219
|
+
export interface ListCreditGrantsParamsFilter {
|
|
3220
|
+
/** Filter credit grants by status. */
|
|
3221
|
+
status?: 'pending' | 'active' | 'expired' | 'voided';
|
|
3222
|
+
/** Filter credit grants by fiat or custom currency code. */
|
|
3223
|
+
currency?: BillingCurrencyCode;
|
|
3224
|
+
/** Filter credit grants by key. */
|
|
3225
|
+
key?: StringFieldFilter;
|
|
3226
|
+
/**
|
|
3227
|
+
* Select grants spendable on any requested feature, including grants without
|
|
3228
|
+
* feature restrictions. Keys are case-sensitive. Supports `eq` (or shorthand) and
|
|
3229
|
+
* `oeq` with comma-separated keys. Omit to include all features; use
|
|
3230
|
+
* `exists=false` for grants without feature restrictions.
|
|
3231
|
+
*/
|
|
3232
|
+
featureKey?: StringFieldFilter;
|
|
3233
|
+
}
|
|
3234
|
+
/** CreditAdjustment create request. */
|
|
3235
|
+
export interface CreateCreditAdjustmentRequest {
|
|
3236
|
+
/**
|
|
3237
|
+
* Display name of the resource.
|
|
3238
|
+
*
|
|
3239
|
+
* Between 1 and 256 characters.
|
|
3240
|
+
*/
|
|
3241
|
+
name: string;
|
|
3242
|
+
/**
|
|
3243
|
+
* Optional description of the resource.
|
|
3244
|
+
*
|
|
3245
|
+
* Maximum 1024 characters.
|
|
3246
|
+
*/
|
|
3247
|
+
description?: string;
|
|
3248
|
+
labels?: Labels;
|
|
3249
|
+
/** The currency of the granted credits. */
|
|
3250
|
+
currency: BillingCurrencyCode;
|
|
3251
|
+
/** Granted credit amount. */
|
|
3252
|
+
amount: string;
|
|
3253
|
+
}
|
|
3254
|
+
/** Filter options for listing credit transactions. */
|
|
3255
|
+
export interface ListCreditTransactionsParamsFilter {
|
|
3256
|
+
/** Filter credit transactions by type. */
|
|
3257
|
+
type?: 'funded' | 'consumed' | 'correction' | 'expired' | 'voided';
|
|
3258
|
+
/**
|
|
3259
|
+
* Filter credit transactions by currency code. Custom-currency rows retain their
|
|
3260
|
+
* managed currency identifier.
|
|
3261
|
+
*/
|
|
3262
|
+
currency?: BillingCurrencyCode;
|
|
3263
|
+
/**
|
|
3264
|
+
* Filter credit transactions by feature key. Omit to return all credit
|
|
3265
|
+
* transactions. Use `exists=false` to return only unrestricted credit
|
|
2621
3266
|
* transactions.
|
|
2622
3267
|
*/
|
|
2623
3268
|
featureKey?: StringFieldFilter;
|
|
@@ -3362,19 +4007,6 @@ export interface ResendBillingNotificationEventRequest {
|
|
|
3362
4007
|
*/
|
|
3363
4008
|
channels?: NotificationChannelReference[];
|
|
3364
4009
|
}
|
|
3365
|
-
/** The invoice an invoice notification event refers to. */
|
|
3366
|
-
export interface NotificationEventInvoiceData {
|
|
3367
|
-
/** The invoice the event was generated for. */
|
|
3368
|
-
invoice: NotificationEventInvoiceReference;
|
|
3369
|
-
/** The identifier of the customer the invoice was issued to. */
|
|
3370
|
-
customerId?: string;
|
|
3371
|
-
/** The currency the invoice is denominated in. */
|
|
3372
|
-
currency: string;
|
|
3373
|
-
/** The status of the invoice at the time the event was generated. */
|
|
3374
|
-
status: string;
|
|
3375
|
-
/** The invoice total, including taxes, at the time the event was generated. */
|
|
3376
|
-
total: string;
|
|
3377
|
-
}
|
|
3378
4010
|
/** Filter options for listing ingested events. */
|
|
3379
4011
|
export interface ListEventsParamsFilter {
|
|
3380
4012
|
/** Filter events by ID. */
|
|
@@ -4546,55 +5178,335 @@ export interface NotificationEventDeliveryStatus {
|
|
|
4546
5178
|
/** The delivery attempts made so far, most recent first. */
|
|
4547
5179
|
attempts: NotificationEventDeliveryAttempt[];
|
|
4548
5180
|
}
|
|
4549
|
-
/**
|
|
4550
|
-
export interface
|
|
4551
|
-
/**
|
|
4552
|
-
* The billing profile explicitly selected for the customer.
|
|
4553
|
-
*
|
|
4554
|
-
* Unpinned customers use the current namespace default. Selecting the current
|
|
4555
|
-
* default explicitly pins the customer to that profile.
|
|
4556
|
-
*/
|
|
4557
|
-
billingProfile?: ProfileReference | null;
|
|
5181
|
+
/** Recurring period with an interval and an anchor. */
|
|
5182
|
+
export interface NotificationEventV1RecurringPeriod {
|
|
4558
5183
|
/**
|
|
4559
|
-
* The
|
|
4560
|
-
*
|
|
5184
|
+
* The unit of time for the interval. Heuristically maps ISO duraitons to enum
|
|
5185
|
+
* values or returns the ISO duration.
|
|
4561
5186
|
*/
|
|
4562
|
-
|
|
4563
|
-
/**
|
|
4564
|
-
|
|
5187
|
+
interval: NotificationEventV1RecurringPeriodInterval;
|
|
5188
|
+
/** A date-time anchor to base the recurring period on. */
|
|
5189
|
+
anchor: Date;
|
|
5190
|
+
/** The unit of time for the interval in ISO8601 format. */
|
|
5191
|
+
intervalIso: string;
|
|
4565
5192
|
}
|
|
4566
|
-
/**
|
|
4567
|
-
export interface
|
|
5193
|
+
/** Recurring period with an interval and an anchor. */
|
|
5194
|
+
export interface NotificationEventV1RecurringPeriodV2 {
|
|
4568
5195
|
/**
|
|
4569
|
-
* The
|
|
4570
|
-
*
|
|
4571
|
-
* Unpinned customers use the current namespace default. Selecting the current
|
|
4572
|
-
* default explicitly pins the customer to that profile.
|
|
5196
|
+
* The unit of time for the interval. Heuristically maps ISO duraitons to enum
|
|
5197
|
+
* values or returns the ISO duration.
|
|
4573
5198
|
*/
|
|
4574
|
-
|
|
4575
|
-
/**
|
|
4576
|
-
|
|
5199
|
+
interval: NotificationEventV1RecurringPeriodInterval;
|
|
5200
|
+
/** A date-time anchor to base the recurring period on. */
|
|
5201
|
+
anchor: Date;
|
|
4577
5202
|
}
|
|
4578
5203
|
/**
|
|
4579
|
-
*
|
|
4580
|
-
*
|
|
5204
|
+
* LLM cost lookup configuration. Maps meter group-by dimensions to LLM cost
|
|
5205
|
+
* database fields.
|
|
4581
5206
|
*/
|
|
4582
|
-
export interface
|
|
5207
|
+
export interface NotificationEventV1FeatureLlmUnitCost {
|
|
5208
|
+
/** type. */
|
|
5209
|
+
type: 'llm';
|
|
4583
5210
|
/**
|
|
4584
|
-
*
|
|
4585
|
-
*
|
|
4586
|
-
* Between 1 and 256 characters.
|
|
5211
|
+
* Meter group-by property that holds the LLM provider. Use this when the meter has
|
|
5212
|
+
* a group-by dimension for provider. Mutually exclusive with `provider`.
|
|
4587
5213
|
*/
|
|
4588
|
-
|
|
5214
|
+
providerProperty?: string;
|
|
4589
5215
|
/**
|
|
4590
|
-
*
|
|
4591
|
-
*
|
|
4592
|
-
* Maximum 1024 characters.
|
|
5216
|
+
* Static LLM provider value (e.g., "openai", "anthropic"). Use this when the
|
|
5217
|
+
* feature tracks a single provider. Mutually exclusive with `providerProperty`.
|
|
4593
5218
|
*/
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
5219
|
+
provider?: string;
|
|
5220
|
+
/**
|
|
5221
|
+
* Meter group-by property that holds the model ID. Use this when the meter has a
|
|
5222
|
+
* group-by dimension for model. Mutually exclusive with `model`.
|
|
5223
|
+
*/
|
|
5224
|
+
modelProperty?: string;
|
|
5225
|
+
/**
|
|
5226
|
+
* Static model ID value (e.g., "gpt-4", "claude-3-5-sonnet"). Use this when the
|
|
5227
|
+
* feature tracks a single model. Mutually exclusive with `modelProperty`.
|
|
5228
|
+
*/
|
|
5229
|
+
model?: string;
|
|
5230
|
+
/**
|
|
5231
|
+
* Meter group-by property that holds the token type. Use this when the meter has a
|
|
5232
|
+
* group-by dimension for token type. Mutually exclusive with `tokenType`.
|
|
5233
|
+
*/
|
|
5234
|
+
tokenTypeProperty?: string;
|
|
5235
|
+
/**
|
|
5236
|
+
* Static token type value. Use this when the feature tracks a single token type
|
|
5237
|
+
* (e.g., only input tokens). Expected values: input, output, cache_read,
|
|
5238
|
+
* reasoning, cache_write, request, response. `request` is an alias for `input`,
|
|
5239
|
+
* `response` is an alias for `output`. Mutually exclusive with
|
|
5240
|
+
* `tokenTypeProperty`.
|
|
5241
|
+
*/
|
|
5242
|
+
tokenType?: string;
|
|
5243
|
+
/**
|
|
5244
|
+
* Resolved per-token pricing from the LLM cost database. Only populated in
|
|
5245
|
+
* responses when the feature's meter group-by filters specify exact provider and
|
|
5246
|
+
* model values.
|
|
5247
|
+
*/
|
|
5248
|
+
pricing?: NotificationEventV1FeatureLlmUnitCostPricing;
|
|
5249
|
+
}
|
|
5250
|
+
/** A price tier. At least one price component is required in each tier. */
|
|
5251
|
+
export interface NotificationEventV1PriceTier {
|
|
5252
|
+
/**
|
|
5253
|
+
* Up to and including to this quantity will be contained in the tier. If null, the
|
|
5254
|
+
* tier is open-ended.
|
|
5255
|
+
*/
|
|
5256
|
+
upToAmount?: string;
|
|
5257
|
+
/** The flat price component of the tier. */
|
|
5258
|
+
flatPrice: NotificationEventV1FlatPrice | null;
|
|
5259
|
+
/** The unit price component of the tier. */
|
|
5260
|
+
unitPrice: NotificationEventV1UnitPrice | null;
|
|
5261
|
+
}
|
|
5262
|
+
/** Subscription is an exact subscription instance. */
|
|
5263
|
+
export interface NotificationEventV1Subscription {
|
|
5264
|
+
/** A unique identifier for the resource. */
|
|
5265
|
+
id: string;
|
|
5266
|
+
/** Human-readable name for the resource. Between 1 and 256 characters. */
|
|
5267
|
+
name: string;
|
|
5268
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
5269
|
+
description?: string;
|
|
5270
|
+
/** Additional metadata for the resource. */
|
|
5271
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
5272
|
+
/** Timestamp of when the resource was created. */
|
|
5273
|
+
createdAt: Date;
|
|
5274
|
+
/** Timestamp of when the resource was last updated. */
|
|
5275
|
+
updatedAt: Date;
|
|
5276
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
5277
|
+
deletedAt?: Date;
|
|
5278
|
+
/** The cadence start of the resource. */
|
|
5279
|
+
activeFrom: Date;
|
|
5280
|
+
/** The cadence end of the resource. */
|
|
5281
|
+
activeTo?: Date;
|
|
5282
|
+
/** Set of key-value pairs managed by the system. Cannot be modified by user. */
|
|
5283
|
+
annotations?: NotificationEventV1Annotations;
|
|
5284
|
+
/** Alignment configuration for the plan. */
|
|
5285
|
+
alignment?: NotificationEventV1Alignment;
|
|
5286
|
+
/** The status of the subscription. */
|
|
5287
|
+
status: 'active' | 'inactive' | 'canceled' | 'scheduled';
|
|
5288
|
+
/** The customer ID of the subscription. */
|
|
5289
|
+
customerId: string;
|
|
5290
|
+
/** The plan of the subscription. */
|
|
5291
|
+
plan?: NotificationEventV1PlanReference;
|
|
5292
|
+
/** The fiat currency in which the subscription is invoiced. */
|
|
5293
|
+
currency: string;
|
|
5294
|
+
/**
|
|
5295
|
+
* Controls whether custom-currency cost bases are resolved dynamically or pinned
|
|
5296
|
+
* when their currency pair is introduced to the subscription.
|
|
5297
|
+
*/
|
|
5298
|
+
costBasisMode: 'dynamic' | 'pinned';
|
|
5299
|
+
/** Cost bases pinned to custom-currency pairs for this subscription. */
|
|
5300
|
+
costBasisPins: NotificationEventV1SubscriptionCostBasisPin[];
|
|
5301
|
+
/**
|
|
5302
|
+
* The billing cadence for the subscriptions. Defines how often customers are
|
|
5303
|
+
* billed using ISO8601 duration format. Examples: "P1M" (monthly), "P3M"
|
|
5304
|
+
* (quarterly), "P1Y" (annually).
|
|
5305
|
+
*/
|
|
5306
|
+
billingCadence: string;
|
|
5307
|
+
/** The pro-rating configuration for the subscriptions. */
|
|
5308
|
+
proRatingConfig?: NotificationEventV1ProRatingConfig;
|
|
5309
|
+
/** The normalizedbilling anchor of the subscription. */
|
|
5310
|
+
billingAnchor: Date;
|
|
5311
|
+
/**
|
|
5312
|
+
* The settlement mode of the subscription.
|
|
5313
|
+
*
|
|
5314
|
+
* - credit_then_invoice: credits from the previous billing period are applied
|
|
5315
|
+
* first, then the remaining balance is invoiced.
|
|
5316
|
+
* - credit_only: only credits from the previous billing period are generated and
|
|
5317
|
+
* applied. No invoices are generated for the subscription. This is the default
|
|
5318
|
+
* and most common settlement mode.
|
|
5319
|
+
*/
|
|
5320
|
+
settlementMode: 'credit_then_invoice' | 'credit_only';
|
|
5321
|
+
}
|
|
5322
|
+
/** Party represents a person or business entity. */
|
|
5323
|
+
export interface NotificationEventV1BillingParty {
|
|
5324
|
+
/** Unique identifier for the party (if available) */
|
|
5325
|
+
id?: string;
|
|
5326
|
+
/** An optional unique key of the party (if available) */
|
|
5327
|
+
key?: string;
|
|
5328
|
+
/** Legal name or representation of the organization. */
|
|
5329
|
+
name?: string;
|
|
5330
|
+
/**
|
|
5331
|
+
* The entity's legal ID code used for tax purposes. They may have other numbers,
|
|
5332
|
+
* but we're only interested in those valid for tax purposes.
|
|
5333
|
+
*/
|
|
5334
|
+
taxId?: NotificationEventV1BillingPartyTaxIdentity;
|
|
5335
|
+
/** Regular post addresses for where information should be sent if needed. */
|
|
5336
|
+
addresses?: NotificationEventV1Address[];
|
|
5337
|
+
}
|
|
5338
|
+
/**
|
|
5339
|
+
* BillingInvoiceCustomerExtendedDetails is a collection of fields that are used to
|
|
5340
|
+
* extend the billing party details for invoices.
|
|
5341
|
+
*
|
|
5342
|
+
* These fields contain the OpenMeter specific details for the customer, that are
|
|
5343
|
+
* not strictly required for the invoice itself.
|
|
5344
|
+
*/
|
|
5345
|
+
export interface NotificationEventV1BillingInvoiceCustomerExtendedDetails {
|
|
5346
|
+
/** Unique identifier for the party (if available) */
|
|
5347
|
+
id?: string;
|
|
5348
|
+
/** An optional unique key of the party (if available) */
|
|
5349
|
+
key?: string;
|
|
5350
|
+
/** Legal name or representation of the organization. */
|
|
5351
|
+
name?: string;
|
|
5352
|
+
/**
|
|
5353
|
+
* The entity's legal ID code used for tax purposes. They may have other numbers,
|
|
5354
|
+
* but we're only interested in those valid for tax purposes.
|
|
5355
|
+
*/
|
|
5356
|
+
taxId?: NotificationEventV1BillingPartyTaxIdentity;
|
|
5357
|
+
/** Regular post addresses for where information should be sent if needed. */
|
|
5358
|
+
addresses?: NotificationEventV1Address[];
|
|
5359
|
+
/** Mapping to attribute metered usage to the customer */
|
|
5360
|
+
usageAttribution: NotificationEventV1CustomerUsageAttribution;
|
|
5361
|
+
}
|
|
5362
|
+
/**
|
|
5363
|
+
* InvoiceStatusDetails represents the details of the invoice status.
|
|
5364
|
+
*
|
|
5365
|
+
* API users are encouraged to rely on the immutable/failed/avaliableActions fields
|
|
5366
|
+
* to determine the next steps of the invoice instead of the extendedStatus field.
|
|
5367
|
+
*/
|
|
5368
|
+
export interface NotificationEventV1InvoiceStatusDetails {
|
|
5369
|
+
/** Is the invoice editable? */
|
|
5370
|
+
immutable: boolean;
|
|
5371
|
+
/** Is the invoice in a failed state? */
|
|
5372
|
+
failed: boolean;
|
|
5373
|
+
/** Extended status information for the invoice. */
|
|
5374
|
+
extendedStatus: string;
|
|
5375
|
+
/** The actions that can be performed on the invoice. */
|
|
5376
|
+
availableActions: NotificationEventV1InvoiceAvailableActions;
|
|
5377
|
+
}
|
|
5378
|
+
/**
|
|
5379
|
+
* A marketplace listing. Represent an available app in the app marketplace that
|
|
5380
|
+
* can be installed to the organization.
|
|
5381
|
+
*
|
|
5382
|
+
* Marketplace apps only exist in config so they don't extend the Resource model.
|
|
5383
|
+
*/
|
|
5384
|
+
export interface NotificationEventV1MarketplaceListing {
|
|
5385
|
+
/** The app's type */
|
|
5386
|
+
type: 'stripe' | 'sandbox' | 'custom_invoicing';
|
|
5387
|
+
/** The app's name. */
|
|
5388
|
+
name: string;
|
|
5389
|
+
/** The app's description. */
|
|
5390
|
+
description: string;
|
|
5391
|
+
/** The app's capabilities. */
|
|
5392
|
+
capabilities: NotificationEventV1AppCapability[];
|
|
5393
|
+
/**
|
|
5394
|
+
* Install methods.
|
|
5395
|
+
*
|
|
5396
|
+
* List of methods to install the app.
|
|
5397
|
+
*/
|
|
5398
|
+
installMethods: ('with_oauth2' | 'with_api_key' | 'no_credentials_required')[];
|
|
5399
|
+
}
|
|
5400
|
+
/**
|
|
5401
|
+
* BillingWorkflowInvoicingSettings represents the invoice settings for a billing
|
|
5402
|
+
* workflow
|
|
5403
|
+
*/
|
|
5404
|
+
export interface NotificationEventV1BillingWorkflowInvoicingSettings {
|
|
5405
|
+
/** Whether to automatically issue the invoice after the draftPeriod has passed. */
|
|
5406
|
+
autoAdvance?: boolean;
|
|
5407
|
+
/** The period for the invoice to be kept in draft status for manual reviews. */
|
|
5408
|
+
draftPeriod?: string;
|
|
5409
|
+
/**
|
|
5410
|
+
* The period after which the invoice is due. With some payment solutions it's only
|
|
5411
|
+
* applicable for manual collection method.
|
|
5412
|
+
*/
|
|
5413
|
+
dueAfter?: string;
|
|
5414
|
+
/** Should progressive billing be allowed for this workflow? */
|
|
5415
|
+
progressiveBilling?: boolean;
|
|
5416
|
+
/** Controls how subscription-ending shortened service periods are billed. */
|
|
5417
|
+
subscriptionEndProrationMode?: 'bill_full_period' | 'bill_actual_period';
|
|
5418
|
+
/**
|
|
5419
|
+
* Default tax configuration to apply to the invoices.
|
|
5420
|
+
*
|
|
5421
|
+
* Setting a tax code (`stripe.code` / `taxCodeId`) on a profile's default tax
|
|
5422
|
+
* config is deprecated and can no longer be added or changed: the organization
|
|
5423
|
+
* default tax code is used instead. Existing tax-code values may still be removed,
|
|
5424
|
+
* and `behavior` remains fully supported.
|
|
5425
|
+
*/
|
|
5426
|
+
defaultTaxConfig?: NotificationEventV1TaxConfig;
|
|
5427
|
+
}
|
|
5428
|
+
/** TaxConfig stores the configuration for a tax line relative to an invoice line. */
|
|
5429
|
+
export interface NotificationEventV1InvoiceLineTaxItem {
|
|
5430
|
+
/** Tax provider configuration. */
|
|
5431
|
+
config?: NotificationEventV1TaxConfig;
|
|
5432
|
+
/**
|
|
5433
|
+
* Percent defines the percentage set manually or determined from the rate key
|
|
5434
|
+
* (calculated if rate present). A nil percent implies that this tax combo is
|
|
5435
|
+
* **exempt** from tax.")
|
|
5436
|
+
*/
|
|
5437
|
+
percent?: number;
|
|
5438
|
+
/** Some countries require an additional surcharge (calculated if rate present). */
|
|
5439
|
+
surcharge?: string;
|
|
5440
|
+
/** Is the tax item inclusive or exclusive of the base amount. */
|
|
5441
|
+
behavior?: 'inclusive' | 'exclusive';
|
|
5442
|
+
}
|
|
5443
|
+
/** A discount by type. */
|
|
5444
|
+
export interface NotificationEventV1BillingDiscounts {
|
|
5445
|
+
/** The percentage discount. */
|
|
5446
|
+
percentage?: NotificationEventV1BillingDiscountPercentage;
|
|
5447
|
+
/** The usage discount. */
|
|
5448
|
+
usage?: NotificationEventV1BillingDiscountUsage;
|
|
5449
|
+
}
|
|
5450
|
+
/** PaymentTermDueDate defines the terms for payment on a specific date. */
|
|
5451
|
+
export interface NotificationEventV1PaymentTermDueDate {
|
|
5452
|
+
/** Type of terms to be applied. */
|
|
5453
|
+
type: 'due_date';
|
|
5454
|
+
/** Text detail of the chosen payment terms. */
|
|
5455
|
+
detail?: string;
|
|
5456
|
+
/** Description of the conditions for payment. */
|
|
5457
|
+
notes?: string;
|
|
5458
|
+
/** When the payment is due. */
|
|
5459
|
+
dueAt: NotificationEventV1PaymentDueDate[];
|
|
5460
|
+
}
|
|
5461
|
+
/** Billing customer data. */
|
|
5462
|
+
export interface CustomerData {
|
|
5463
|
+
/**
|
|
5464
|
+
* The billing profile explicitly selected for the customer.
|
|
5465
|
+
*
|
|
5466
|
+
* Unpinned customers use the current namespace default. Selecting the current
|
|
5467
|
+
* default explicitly pins the customer to that profile.
|
|
5468
|
+
*/
|
|
5469
|
+
billingProfile?: ProfileReference | null;
|
|
5470
|
+
/**
|
|
5471
|
+
* The effective billing profile for the customer. Uses the explicitly selected
|
|
5472
|
+
* billing profile when pinned, otherwise the current default billing profile.
|
|
5473
|
+
*/
|
|
5474
|
+
effectiveBillingProfile: ProfileReference;
|
|
5475
|
+
/** App customer data. */
|
|
5476
|
+
appData?: AppCustomerData;
|
|
5477
|
+
}
|
|
5478
|
+
/** CustomerBillingData upsert request. */
|
|
5479
|
+
export interface UpsertCustomerBillingDataRequest {
|
|
5480
|
+
/**
|
|
5481
|
+
* The billing profile explicitly selected for the customer.
|
|
5482
|
+
*
|
|
5483
|
+
* Unpinned customers use the current namespace default. Selecting the current
|
|
5484
|
+
* default explicitly pins the customer to that profile.
|
|
5485
|
+
*/
|
|
5486
|
+
billingProfile?: ProfileReference | null;
|
|
5487
|
+
/** App customer data. */
|
|
5488
|
+
appData?: AppCustomerData;
|
|
5489
|
+
}
|
|
5490
|
+
/**
|
|
5491
|
+
* Flat fee intent fields from the system lifecycle controller shadowed by a manual
|
|
5492
|
+
* override.
|
|
5493
|
+
*/
|
|
5494
|
+
export interface ChargeFlatFeeSystemIntent {
|
|
5495
|
+
/**
|
|
5496
|
+
* Display name of the resource.
|
|
5497
|
+
*
|
|
5498
|
+
* Between 1 and 256 characters.
|
|
5499
|
+
*/
|
|
5500
|
+
name: string;
|
|
5501
|
+
/**
|
|
5502
|
+
* Optional description of the resource.
|
|
5503
|
+
*
|
|
5504
|
+
* Maximum 1024 characters.
|
|
5505
|
+
*/
|
|
5506
|
+
description?: string;
|
|
5507
|
+
labels?: Labels;
|
|
5508
|
+
/** The timestamp when the charge is intended to be invoiced. */
|
|
5509
|
+
invoiceAt: Date;
|
|
4598
5510
|
/** The effective service period covered by the charge. */
|
|
4599
5511
|
servicePeriod: ClosedPeriod;
|
|
4600
5512
|
/** The full, unprorated service period of the charge. */
|
|
@@ -4620,37 +5532,6 @@ export interface ListCustomerEntitlementAccessResponseData {
|
|
|
4620
5532
|
/** The list of entitlement access results. */
|
|
4621
5533
|
data: EntitlementValueResult[];
|
|
4622
5534
|
}
|
|
4623
|
-
/** The entities and threshold a balance threshold event refers to. */
|
|
4624
|
-
export interface NotificationEventBalanceThresholdData {
|
|
4625
|
-
/** The identifier of the entitlement that triggered the event. */
|
|
4626
|
-
entitlementId: string;
|
|
4627
|
-
/** The feature the entitlement grants access to. */
|
|
4628
|
-
feature: NotificationEventFeatureReference;
|
|
4629
|
-
/** The key of the subject the entitlement belongs to. */
|
|
4630
|
-
subjectKey: string;
|
|
4631
|
-
/** The identifier of the customer the subject belongs to, if any. */
|
|
4632
|
-
customerId?: string;
|
|
4633
|
-
/** The entitlement value at the time the event was generated. */
|
|
4634
|
-
value: EntitlementValueResult;
|
|
4635
|
-
/** The threshold the balance crossed. */
|
|
4636
|
-
threshold: NotificationBalanceThreshold;
|
|
4637
|
-
}
|
|
4638
|
-
/**
|
|
4639
|
-
* The entitlement, feature, and subject an entitlement notification event refers
|
|
4640
|
-
* to.
|
|
4641
|
-
*/
|
|
4642
|
-
export interface NotificationEventEntitlementData {
|
|
4643
|
-
/** The identifier of the entitlement that triggered the event. */
|
|
4644
|
-
entitlementId: string;
|
|
4645
|
-
/** The feature the entitlement grants access to. */
|
|
4646
|
-
feature: NotificationEventFeatureReference;
|
|
4647
|
-
/** The key of the subject the entitlement belongs to. */
|
|
4648
|
-
subjectKey: string;
|
|
4649
|
-
/** The identifier of the customer the subject belongs to, if any. */
|
|
4650
|
-
customerId?: string;
|
|
4651
|
-
/** The entitlement value at the time the event was generated. */
|
|
4652
|
-
value: EntitlementValueResult;
|
|
4653
|
-
}
|
|
4654
5535
|
/**
|
|
4655
5536
|
* Graduated tiered price.
|
|
4656
5537
|
*
|
|
@@ -4888,28 +5769,6 @@ export interface PlanAddonPagePaginatedResponse {
|
|
|
4888
5769
|
data: PlanAddon[];
|
|
4889
5770
|
meta: PaginatedMeta;
|
|
4890
5771
|
}
|
|
4891
|
-
/** An invoice created notification event payload. */
|
|
4892
|
-
export interface NotificationEventInvoiceCreatedPayload {
|
|
4893
|
-
/** The identifier of the event the payload belongs to. */
|
|
4894
|
-
id: string;
|
|
4895
|
-
/** The type of the event. */
|
|
4896
|
-
type: 'invoice.created';
|
|
4897
|
-
/** When the event was generated. */
|
|
4898
|
-
timestamp: Date;
|
|
4899
|
-
/** The invoice the event refers to. */
|
|
4900
|
-
data: NotificationEventInvoiceData;
|
|
4901
|
-
}
|
|
4902
|
-
/** An invoice updated notification event payload. */
|
|
4903
|
-
export interface NotificationEventInvoiceUpdatedPayload {
|
|
4904
|
-
/** The identifier of the event the payload belongs to. */
|
|
4905
|
-
id: string;
|
|
4906
|
-
/** The type of the event. */
|
|
4907
|
-
type: 'invoice.updated';
|
|
4908
|
-
/** When the event was generated. */
|
|
4909
|
-
timestamp: Date;
|
|
4910
|
-
/** The invoice the event refers to. */
|
|
4911
|
-
data: NotificationEventInvoiceData;
|
|
4912
|
-
}
|
|
4913
5772
|
/** Cursor paginated response. */
|
|
4914
5773
|
export interface IngestedEventPaginatedResponse {
|
|
4915
5774
|
data: IngestedEvent[];
|
|
@@ -5541,27 +6400,324 @@ export interface EntitlementAccessQueryResult {
|
|
|
5541
6400
|
*/
|
|
5542
6401
|
updatedAt: Date;
|
|
5543
6402
|
}
|
|
5544
|
-
/**
|
|
5545
|
-
|
|
5546
|
-
|
|
6403
|
+
/**
|
|
6404
|
+
* Metered entitlements are useful for many different use cases, from setting up
|
|
6405
|
+
* usage based access to implementing complex credit systems. Access is determined
|
|
6406
|
+
* based on feature usage using a balance calculation (the "usage allowance"
|
|
6407
|
+
* provided by the issued grants is "burnt down" by the usage).
|
|
6408
|
+
*/
|
|
6409
|
+
export interface NotificationEventV1EntitlementMetered {
|
|
6410
|
+
/** type. */
|
|
6411
|
+
type: 'metered';
|
|
6412
|
+
/**
|
|
6413
|
+
* If softLimit=true the subject can use the feature even if the entitlement is
|
|
6414
|
+
* exhausted, hasAccess will always be true.
|
|
6415
|
+
*/
|
|
6416
|
+
isSoftLimit?: boolean;
|
|
6417
|
+
/**
|
|
6418
|
+
* Deprecated, ignored by the backend. Please use isSoftLimit instead; this field
|
|
6419
|
+
* will be removed in the future.
|
|
6420
|
+
*/
|
|
6421
|
+
isUnlimited?: boolean;
|
|
6422
|
+
/**
|
|
6423
|
+
* You can grant usage automatically alongside the entitlement, the example
|
|
6424
|
+
* scenario would be creating a starting balance. If an amount is specified here, a
|
|
6425
|
+
* grant will be created alongside the entitlement with the specified amount. That
|
|
6426
|
+
* grant will have it's rollover settings configured in a way that after each reset
|
|
6427
|
+
* operation, the balance will return the original amount specified here. Manually
|
|
6428
|
+
* creating such a grant would mean having the "amount", "minRolloverAmount", and
|
|
6429
|
+
* "maxRolloverAmount" fields all be the same.
|
|
6430
|
+
*/
|
|
6431
|
+
issueAfterReset?: number;
|
|
6432
|
+
/** Defines the grant priority for the default grant. */
|
|
6433
|
+
issueAfterResetPriority?: number;
|
|
6434
|
+
/** If true, the overage is preserved at reset. If false, the usage is reset to 0. */
|
|
6435
|
+
preserveOverageAtReset?: boolean;
|
|
6436
|
+
/** Timestamp of when the resource was created. */
|
|
6437
|
+
createdAt: Date;
|
|
6438
|
+
/** Timestamp of when the resource was last updated. */
|
|
6439
|
+
updatedAt: Date;
|
|
6440
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
6441
|
+
deletedAt?: Date;
|
|
6442
|
+
/** Additional metadata for the feature. */
|
|
6443
|
+
metadata?: NotificationEventV1Metadata;
|
|
6444
|
+
/** The cadence start of the resource. */
|
|
6445
|
+
activeFrom: Date;
|
|
6446
|
+
/** The cadence end of the resource. */
|
|
6447
|
+
activeTo?: Date;
|
|
6448
|
+
/** The annotations of the entitlement. */
|
|
6449
|
+
annotations?: NotificationEventV1Annotations;
|
|
6450
|
+
/** Readonly unique ULID identifier. */
|
|
5547
6451
|
id: string;
|
|
5548
|
-
/**
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
6452
|
+
/**
|
|
6453
|
+
* The identifier key unique to the subject. NOTE: Subjects are being deprecated,
|
|
6454
|
+
* please use the new customer APIs.
|
|
6455
|
+
*/
|
|
6456
|
+
subjectKey: string;
|
|
6457
|
+
/** The feature the subject is entitled to use. */
|
|
6458
|
+
featureKey: string;
|
|
6459
|
+
/** The feature the subject is entitled to use. */
|
|
6460
|
+
featureId: string;
|
|
6461
|
+
/** The time the last reset happened. */
|
|
6462
|
+
lastReset: Date;
|
|
6463
|
+
/** The current usage period. */
|
|
6464
|
+
currentUsagePeriod: NotificationEventV1Period;
|
|
6465
|
+
/**
|
|
6466
|
+
* The time from which usage is measured. If not specified on creation, defaults to
|
|
6467
|
+
* entitlement creation time.
|
|
6468
|
+
*/
|
|
6469
|
+
measureUsageFrom: Date;
|
|
6470
|
+
/** THe usage period of the entitlement. */
|
|
6471
|
+
usagePeriod: NotificationEventV1RecurringPeriod;
|
|
5554
6472
|
}
|
|
5555
|
-
/**
|
|
5556
|
-
|
|
5557
|
-
|
|
6473
|
+
/**
|
|
6474
|
+
* BillingWorkflowCollectionAlignmentAnchored specifies the alignment for
|
|
6475
|
+
* collecting the pending line items into an invoice.
|
|
6476
|
+
*/
|
|
6477
|
+
export interface NotificationEventV1BillingWorkflowCollectionAlignmentAnchored {
|
|
6478
|
+
/** The type of alignment. */
|
|
6479
|
+
type: 'anchored';
|
|
6480
|
+
/** The recurring period for the alignment. */
|
|
6481
|
+
recurringPeriod: NotificationEventV1RecurringPeriodV2;
|
|
6482
|
+
}
|
|
6483
|
+
/** Tiered price with spend commitments. */
|
|
6484
|
+
export interface NotificationEventV1TieredPriceWithCommitments {
|
|
6485
|
+
/**
|
|
6486
|
+
* The type of the price.
|
|
6487
|
+
*
|
|
6488
|
+
* One of: flat, unit, or tiered.
|
|
6489
|
+
*/
|
|
6490
|
+
type: 'tiered';
|
|
6491
|
+
/**
|
|
6492
|
+
* Defines if the tiering mode is volume-based or graduated:
|
|
6493
|
+
*
|
|
6494
|
+
* - In `volume`-based tiering, the maximum quantity within a period determines the
|
|
6495
|
+
* per unit price.
|
|
6496
|
+
* - In `graduated` tiering, pricing can change as the quantity grows.
|
|
6497
|
+
*/
|
|
6498
|
+
mode: 'volume' | 'graduated';
|
|
6499
|
+
/**
|
|
6500
|
+
* The tiers of the tiered price. At least one price component is required in each
|
|
6501
|
+
* tier.
|
|
6502
|
+
*/
|
|
6503
|
+
tiers: NotificationEventV1PriceTier[];
|
|
6504
|
+
/** The customer is committed to spend at least the amount. */
|
|
6505
|
+
minimumAmount?: string;
|
|
6506
|
+
/** The customer is limited to spend at most the amount. */
|
|
6507
|
+
maximumAmount?: string;
|
|
6508
|
+
}
|
|
6509
|
+
/** A customer object. */
|
|
6510
|
+
export interface NotificationEventV1Customer {
|
|
6511
|
+
/** A unique identifier for the resource. */
|
|
5558
6512
|
id: string;
|
|
5559
|
-
/**
|
|
5560
|
-
|
|
5561
|
-
/**
|
|
5562
|
-
|
|
5563
|
-
/**
|
|
5564
|
-
|
|
6513
|
+
/** Human-readable name for the resource. Between 1 and 256 characters. */
|
|
6514
|
+
name: string;
|
|
6515
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
6516
|
+
description?: string;
|
|
6517
|
+
/** Additional metadata for the resource. */
|
|
6518
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
6519
|
+
/** Timestamp of when the resource was created. */
|
|
6520
|
+
createdAt: Date;
|
|
6521
|
+
/** Timestamp of when the resource was last updated. */
|
|
6522
|
+
updatedAt: Date;
|
|
6523
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
6524
|
+
deletedAt?: Date;
|
|
6525
|
+
/**
|
|
6526
|
+
* An optional unique key of the customer. Either key or
|
|
6527
|
+
* usageAttribution.subjectKeys must be provided. Useful to reference the customer
|
|
6528
|
+
* in external systems. For example, your database ID.
|
|
6529
|
+
*/
|
|
6530
|
+
key?: string;
|
|
6531
|
+
/**
|
|
6532
|
+
* Mapping to attribute metered usage to the customer Either key or
|
|
6533
|
+
* usageAttribution.subjectKeys must be provided.
|
|
6534
|
+
*/
|
|
6535
|
+
usageAttribution?: NotificationEventV1CustomerUsageAttribution;
|
|
6536
|
+
/** The primary email address of the customer. */
|
|
6537
|
+
primaryEmail?: string;
|
|
6538
|
+
/** Currency of the customer. Used for billing, tax and invoicing. */
|
|
6539
|
+
currency?: string;
|
|
6540
|
+
/** The billing address of the customer. Used for tax and invoicing. */
|
|
6541
|
+
billingAddress?: NotificationEventV1Address;
|
|
6542
|
+
/** The ID of the Subscription if the customer has one. */
|
|
6543
|
+
currentSubscriptionId?: string;
|
|
6544
|
+
/** The subscriptions of the customer. Only with the `subscriptions` expand option. */
|
|
6545
|
+
subscriptions?: NotificationEventV1Subscription[];
|
|
6546
|
+
/** Set of key-value pairs managed by the system. Cannot be modified by user. */
|
|
6547
|
+
annotations?: NotificationEventV1Annotations;
|
|
6548
|
+
}
|
|
6549
|
+
/** A installed Stripe app object. */
|
|
6550
|
+
export interface NotificationEventV1StripeApp {
|
|
6551
|
+
/** A unique identifier for the resource. */
|
|
6552
|
+
id: string;
|
|
6553
|
+
/** Human-readable name for the resource. Between 1 and 256 characters. */
|
|
6554
|
+
name: string;
|
|
6555
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
6556
|
+
description?: string;
|
|
6557
|
+
/** Additional metadata for the resource. */
|
|
6558
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
6559
|
+
/** Timestamp of when the resource was created. */
|
|
6560
|
+
createdAt: Date;
|
|
6561
|
+
/** Timestamp of when the resource was last updated. */
|
|
6562
|
+
updatedAt: Date;
|
|
6563
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
6564
|
+
deletedAt?: Date;
|
|
6565
|
+
/** The marketplace listing that this installed app is based on. */
|
|
6566
|
+
listing: NotificationEventV1MarketplaceListing;
|
|
6567
|
+
/** Status of the app connection. */
|
|
6568
|
+
status: 'ready' | 'unauthorized';
|
|
6569
|
+
/** The app's type is Stripe. */
|
|
6570
|
+
type: 'stripe';
|
|
6571
|
+
/** The Stripe account ID. */
|
|
6572
|
+
stripeAccountId: string;
|
|
6573
|
+
/** Livemode, true if the app is in production mode. */
|
|
6574
|
+
livemode: boolean;
|
|
6575
|
+
/** The masked API key. Only shows the first 8 and last 3 characters. */
|
|
6576
|
+
maskedApiKey: string;
|
|
6577
|
+
}
|
|
6578
|
+
/**
|
|
6579
|
+
* Sandbox app can be used for testing OpenMeter features.
|
|
6580
|
+
*
|
|
6581
|
+
* The app is not creating anything in external systems, thus it is safe to use for
|
|
6582
|
+
* verifying OpenMeter features.
|
|
6583
|
+
*/
|
|
6584
|
+
export interface NotificationEventV1SandboxApp {
|
|
6585
|
+
/** A unique identifier for the resource. */
|
|
6586
|
+
id: string;
|
|
6587
|
+
/** Human-readable name for the resource. Between 1 and 256 characters. */
|
|
6588
|
+
name: string;
|
|
6589
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
6590
|
+
description?: string;
|
|
6591
|
+
/** Additional metadata for the resource. */
|
|
6592
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
6593
|
+
/** Timestamp of when the resource was created. */
|
|
6594
|
+
createdAt: Date;
|
|
6595
|
+
/** Timestamp of when the resource was last updated. */
|
|
6596
|
+
updatedAt: Date;
|
|
6597
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
6598
|
+
deletedAt?: Date;
|
|
6599
|
+
/** The marketplace listing that this installed app is based on. */
|
|
6600
|
+
listing: NotificationEventV1MarketplaceListing;
|
|
6601
|
+
/** Status of the app connection. */
|
|
6602
|
+
status: 'ready' | 'unauthorized';
|
|
6603
|
+
/** The app's type is Sandbox. */
|
|
6604
|
+
type: 'sandbox';
|
|
6605
|
+
}
|
|
6606
|
+
/**
|
|
6607
|
+
* Custom Invoicing app can be used for interface with any invoicing or payment
|
|
6608
|
+
* system.
|
|
6609
|
+
*
|
|
6610
|
+
* This app provides ways to manipulate invoices and payments, however the
|
|
6611
|
+
* integration must rely on Notifications API to get notified about invoice
|
|
6612
|
+
* changes.
|
|
6613
|
+
*/
|
|
6614
|
+
export interface NotificationEventV1CustomInvoicingApp {
|
|
6615
|
+
/** A unique identifier for the resource. */
|
|
6616
|
+
id: string;
|
|
6617
|
+
/** Human-readable name for the resource. Between 1 and 256 characters. */
|
|
6618
|
+
name: string;
|
|
6619
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
6620
|
+
description?: string;
|
|
6621
|
+
/** Additional metadata for the resource. */
|
|
6622
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
6623
|
+
/** Timestamp of when the resource was created. */
|
|
6624
|
+
createdAt: Date;
|
|
6625
|
+
/** Timestamp of when the resource was last updated. */
|
|
6626
|
+
updatedAt: Date;
|
|
6627
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
6628
|
+
deletedAt?: Date;
|
|
6629
|
+
/** The marketplace listing that this installed app is based on. */
|
|
6630
|
+
listing: NotificationEventV1MarketplaceListing;
|
|
6631
|
+
/** Status of the app connection. */
|
|
6632
|
+
status: 'ready' | 'unauthorized';
|
|
6633
|
+
/** The app's type is CustomInvoicing. */
|
|
6634
|
+
type: 'custom_invoicing';
|
|
6635
|
+
/**
|
|
6636
|
+
* Enable draft.sync hook.
|
|
6637
|
+
*
|
|
6638
|
+
* If the hook is not enabled, the invoice will be progressed to the next state
|
|
6639
|
+
* automatically.
|
|
6640
|
+
*/
|
|
6641
|
+
enableDraftSyncHook: boolean;
|
|
6642
|
+
/**
|
|
6643
|
+
* Enable issuing.sync hook.
|
|
6644
|
+
*
|
|
6645
|
+
* If the hook is not enabled, the invoice will be progressed to the next state
|
|
6646
|
+
* automatically.
|
|
6647
|
+
*/
|
|
6648
|
+
enableIssuingSyncHook: boolean;
|
|
6649
|
+
}
|
|
6650
|
+
/**
|
|
6651
|
+
* InvoiceLineAmountDiscount represents an amount deducted from the line, and will
|
|
6652
|
+
* be applied before taxes.
|
|
6653
|
+
*/
|
|
6654
|
+
export interface NotificationEventV1InvoiceLineAmountDiscount {
|
|
6655
|
+
/** Timestamp of when the resource was created. */
|
|
6656
|
+
createdAt: Date;
|
|
6657
|
+
/** Timestamp of when the resource was last updated. */
|
|
6658
|
+
updatedAt: Date;
|
|
6659
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
6660
|
+
deletedAt?: Date;
|
|
6661
|
+
/** ID of the charge or discount. */
|
|
6662
|
+
id: string;
|
|
6663
|
+
/** Reason code. */
|
|
6664
|
+
reason: NotificationEventV1BillingDiscountReason;
|
|
6665
|
+
/** Text description as to why the discount was applied. */
|
|
6666
|
+
description?: string;
|
|
6667
|
+
/** External IDs of the invoice in other apps such as Stripe. */
|
|
6668
|
+
externalIds?: NotificationEventV1InvoiceLineAppExternalIds;
|
|
6669
|
+
/** Fixed discount amount to apply (calculated if percent present). */
|
|
6670
|
+
amount: string;
|
|
6671
|
+
}
|
|
6672
|
+
/**
|
|
6673
|
+
* InvoiceLineUsageDiscount represents an usage-based discount applied to the line.
|
|
6674
|
+
*
|
|
6675
|
+
* The deduction is done before the pricing algorithm is applied.
|
|
6676
|
+
*/
|
|
6677
|
+
export interface NotificationEventV1InvoiceLineUsageDiscount {
|
|
6678
|
+
/** Timestamp of when the resource was created. */
|
|
6679
|
+
createdAt: Date;
|
|
6680
|
+
/** Timestamp of when the resource was last updated. */
|
|
6681
|
+
updatedAt: Date;
|
|
6682
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
6683
|
+
deletedAt?: Date;
|
|
6684
|
+
/** ID of the charge or discount. */
|
|
6685
|
+
id: string;
|
|
6686
|
+
/** Reason code. */
|
|
6687
|
+
reason: NotificationEventV1BillingDiscountReason;
|
|
6688
|
+
/** Text description as to why the discount was applied. */
|
|
6689
|
+
description?: string;
|
|
6690
|
+
/** External IDs of the invoice in other apps such as Stripe. */
|
|
6691
|
+
externalIds?: NotificationEventV1InvoiceLineAppExternalIds;
|
|
6692
|
+
/** The usage to apply. */
|
|
6693
|
+
quantity: string;
|
|
6694
|
+
/**
|
|
6695
|
+
* The usage discount already applied to the previous split lines.
|
|
6696
|
+
*
|
|
6697
|
+
* Only set if progressive billing is enabled and the line is a split line.
|
|
6698
|
+
*/
|
|
6699
|
+
preLinePeriodQuantity?: string;
|
|
6700
|
+
}
|
|
6701
|
+
/**
|
|
6702
|
+
* InvoiceDetailedLineRateCard represents the rate card (intent) for a flat fee
|
|
6703
|
+
* line.
|
|
6704
|
+
*/
|
|
6705
|
+
export interface NotificationEventV1InvoiceDetailedLineRateCard {
|
|
6706
|
+
/**
|
|
6707
|
+
* The tax config of the rate card. When undefined, the tax config of the feature
|
|
6708
|
+
* or the default tax config of the plan is used.
|
|
6709
|
+
*/
|
|
6710
|
+
taxConfig?: NotificationEventV1TaxConfig;
|
|
6711
|
+
/** The price of the rate card. When null, the feature or service is free. */
|
|
6712
|
+
price: NotificationEventV1FlatPriceWithPaymentTerm | null;
|
|
6713
|
+
/**
|
|
6714
|
+
* Quantity of the item being sold.
|
|
6715
|
+
*
|
|
6716
|
+
* Default: 1
|
|
6717
|
+
*/
|
|
6718
|
+
quantity?: string;
|
|
6719
|
+
/** The discounts that are applied to the line. */
|
|
6720
|
+
discounts?: NotificationEventV1BillingDiscounts;
|
|
5565
6721
|
}
|
|
5566
6722
|
/** A capability or billable dimension offered by a provider. */
|
|
5567
6723
|
export interface Feature {
|
|
@@ -5973,12 +7129,79 @@ export interface EntitlementAccessQueryResponse {
|
|
|
5973
7129
|
* Pagination metadata. The endpoint may return a partial response if the full
|
|
5974
7130
|
* response would exceed server-side limits.
|
|
5975
7131
|
*/
|
|
5976
|
-
meta: CursorMeta;
|
|
7132
|
+
meta: CursorMeta;
|
|
7133
|
+
}
|
|
7134
|
+
/** Page paginated response. */
|
|
7135
|
+
export interface NotificationRulePagePaginatedResponse {
|
|
7136
|
+
data: NotificationRule[];
|
|
7137
|
+
meta: PaginatedMeta;
|
|
7138
|
+
}
|
|
7139
|
+
/**
|
|
7140
|
+
* Represents a feature that can be enabled or disabled for a plan. Used both for
|
|
7141
|
+
* product catalog and entitlements.
|
|
7142
|
+
*/
|
|
7143
|
+
export interface NotificationEventV1Feature {
|
|
7144
|
+
/** Timestamp of when the resource was created. */
|
|
7145
|
+
createdAt: Date;
|
|
7146
|
+
/** Timestamp of when the resource was last updated. */
|
|
7147
|
+
updatedAt: Date;
|
|
7148
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
7149
|
+
deletedAt?: Date;
|
|
7150
|
+
/** Timestamp of when the resource was archived. */
|
|
7151
|
+
archivedAt?: Date;
|
|
7152
|
+
/** A key is a unique string that is used to identify a resource. */
|
|
7153
|
+
key: string;
|
|
7154
|
+
/** The human-readable name of the feature. */
|
|
7155
|
+
name: string;
|
|
7156
|
+
/** Optional metadata. */
|
|
7157
|
+
metadata?: NotificationEventV1Metadata;
|
|
7158
|
+
/** A key is a unique string that is used to identify a resource. */
|
|
7159
|
+
meterSlug?: string;
|
|
7160
|
+
/**
|
|
7161
|
+
* Optional meter group by filters. Useful if the meter scope is broader than what
|
|
7162
|
+
* feature tracks. Example scenario would be a meter tracking all token use with
|
|
7163
|
+
* groupBy fields for the model, then the feature could filter for model=gpt-4.
|
|
7164
|
+
*
|
|
7165
|
+
* ⚠️ **Deprecated**: Use advancedMeterGroupByFilters instead
|
|
7166
|
+
*/
|
|
7167
|
+
meterGroupByFilters?: Record<string, string>;
|
|
7168
|
+
/**
|
|
7169
|
+
* Optional advanced meter group by filters. You can use this to filter for values
|
|
7170
|
+
* of the meter groupBy fields.
|
|
7171
|
+
*/
|
|
7172
|
+
advancedMeterGroupByFilters?: Record<string, NotificationEventV1FilterString>;
|
|
7173
|
+
/**
|
|
7174
|
+
* Optional per-unit cost configuration. Use "manual" for a fixed per-unit cost, or
|
|
7175
|
+
* "llm" to look up cost from the LLM cost database based on meter group-by
|
|
7176
|
+
* properties.
|
|
7177
|
+
*/
|
|
7178
|
+
unitCost?: NotificationEventV1FeatureUnitCost;
|
|
7179
|
+
/** Readonly unique ULID identifier. */
|
|
7180
|
+
id: string;
|
|
7181
|
+
}
|
|
7182
|
+
/**
|
|
7183
|
+
* InvoiceLineDiscounts represents the discounts applied to the invoice line by
|
|
7184
|
+
* type.
|
|
7185
|
+
*/
|
|
7186
|
+
export interface NotificationEventV1InvoiceLineDiscounts {
|
|
7187
|
+
/**
|
|
7188
|
+
* Amount based discounts applied to the line.
|
|
7189
|
+
*
|
|
7190
|
+
* Amount based discounts are deduced from the total price of the line.
|
|
7191
|
+
*/
|
|
7192
|
+
amount?: NotificationEventV1InvoiceLineAmountDiscount[];
|
|
7193
|
+
/**
|
|
7194
|
+
* Usage based discounts applied to the line.
|
|
7195
|
+
*
|
|
7196
|
+
* Usage based discounts are deduced from the usage of the line before price
|
|
7197
|
+
* calculations are applied.
|
|
7198
|
+
*/
|
|
7199
|
+
usage?: NotificationEventV1InvoiceLineUsageDiscount[];
|
|
5977
7200
|
}
|
|
5978
|
-
/**
|
|
5979
|
-
export interface
|
|
5980
|
-
|
|
5981
|
-
|
|
7201
|
+
/** Payment contains details as to how the invoice should be paid. */
|
|
7202
|
+
export interface NotificationEventV1InvoicePaymentTerms {
|
|
7203
|
+
/** The terms of payment for the invoice. */
|
|
7204
|
+
terms?: NotificationEventV1PaymentTerms;
|
|
5982
7205
|
}
|
|
5983
7206
|
/** A rate card defines the pricing and entitlement of a feature or service. */
|
|
5984
7207
|
export interface RateCard {
|
|
@@ -6223,23 +7446,159 @@ export interface ProfileApps {
|
|
|
6223
7446
|
payment: App;
|
|
6224
7447
|
}
|
|
6225
7448
|
/**
|
|
6226
|
-
*
|
|
6227
|
-
*
|
|
6228
|
-
* system and cannot be modified.
|
|
7449
|
+
* Workflow collection specifies how to collect the pending line items for an
|
|
7450
|
+
* invoice
|
|
6229
7451
|
*/
|
|
6230
|
-
export interface
|
|
6231
|
-
/** The
|
|
6232
|
-
|
|
6233
|
-
/**
|
|
6234
|
-
|
|
6235
|
-
|
|
7452
|
+
export interface NotificationEventV1BillingWorkflowCollectionSettings {
|
|
7453
|
+
/** The alignment for collecting the pending line items into an invoice. */
|
|
7454
|
+
alignment?: NotificationEventV1BillingWorkflowCollectionAlignment;
|
|
7455
|
+
/**
|
|
7456
|
+
* This grace period can be used to delay the collection of the pending line items
|
|
7457
|
+
* specified in alignment.
|
|
7458
|
+
*
|
|
7459
|
+
* This is useful, in case of multiple subscriptions having slightly different
|
|
7460
|
+
* billing periods.
|
|
7461
|
+
*/
|
|
7462
|
+
interval?: string;
|
|
7463
|
+
}
|
|
7464
|
+
/**
|
|
7465
|
+
* Data of the payload for notification event with `entitlements.balance.threshold`
|
|
7466
|
+
* type.
|
|
7467
|
+
*/
|
|
7468
|
+
export interface NotificationEventV1BalanceThresholdPayloadData {
|
|
7469
|
+
/** Entitlement. */
|
|
7470
|
+
entitlement: NotificationEventV1EntitlementMetered;
|
|
7471
|
+
/** Feature. */
|
|
7472
|
+
feature: NotificationEventV1Feature;
|
|
7473
|
+
/** Subject. */
|
|
7474
|
+
subject: NotificationEventV1Subject;
|
|
7475
|
+
/** Entitlement Value. */
|
|
7476
|
+
value: NotificationEventV1EntitlementValue;
|
|
7477
|
+
/** Customer. */
|
|
7478
|
+
customer?: NotificationEventV1Customer;
|
|
7479
|
+
/** Threshold. */
|
|
7480
|
+
threshold: NotificationEventV1RuleBalanceThresholdValue;
|
|
7481
|
+
}
|
|
7482
|
+
/** Base data for any payload with entitlement entitlement value. */
|
|
7483
|
+
export interface NotificationEventV1EntitlementValuePayloadBase {
|
|
7484
|
+
/** Entitlement. */
|
|
7485
|
+
entitlement: NotificationEventV1EntitlementMetered;
|
|
7486
|
+
/** Feature. */
|
|
7487
|
+
feature: NotificationEventV1Feature;
|
|
7488
|
+
/** Subject. */
|
|
7489
|
+
subject: NotificationEventV1Subject;
|
|
7490
|
+
/** Entitlement Value. */
|
|
7491
|
+
value: NotificationEventV1EntitlementValue;
|
|
7492
|
+
/** Customer. */
|
|
7493
|
+
customer?: NotificationEventV1Customer;
|
|
7494
|
+
}
|
|
7495
|
+
/**
|
|
7496
|
+
* InvoiceUsageBasedRateCard represents the rate card (intent) for an usage-based
|
|
7497
|
+
* line.
|
|
7498
|
+
*/
|
|
7499
|
+
export interface NotificationEventV1InvoiceUsageBasedRateCard {
|
|
7500
|
+
/** The feature the customer is entitled to use. */
|
|
7501
|
+
featureKey?: string;
|
|
7502
|
+
/**
|
|
7503
|
+
* The tax config of the rate card. When undefined, the tax config of the feature
|
|
7504
|
+
* or the default tax config of the plan is used.
|
|
7505
|
+
*/
|
|
7506
|
+
taxConfig?: NotificationEventV1TaxConfig;
|
|
7507
|
+
/** The price of the rate card. When null, the feature or service is free. */
|
|
7508
|
+
price: NotificationEventV1RateCardUsageBasedPrice | null;
|
|
7509
|
+
/** The discounts that are applied to the line. */
|
|
7510
|
+
discounts?: NotificationEventV1BillingDiscounts;
|
|
7511
|
+
}
|
|
7512
|
+
/** BillingProfileApps represents the applications used by a billing profile */
|
|
7513
|
+
export interface NotificationEventV1BillingProfileApps {
|
|
7514
|
+
/** The tax app used for this workflow */
|
|
7515
|
+
tax: NotificationEventV1App | null;
|
|
7516
|
+
/** The invoicing app used for this workflow */
|
|
7517
|
+
invoicing: NotificationEventV1App | null;
|
|
7518
|
+
/** The payment app used for this workflow */
|
|
7519
|
+
payment: NotificationEventV1App | null;
|
|
7520
|
+
}
|
|
7521
|
+
/**
|
|
7522
|
+
* InvoiceDetailedLine represents a line item that is sold to the customer as a
|
|
7523
|
+
* manually added fee.
|
|
7524
|
+
*/
|
|
7525
|
+
export interface NotificationEventV1InvoiceDetailedLine {
|
|
7526
|
+
/** Human-readable name for the resource. Between 1 and 256 characters. */
|
|
7527
|
+
name: string;
|
|
7528
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
7529
|
+
description?: string;
|
|
7530
|
+
/** Additional metadata for the resource. */
|
|
7531
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
7532
|
+
/** Timestamp of when the resource was created. */
|
|
6236
7533
|
createdAt: Date;
|
|
6237
|
-
/**
|
|
6238
|
-
|
|
6239
|
-
/**
|
|
6240
|
-
|
|
6241
|
-
/**
|
|
6242
|
-
|
|
7534
|
+
/** Timestamp of when the resource was last updated. */
|
|
7535
|
+
updatedAt: Date;
|
|
7536
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
7537
|
+
deletedAt?: Date;
|
|
7538
|
+
/** ID of the line. */
|
|
7539
|
+
id: string;
|
|
7540
|
+
/**
|
|
7541
|
+
* managedBy specifies if the line is manually added via the api or managed by
|
|
7542
|
+
* OpenMeter.
|
|
7543
|
+
*/
|
|
7544
|
+
managedBy: 'subscription' | 'system' | 'manual';
|
|
7545
|
+
/**
|
|
7546
|
+
* Status of the line.
|
|
7547
|
+
*
|
|
7548
|
+
* External calls always create valid lines, other line types are managed by the
|
|
7549
|
+
* billing engine of OpenMeter.
|
|
7550
|
+
*/
|
|
7551
|
+
status: 'valid' | 'detailed' | 'split';
|
|
7552
|
+
/**
|
|
7553
|
+
* Discounts detailes applied to this line.
|
|
7554
|
+
*
|
|
7555
|
+
* New discounts can be added via the invoice's discounts API, to facilitate
|
|
7556
|
+
* discounts that are affecting multiple lines.
|
|
7557
|
+
*/
|
|
7558
|
+
discounts?: NotificationEventV1InvoiceLineDiscounts;
|
|
7559
|
+
/**
|
|
7560
|
+
* Credit allocations applied to this line.
|
|
7561
|
+
*
|
|
7562
|
+
* Credits are deducted from the line total before taxes are applied.
|
|
7563
|
+
*/
|
|
7564
|
+
creditAllocations?: NotificationEventV1InvoiceLineCreditAllocation[];
|
|
7565
|
+
/** The invoice this item belongs to. */
|
|
7566
|
+
invoice?: NotificationEventV1InvoiceReference;
|
|
7567
|
+
/** The currency of this line. */
|
|
7568
|
+
currency: string;
|
|
7569
|
+
/** Taxes applied to the invoice totals. */
|
|
7570
|
+
taxes?: NotificationEventV1InvoiceLineTaxItem[];
|
|
7571
|
+
/** Tax config specify the tax configuration for this line. */
|
|
7572
|
+
taxConfig?: NotificationEventV1TaxConfig;
|
|
7573
|
+
/** Totals for this line. */
|
|
7574
|
+
totals: NotificationEventV1InvoiceTotals;
|
|
7575
|
+
/**
|
|
7576
|
+
* Period of the line item applies to for revenue recognition pruposes.
|
|
7577
|
+
*
|
|
7578
|
+
* Billing always treats periods as start being inclusive and end being exclusive.
|
|
7579
|
+
*/
|
|
7580
|
+
period: NotificationEventV1Period;
|
|
7581
|
+
/** External IDs of the invoice in other apps such as Stripe. */
|
|
7582
|
+
externalIds?: NotificationEventV1InvoiceLineAppExternalIds;
|
|
7583
|
+
/**
|
|
7584
|
+
* Subscription are the references to the subscritpions that this line is related
|
|
7585
|
+
* to.
|
|
7586
|
+
*/
|
|
7587
|
+
subscription?: NotificationEventV1InvoiceLineSubscriptionReference;
|
|
7588
|
+
/** The time this line item should be invoiced. */
|
|
7589
|
+
invoiceAt: Date;
|
|
7590
|
+
/** Type of the line. */
|
|
7591
|
+
type: 'flat_fee';
|
|
7592
|
+
/** Price of the item being sold. */
|
|
7593
|
+
perUnitAmount?: string;
|
|
7594
|
+
/** Payment term of the line. */
|
|
7595
|
+
paymentTerm?: 'in_advance' | 'in_arrears';
|
|
7596
|
+
/** Quantity of the item being sold. */
|
|
7597
|
+
quantity?: string;
|
|
7598
|
+
/** The rate card that is used for this line. */
|
|
7599
|
+
rateCard?: NotificationEventV1InvoiceDetailedLineRateCard;
|
|
7600
|
+
/** Category of the flat fee. */
|
|
7601
|
+
category?: 'regular' | 'commitment';
|
|
6243
7602
|
}
|
|
6244
7603
|
/** A subscription item pins a rate card to a cadence within a subscription phase. */
|
|
6245
7604
|
export interface SubscriptionItem {
|
|
@@ -6678,10 +8037,151 @@ export interface ChargeRealization {
|
|
|
6678
8037
|
*/
|
|
6679
8038
|
detailedLines?: ChargeRealizationDetailedLine[];
|
|
6680
8039
|
}
|
|
6681
|
-
/**
|
|
6682
|
-
export interface
|
|
6683
|
-
|
|
6684
|
-
|
|
8040
|
+
/** BillingWorkflow represents the settings for a billing workflow. */
|
|
8041
|
+
export interface NotificationEventV1BillingWorkflow {
|
|
8042
|
+
/** The collection settings for this workflow */
|
|
8043
|
+
collection?: NotificationEventV1BillingWorkflowCollectionSettings;
|
|
8044
|
+
/** The invoicing settings for this workflow */
|
|
8045
|
+
invoicing?: NotificationEventV1BillingWorkflowInvoicingSettings;
|
|
8046
|
+
/** The payment settings for this workflow */
|
|
8047
|
+
payment?: NotificationEventV1BillingWorkflowPaymentSettings;
|
|
8048
|
+
/** The tax settings for this workflow */
|
|
8049
|
+
tax?: NotificationEventV1BillingWorkflowTaxSettings;
|
|
8050
|
+
}
|
|
8051
|
+
/** A balance threshold notification event payload. */
|
|
8052
|
+
export interface NotificationEventBalanceThresholdPayload {
|
|
8053
|
+
/** The identifier of the event the payload belongs to. */
|
|
8054
|
+
id: string;
|
|
8055
|
+
/** The type of the event. */
|
|
8056
|
+
type: 'entitlements.balance.threshold';
|
|
8057
|
+
/** When the event was generated. */
|
|
8058
|
+
timestamp: Date;
|
|
8059
|
+
/** The entities and threshold the event refers to. */
|
|
8060
|
+
data: NotificationEventV1BalanceThresholdPayloadData;
|
|
8061
|
+
}
|
|
8062
|
+
/** An entitlement reset notification event payload. */
|
|
8063
|
+
export interface NotificationEventResetPayload {
|
|
8064
|
+
/** The identifier of the event the payload belongs to. */
|
|
8065
|
+
id: string;
|
|
8066
|
+
/** The type of the event. */
|
|
8067
|
+
type: 'entitlements.reset';
|
|
8068
|
+
/** When the event was generated. */
|
|
8069
|
+
timestamp: Date;
|
|
8070
|
+
/** The entities the event refers to. */
|
|
8071
|
+
data: NotificationEventV1EntitlementValuePayloadBase;
|
|
8072
|
+
}
|
|
8073
|
+
/**
|
|
8074
|
+
* InvoiceUsageBasedLine represents a line item that is sold to the customer based
|
|
8075
|
+
* on usage.
|
|
8076
|
+
*/
|
|
8077
|
+
export interface NotificationEventV1InvoiceLine {
|
|
8078
|
+
/** Human-readable name for the resource. Between 1 and 256 characters. */
|
|
8079
|
+
name: string;
|
|
8080
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
8081
|
+
description?: string;
|
|
8082
|
+
/** Additional metadata for the resource. */
|
|
8083
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
8084
|
+
/** Timestamp of when the resource was created. */
|
|
8085
|
+
createdAt: Date;
|
|
8086
|
+
/** Timestamp of when the resource was last updated. */
|
|
8087
|
+
updatedAt: Date;
|
|
8088
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
8089
|
+
deletedAt?: Date;
|
|
8090
|
+
/** ID of the line. */
|
|
8091
|
+
id: string;
|
|
8092
|
+
/**
|
|
8093
|
+
* managedBy specifies if the line is manually added via the api or managed by
|
|
8094
|
+
* OpenMeter.
|
|
8095
|
+
*/
|
|
8096
|
+
managedBy: 'subscription' | 'system' | 'manual';
|
|
8097
|
+
/**
|
|
8098
|
+
* Status of the line.
|
|
8099
|
+
*
|
|
8100
|
+
* External calls always create valid lines, other line types are managed by the
|
|
8101
|
+
* billing engine of OpenMeter.
|
|
8102
|
+
*/
|
|
8103
|
+
status: 'valid' | 'detailed' | 'split';
|
|
8104
|
+
/**
|
|
8105
|
+
* Discounts detailes applied to this line.
|
|
8106
|
+
*
|
|
8107
|
+
* New discounts can be added via the invoice's discounts API, to facilitate
|
|
8108
|
+
* discounts that are affecting multiple lines.
|
|
8109
|
+
*/
|
|
8110
|
+
discounts?: NotificationEventV1InvoiceLineDiscounts;
|
|
8111
|
+
/**
|
|
8112
|
+
* Credit allocations applied to this line.
|
|
8113
|
+
*
|
|
8114
|
+
* Credits are deducted from the line total before taxes are applied.
|
|
8115
|
+
*/
|
|
8116
|
+
creditAllocations?: NotificationEventV1InvoiceLineCreditAllocation[];
|
|
8117
|
+
/** The invoice this item belongs to. */
|
|
8118
|
+
invoice?: NotificationEventV1InvoiceReference;
|
|
8119
|
+
/** The currency of this line. */
|
|
8120
|
+
currency: string;
|
|
8121
|
+
/** Taxes applied to the invoice totals. */
|
|
8122
|
+
taxes?: NotificationEventV1InvoiceLineTaxItem[];
|
|
8123
|
+
/** Tax config specify the tax configuration for this line. */
|
|
8124
|
+
taxConfig?: NotificationEventV1TaxConfig;
|
|
8125
|
+
/** Totals for this line. */
|
|
8126
|
+
totals: NotificationEventV1InvoiceTotals;
|
|
8127
|
+
/**
|
|
8128
|
+
* Period of the line item applies to for revenue recognition pruposes.
|
|
8129
|
+
*
|
|
8130
|
+
* Billing always treats periods as start being inclusive and end being exclusive.
|
|
8131
|
+
*/
|
|
8132
|
+
period: NotificationEventV1Period;
|
|
8133
|
+
/** The time this line item should be invoiced. */
|
|
8134
|
+
invoiceAt: Date;
|
|
8135
|
+
/** External IDs of the invoice in other apps such as Stripe. */
|
|
8136
|
+
externalIds?: NotificationEventV1InvoiceLineAppExternalIds;
|
|
8137
|
+
/**
|
|
8138
|
+
* Subscription are the references to the subscritpions that this line is related
|
|
8139
|
+
* to.
|
|
8140
|
+
*/
|
|
8141
|
+
subscription?: NotificationEventV1InvoiceLineSubscriptionReference;
|
|
8142
|
+
/** Type of the line. */
|
|
8143
|
+
type: 'usage_based';
|
|
8144
|
+
/** Price of the usage-based item being sold. */
|
|
8145
|
+
price?: NotificationEventV1RateCardUsageBasedPrice;
|
|
8146
|
+
/** The feature that the usage is based on. */
|
|
8147
|
+
featureKey?: string;
|
|
8148
|
+
/** The lines detailing the item or service sold. */
|
|
8149
|
+
children?: NotificationEventV1InvoiceDetailedLine[];
|
|
8150
|
+
/**
|
|
8151
|
+
* The rate card that is used for this line.
|
|
8152
|
+
*
|
|
8153
|
+
* The rate card captures the intent of the price and discounts for the usage-based
|
|
8154
|
+
* item.
|
|
8155
|
+
*/
|
|
8156
|
+
rateCard?: NotificationEventV1InvoiceUsageBasedRateCard;
|
|
8157
|
+
/**
|
|
8158
|
+
* The quantity of the item being sold.
|
|
8159
|
+
*
|
|
8160
|
+
* Any usage discounts applied previously are deducted from this quantity.
|
|
8161
|
+
*/
|
|
8162
|
+
quantity?: string;
|
|
8163
|
+
/**
|
|
8164
|
+
* The quantity of the item that has been metered for the period before any
|
|
8165
|
+
* discounts were applied.
|
|
8166
|
+
*/
|
|
8167
|
+
meteredQuantity?: string;
|
|
8168
|
+
/**
|
|
8169
|
+
* The quantity of the item used before this line's period.
|
|
8170
|
+
*
|
|
8171
|
+
* It is non-zero in case of progressive billing, when this shows how much of the
|
|
8172
|
+
* usage was already billed.
|
|
8173
|
+
*
|
|
8174
|
+
* Any usage discounts applied previously are deducted from this quantity.
|
|
8175
|
+
*/
|
|
8176
|
+
preLinePeriodQuantity?: string;
|
|
8177
|
+
/**
|
|
8178
|
+
* The metered quantity of the item used in before this line's period without any
|
|
8179
|
+
* discounts applied.
|
|
8180
|
+
*
|
|
8181
|
+
* It is non-zero in case of progressive billing, when this shows how much of the
|
|
8182
|
+
* usage was already billed.
|
|
8183
|
+
*/
|
|
8184
|
+
meteredPreLinePeriodQuantity?: string;
|
|
6685
8185
|
}
|
|
6686
8186
|
/**
|
|
6687
8187
|
* A subscription phase groups the rate cards in effect for a segment of the
|
|
@@ -6958,6 +8458,31 @@ export interface ProfilePagePaginatedResponse {
|
|
|
6958
8458
|
data: Profile[];
|
|
6959
8459
|
meta: PaginatedMeta;
|
|
6960
8460
|
}
|
|
8461
|
+
/**
|
|
8462
|
+
* InvoiceWorkflowSettings represents the workflow settings used by the invoice.
|
|
8463
|
+
*
|
|
8464
|
+
* This is a clone of the billing profile's workflow settings at the time of
|
|
8465
|
+
* invoice creation with customer overrides considered.
|
|
8466
|
+
*/
|
|
8467
|
+
export interface NotificationEventV1InvoiceWorkflowSettings {
|
|
8468
|
+
/**
|
|
8469
|
+
* The apps that will be used to orchestrate the invoice's workflow.
|
|
8470
|
+
*
|
|
8471
|
+
* The v1 schema allows app references here too, but the v1 Event payloads always
|
|
8472
|
+
* carry the full apps.
|
|
8473
|
+
*/
|
|
8474
|
+
apps?: NotificationEventV1BillingProfileApps;
|
|
8475
|
+
/**
|
|
8476
|
+
* sourceBillingProfileID is the billing profile on which the workflow was based
|
|
8477
|
+
* on.
|
|
8478
|
+
*
|
|
8479
|
+
* The profile is snapshotted on invoice creation, after which it can be altered
|
|
8480
|
+
* independently of the profile itself.
|
|
8481
|
+
*/
|
|
8482
|
+
sourceBillingProfileId: string;
|
|
8483
|
+
/** The workflow details used by this invoice. */
|
|
8484
|
+
workflow: NotificationEventV1BillingWorkflow;
|
|
8485
|
+
}
|
|
6961
8486
|
/** Subscription. */
|
|
6962
8487
|
export interface Subscription {
|
|
6963
8488
|
id: string;
|
|
@@ -7313,6 +8838,124 @@ export interface UpdateInvoiceStandardRequest {
|
|
|
7313
8838
|
*/
|
|
7314
8839
|
lines?: UpdateInvoiceLine[];
|
|
7315
8840
|
}
|
|
8841
|
+
/** Invoice represents an invoice in the system. */
|
|
8842
|
+
export interface NotificationEventV1Invoice {
|
|
8843
|
+
/** A unique identifier for the resource. */
|
|
8844
|
+
id: string;
|
|
8845
|
+
/** Optional description of the resource. Maximum 1024 characters. */
|
|
8846
|
+
description?: string;
|
|
8847
|
+
/** Additional metadata for the resource. */
|
|
8848
|
+
metadata?: NotificationEventV1Metadata | null;
|
|
8849
|
+
/** Timestamp of when the resource was created. */
|
|
8850
|
+
createdAt: Date;
|
|
8851
|
+
/** Timestamp of when the resource was last updated. */
|
|
8852
|
+
updatedAt: Date;
|
|
8853
|
+
/** Timestamp of when the resource was permanently deleted. */
|
|
8854
|
+
deletedAt?: Date;
|
|
8855
|
+
/**
|
|
8856
|
+
* Type of the invoice.
|
|
8857
|
+
*
|
|
8858
|
+
* The type of invoice determines the purpose of the invoice and how it should be
|
|
8859
|
+
* handled.
|
|
8860
|
+
*
|
|
8861
|
+
* Supported types:
|
|
8862
|
+
*
|
|
8863
|
+
* - standard: A regular commercial invoice document between a supplier and
|
|
8864
|
+
* customer.
|
|
8865
|
+
* - credit_note: Reflects a refund either partial or complete of the preceding
|
|
8866
|
+
* document. A credit note effectively _extends_ the previous document.
|
|
8867
|
+
*/
|
|
8868
|
+
type: 'standard' | 'credit_note';
|
|
8869
|
+
/** The taxable entity supplying the goods or services. */
|
|
8870
|
+
supplier: NotificationEventV1BillingParty;
|
|
8871
|
+
/** Legal entity receiving the goods or services. */
|
|
8872
|
+
customer: NotificationEventV1BillingInvoiceCustomerExtendedDetails;
|
|
8873
|
+
/**
|
|
8874
|
+
* Number specifies the human readable key used to reference this Invoice.
|
|
8875
|
+
*
|
|
8876
|
+
* The invoice number can change in the draft phases, as we are allocating
|
|
8877
|
+
* temporary draft invoice numbers, but it's final as soon as the invoice gets
|
|
8878
|
+
* finalized (issued state).
|
|
8879
|
+
*
|
|
8880
|
+
* Please note that the number is (depending on the upstream settings) either
|
|
8881
|
+
* unique for the whole organization or unique for the customer, or in multi
|
|
8882
|
+
* (stripe) account setups unique for the account.
|
|
8883
|
+
*/
|
|
8884
|
+
number: string;
|
|
8885
|
+
/**
|
|
8886
|
+
* Currency for all invoice line items.
|
|
8887
|
+
*
|
|
8888
|
+
* Multi currency invoices are not supported yet.
|
|
8889
|
+
*/
|
|
8890
|
+
currency: string;
|
|
8891
|
+
/**
|
|
8892
|
+
* Key information regarding previous invoices and potentially details as to why
|
|
8893
|
+
* they were corrected.
|
|
8894
|
+
*/
|
|
8895
|
+
preceding?: NotificationEventV1InvoiceDocumentRef[];
|
|
8896
|
+
/** Summary of all the invoice totals, including taxes (calculated). */
|
|
8897
|
+
totals: NotificationEventV1InvoiceTotals;
|
|
8898
|
+
/**
|
|
8899
|
+
* The status of the invoice.
|
|
8900
|
+
*
|
|
8901
|
+
* This field only conatins a simplified status, for more detailed information use
|
|
8902
|
+
* the statusDetails field.
|
|
8903
|
+
*/
|
|
8904
|
+
status: 'gathering' | 'draft' | 'issuing' | 'issued' | 'payment_processing' | 'overdue' | 'paid' | 'uncollectible' | 'voided';
|
|
8905
|
+
/** The details of the current invoice status. */
|
|
8906
|
+
statusDetails: NotificationEventV1InvoiceStatusDetails;
|
|
8907
|
+
/**
|
|
8908
|
+
* The time the invoice was issued.
|
|
8909
|
+
*
|
|
8910
|
+
* Depending on the status of the invoice this can mean multiple things:
|
|
8911
|
+
*
|
|
8912
|
+
* - draft, gathering: The time the invoice will be issued based on the workflow
|
|
8913
|
+
* settings.
|
|
8914
|
+
* - issued: The time the invoice was issued.
|
|
8915
|
+
*/
|
|
8916
|
+
issuedAt?: Date;
|
|
8917
|
+
/**
|
|
8918
|
+
* The time until the invoice is in draft status.
|
|
8919
|
+
*
|
|
8920
|
+
* On draft invoice creation it is calculated from the workflow settings.
|
|
8921
|
+
*
|
|
8922
|
+
* If manual approval is required, the draftUntil time is set.
|
|
8923
|
+
*/
|
|
8924
|
+
draftUntil?: Date;
|
|
8925
|
+
/** The time when the quantity snapshots on the invoice lines were taken. */
|
|
8926
|
+
quantitySnapshotedAt?: Date;
|
|
8927
|
+
/** The time when the invoice will be/has been collected. */
|
|
8928
|
+
collectionAt?: Date;
|
|
8929
|
+
/** Due time of the fulfillment of the invoice (if available). */
|
|
8930
|
+
dueAt?: Date;
|
|
8931
|
+
/** The period the invoice covers. If the invoice has no line items, it's not set. */
|
|
8932
|
+
period?: NotificationEventV1Period;
|
|
8933
|
+
/**
|
|
8934
|
+
* The time the invoice was voided.
|
|
8935
|
+
*
|
|
8936
|
+
* If the invoice was voided, this field will be set to the time the invoice was
|
|
8937
|
+
* voided.
|
|
8938
|
+
*/
|
|
8939
|
+
voidedAt?: Date;
|
|
8940
|
+
/** The time the invoice was sent to customer. */
|
|
8941
|
+
sentToCustomerAt?: Date;
|
|
8942
|
+
/**
|
|
8943
|
+
* The workflow associated with the invoice.
|
|
8944
|
+
*
|
|
8945
|
+
* It is always a snapshot of the workflow settings at the time of invoice
|
|
8946
|
+
* creation. The field is optional as it should be explicitly requested with expand
|
|
8947
|
+
* options.
|
|
8948
|
+
*/
|
|
8949
|
+
workflow: NotificationEventV1InvoiceWorkflowSettings;
|
|
8950
|
+
/** List of invoice lines representing each of the items sold to the customer. */
|
|
8951
|
+
lines?: NotificationEventV1InvoiceLine[];
|
|
8952
|
+
/** Information on when, how, and to whom the invoice should be paid. */
|
|
8953
|
+
payment?: NotificationEventV1InvoicePaymentTerms;
|
|
8954
|
+
/** Validation issues reported by the invoice workflow. */
|
|
8955
|
+
validationIssues?: NotificationEventV1ValidationIssue[];
|
|
8956
|
+
/** External IDs of the invoice in other apps such as Stripe. */
|
|
8957
|
+
externalIds?: NotificationEventV1InvoiceAppExternalIds;
|
|
8958
|
+
}
|
|
7316
8959
|
/** Page paginated response. */
|
|
7317
8960
|
export interface SubscriptionPagePaginatedResponse {
|
|
7318
8961
|
data: Subscription[];
|
|
@@ -7336,6 +8979,28 @@ export interface SubscriptionMigrateResponse {
|
|
|
7336
8979
|
/** The resulting subscription, including its phases and items. */
|
|
7337
8980
|
next: Subscription;
|
|
7338
8981
|
}
|
|
8982
|
+
/** An invoice created notification event payload. */
|
|
8983
|
+
export interface NotificationEventInvoiceCreatedPayload {
|
|
8984
|
+
/** The identifier of the event the payload belongs to. */
|
|
8985
|
+
id: string;
|
|
8986
|
+
/** The type of the event. */
|
|
8987
|
+
type: 'invoice.created';
|
|
8988
|
+
/** When the event was generated. */
|
|
8989
|
+
timestamp: Date;
|
|
8990
|
+
/** The invoice the event refers to. */
|
|
8991
|
+
data: NotificationEventV1Invoice;
|
|
8992
|
+
}
|
|
8993
|
+
/** An invoice updated notification event payload. */
|
|
8994
|
+
export interface NotificationEventInvoiceUpdatedPayload {
|
|
8995
|
+
/** The identifier of the event the payload belongs to. */
|
|
8996
|
+
id: string;
|
|
8997
|
+
/** The type of the event. */
|
|
8998
|
+
type: 'invoice.updated';
|
|
8999
|
+
/** When the event was generated. */
|
|
9000
|
+
timestamp: Date;
|
|
9001
|
+
/** The invoice the event refers to. */
|
|
9002
|
+
data: NotificationEventV1Invoice;
|
|
9003
|
+
}
|
|
7339
9004
|
/** A flat fee charge for a customer. */
|
|
7340
9005
|
export interface ChargeFlatFee {
|
|
7341
9006
|
id: string;
|
|
@@ -7569,11 +9234,35 @@ export interface InvoicePagePaginatedResponse {
|
|
|
7569
9234
|
data: Invoice[];
|
|
7570
9235
|
meta: PaginatedMeta;
|
|
7571
9236
|
}
|
|
9237
|
+
/**
|
|
9238
|
+
* A notification event records that a notification rule fired and tracks the
|
|
9239
|
+
* delivery of its payload to each channel of the rule. Events are created by the
|
|
9240
|
+
* system and cannot be modified.
|
|
9241
|
+
*/
|
|
9242
|
+
export interface NotificationEvent {
|
|
9243
|
+
/** The unique identifier of the event. */
|
|
9244
|
+
id: string;
|
|
9245
|
+
/** The type of the event. */
|
|
9246
|
+
type: 'entitlements.balance.threshold' | 'entitlements.reset' | 'invoice.created' | 'invoice.updated';
|
|
9247
|
+
/** When the event was generated. */
|
|
9248
|
+
createdAt: Date;
|
|
9249
|
+
/** The rule that generated the event. */
|
|
9250
|
+
rule: NotificationRuleReference;
|
|
9251
|
+
/** The delivery status of the event, one entry per channel of the rule. */
|
|
9252
|
+
deliveryStatus: NotificationEventDeliveryStatus[];
|
|
9253
|
+
/** The payload delivered to the channels. */
|
|
9254
|
+
payload: NotificationEventPayload;
|
|
9255
|
+
}
|
|
7572
9256
|
/** Page paginated response. */
|
|
7573
9257
|
export interface ChargePagePaginatedResponse {
|
|
7574
9258
|
data: Charge[];
|
|
7575
9259
|
meta: PaginatedMeta;
|
|
7576
9260
|
}
|
|
9261
|
+
/** Page paginated response. */
|
|
9262
|
+
export interface NotificationEventPagePaginatedResponse {
|
|
9263
|
+
data: NotificationEvent[];
|
|
9264
|
+
meta: PaginatedMeta;
|
|
9265
|
+
}
|
|
7577
9266
|
/**
|
|
7578
9267
|
* Filters on the given string field value by either exact or fuzzy match. All
|
|
7579
9268
|
* properties are optional; provide exactly one to specify the comparison.
|
|
@@ -7662,6 +9351,8 @@ export type AppActionRequest = AppReconcileWebhookEventsActionRequest;
|
|
|
7662
9351
|
export type InstallAppRequest = InstallAppStripeWithApiKey | InstallAppSandbox | InstallAppExternalInvoicing;
|
|
7663
9352
|
/** Payment settings for a billing workflow. */
|
|
7664
9353
|
export type UpdateBillingWorkflowPaymentSettings = UpdateBillingWorkflowPaymentChargeAutomaticallySettings | UpdateBillingWorkflowPaymentSendInvoiceSettings;
|
|
9354
|
+
/** Period duration for the recurrence */
|
|
9355
|
+
export type NotificationEventV1RecurringPeriodInterval = string | 'DAY' | 'WEEK' | 'MONTH' | 'YEAR';
|
|
7665
9356
|
/**
|
|
7666
9357
|
* Cost basis selection for a custom-currency charge. The variant chosen fixes when
|
|
7667
9358
|
* and how the conversion rate is determined.
|
|
@@ -7681,6 +9372,8 @@ export type InvalidParameter = InvalidParameterStandard | InvalidParameterMinimu
|
|
|
7681
9372
|
export type RateCardEntitlement = RateCardMeteredEntitlement | RateCardStaticEntitlement | RateCardBooleanEntitlement;
|
|
7682
9373
|
/** Request to update an installed app. */
|
|
7683
9374
|
export type UpdateAppRequest = UpdateAppStripeRequest | UpdateAppSandboxRequest | UpdateAppExternalInvoicingRequest;
|
|
9375
|
+
/** The reason for the discount. */
|
|
9376
|
+
export type NotificationEventV1BillingDiscountReason = NotificationEventV1DiscountReasonMaximumSpend | NotificationEventV1DiscountReasonRatecardPercentage | NotificationEventV1DiscountReasonRatecardUsage;
|
|
7684
9377
|
/**
|
|
7685
9378
|
* Per-unit cost configuration for a feature. Either a fixed manual amount or a
|
|
7686
9379
|
* dynamic LLM cost lookup.
|
|
@@ -7721,6 +9414,13 @@ export type NotificationRule = NotificationRuleBalanceThreshold | NotificationRu
|
|
|
7721
9414
|
* to their defaults. The `type` must match the existing rule on update.
|
|
7722
9415
|
*/
|
|
7723
9416
|
export type NotificationRuleRequest = NotificationRuleBalanceThresholdRequest | NotificationRuleEntitlementResetRequest | NotificationRuleInvoiceCreatedRequest | NotificationRuleInvoiceUpdatedRequest;
|
|
9417
|
+
/**
|
|
9418
|
+
* Per-unit cost configuration for a feature. Either a fixed manual amount or a
|
|
9419
|
+
* dynamic LLM cost lookup.
|
|
9420
|
+
*/
|
|
9421
|
+
export type NotificationEventV1FeatureUnitCost = NotificationEventV1FeatureManualUnitCost | NotificationEventV1FeatureLlmUnitCost;
|
|
9422
|
+
/** PaymentTerms defines the terms for payment. */
|
|
9423
|
+
export type NotificationEventV1PaymentTerms = NotificationEventV1PaymentTermInstant | NotificationEventV1PaymentTermDueDate;
|
|
7724
9424
|
/** Price. */
|
|
7725
9425
|
export type Price = PriceFree | PriceFlat | PriceUnit | PriceGraduated | PriceVolume;
|
|
7726
9426
|
/**
|
|
@@ -7738,8 +9438,18 @@ export type CreateEntitlementRequest = CreateEntitlementMeteredRequest | CreateE
|
|
|
7738
9438
|
export type App = AppStripe | AppSandbox | AppExternalInvoicing;
|
|
7739
9439
|
/** Response of the app install. */
|
|
7740
9440
|
export type BillingInstallAppResponse = InstalledAppStripe | InstalledAppSandbox | InstalledAppExternalInvoicing;
|
|
7741
|
-
/**
|
|
7742
|
-
|
|
9441
|
+
/**
|
|
9442
|
+
* The alignment for collecting the pending line items into an invoice.
|
|
9443
|
+
*
|
|
9444
|
+
* Defaults to subscription, which means that we are to create a new invoice every
|
|
9445
|
+
* time the a subscription period starts (for in advance items) or ends (for in
|
|
9446
|
+
* arrears items).
|
|
9447
|
+
*/
|
|
9448
|
+
export type NotificationEventV1BillingWorkflowCollectionAlignment = NotificationEventV1BillingWorkflowCollectionAlignmentSubscription | NotificationEventV1BillingWorkflowCollectionAlignmentAnchored;
|
|
9449
|
+
/** The price of the usage based rate card. */
|
|
9450
|
+
export type NotificationEventV1RateCardUsageBasedPrice = NotificationEventV1FlatPriceWithPaymentTerm | NotificationEventV1UnitPriceWithCommitments | NotificationEventV1TieredPriceWithCommitments | NotificationEventV1DynamicPriceWithCommitments | NotificationEventV1PackagePriceWithCommitments;
|
|
9451
|
+
/** App. One of: stripe */
|
|
9452
|
+
export type NotificationEventV1App = NotificationEventV1StripeApp | NotificationEventV1SandboxApp | NotificationEventV1CustomInvoicingApp;
|
|
7743
9453
|
/** Feature or reference. */
|
|
7744
9454
|
export type FeatureOrReference = Feature | FeatureReference;
|
|
7745
9455
|
/** ChargeRealizationInvoice or reference. */
|
|
@@ -7779,6 +9489,8 @@ export type SubscriptionOrReference = Subscription | SubscriptionReference;
|
|
|
7779
9489
|
export type Invoice = InvoiceStandard;
|
|
7780
9490
|
/** UpdateInvoiceRequest update request. */
|
|
7781
9491
|
export type UpdateInvoiceRequest = UpdateInvoiceStandardRequest;
|
|
9492
|
+
/** The payload delivered to the channels, discriminated by the event type. */
|
|
9493
|
+
export type NotificationEventPayload = NotificationEventBalanceThresholdPayload | NotificationEventResetPayload | NotificationEventInvoiceCreatedPayload | NotificationEventInvoiceUpdatedPayload;
|
|
7782
9494
|
/** Customer charge. */
|
|
7783
9495
|
export type Charge = ChargeFlatFee | ChargeUsageBased;
|
|
7784
9496
|
/**
|