@openmeter/client 1.0.0-beta-d27628286134 → 1.0.0-beta-05e3994fd90d

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.
@@ -1552,6 +1552,12 @@ export const subscriptionEditOperationType = z
1552
1552
  'unschedule_edit',
1553
1553
  ])
1554
1554
  .describe('The type of a subscription edit operation. - `add_item`: Add a rate card to a phase. - `remove_item`: Remove a rate card from a phase. - `add_phase`: Add a new phase to the subscription. - `remove_phase`: Remove a phase from the subscription. - `stretch_phase`: Extend the duration of a phase. - `unschedule_edit`: Discard scheduled edits on the current phase.');
1555
+ export const invoiceCreatedV1RuleConfig = z
1556
+ .object({})
1557
+ .describe('Rule configuration of `v1.billing.invoice.created`. Invoice Rules have no type-specific settings.');
1558
+ export const invoiceUpdatedV1RuleConfig = z
1559
+ .object({})
1560
+ .describe('Rule configuration of `v1.billing.invoice.updated`. Invoice Rules have no type-specific settings.');
1555
1561
  export const systemAccountAccessToken = z
1556
1562
  .object({
1557
1563
  type: z.literal('http').describe('Http authentication'),
@@ -3792,6 +3798,22 @@ export const customerProfile = z
3792
3798
  effectiveBillingProfile: profileReference,
3793
3799
  })
3794
3800
  .describe('Customer billing profile selection.');
3801
+ export const entitlementFeaturesRuleConfig = z
3802
+ .object({
3803
+ features: z
3804
+ .array(featureReference)
3805
+ .optional()
3806
+ .describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
3807
+ })
3808
+ .describe('The feature filter shared by the entitlement Rule configurations.');
3809
+ export const entitlementUsagePeriodResetV1RuleConfig = z
3810
+ .object({
3811
+ features: z
3812
+ .array(featureReference)
3813
+ .optional()
3814
+ .describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
3815
+ })
3816
+ .describe('Rule configuration of `v1.entitlement.usage_period.reset`.');
3795
3817
  export const createChargeCostBasis = z
3796
3818
  .discriminatedUnion('type', [
3797
3819
  createChargeCostBasisDynamic,
@@ -4950,6 +4972,19 @@ export const notificationRuleBalanceThresholdRequest = z
4950
4972
  .describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
4951
4973
  })
4952
4974
  .describe('Request body for a balance threshold rule.');
4975
+ export const entitlementBalanceThresholdTriggeredV1RuleConfig = z
4976
+ .object({
4977
+ thresholds: z
4978
+ .array(notificationBalanceThreshold)
4979
+ .min(1)
4980
+ .max(10)
4981
+ .describe('The thresholds that generate an event when crossed.'),
4982
+ features: z
4983
+ .array(featureReference)
4984
+ .optional()
4985
+ .describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
4986
+ })
4987
+ .describe('Rule configuration of `v1.entitlement.balance_threshold.triggered`.');
4953
4988
  export const notificationEventDeliveryStatus = z
4954
4989
  .object({
4955
4990
  channelId: ulid,
@@ -6680,6 +6715,25 @@ export const notificationEventV1BillingWorkflowCollectionSettings = z
6680
6715
  .describe('This grace period can be used to delay the collection of the pending line items specified in alignment. This is useful, in case of multiple subscriptions having slightly different billing periods.'),
6681
6716
  })
6682
6717
  .describe('Workflow collection specifies how to collect the pending line items for an invoice');
6718
+ export const entitlementBalanceThresholdTriggeredV1Payload = z
6719
+ .object({
6720
+ entitlement: notificationEventV1EntitlementMetered,
6721
+ feature: notificationEventV1Feature,
6722
+ subject: notificationEventV1Subject,
6723
+ value: notificationEventV1EntitlementValue,
6724
+ customer: notificationEventV1Customer.optional(),
6725
+ threshold: notificationEventV1RuleBalanceThresholdValue,
6726
+ })
6727
+ .describe('Payload of `v1.entitlement.balance_threshold.triggered`, the legacy `entitlements.balance.threshold` Event type.');
6728
+ export const entitlementUsagePeriodResetV1Payload = z
6729
+ .object({
6730
+ entitlement: notificationEventV1EntitlementMetered,
6731
+ feature: notificationEventV1Feature,
6732
+ subject: notificationEventV1Subject,
6733
+ value: notificationEventV1EntitlementValue,
6734
+ customer: notificationEventV1Customer.optional(),
6735
+ })
6736
+ .describe('Payload of `v1.entitlement.usage_period.reset`, the legacy `entitlements.reset` Event type.');
6683
6737
  export const notificationEventV1BalanceThresholdPayloadData = z
6684
6738
  .object({
6685
6739
  entitlement: notificationEventV1EntitlementMetered,
@@ -7060,7 +7114,7 @@ export const notificationEventBalanceThresholdPayload = z
7060
7114
  .literal('entitlements.balance.threshold')
7061
7115
  .describe('The type of the event.'),
7062
7116
  timestamp: dateTime,
7063
- data: notificationEventV1BalanceThresholdPayloadData,
7117
+ data: entitlementBalanceThresholdTriggeredV1Payload,
7064
7118
  })
7065
7119
  .describe('A balance threshold notification event payload.');
7066
7120
  export const notificationEventResetPayload = z
@@ -7068,7 +7122,7 @@ export const notificationEventResetPayload = z
7068
7122
  id: ulid,
7069
7123
  type: z.literal('entitlements.reset').describe('The type of the event.'),
7070
7124
  timestamp: dateTime,
7071
- data: notificationEventV1EntitlementValuePayloadBase,
7125
+ data: entitlementUsagePeriodResetV1Payload,
7072
7126
  })
7073
7127
  .describe('An entitlement reset notification event payload.');
7074
7128
  export const notificationEventV1InvoiceLine = z
@@ -7543,6 +7597,160 @@ export const updateInvoiceStandardRequest = z
7543
7597
  .describe('Line items on this invoice. Always returned on single-resource GET; omitted on list endpoints unless explicitly expanded. Editable via update: existing lines are matched by `id`, lines without an `id` are created, and lines present on the invoice but omitted from the update request are deleted. Detailed (child) lines are always computed and cannot be edited directly.'),
7544
7598
  })
7545
7599
  .describe('InvoiceStandard update request.');
7600
+ export const invoiceCreatedV1Payload = z
7601
+ .object({
7602
+ id: z
7603
+ .string()
7604
+ .regex(new RegExp('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$'))
7605
+ .describe('A unique identifier for the resource.'),
7606
+ description: z
7607
+ .string()
7608
+ .max(1024)
7609
+ .optional()
7610
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
7611
+ metadata: notificationEventV1Metadata
7612
+ .nullable()
7613
+ .optional()
7614
+ .describe('Additional metadata for the resource.'),
7615
+ createdAt: z.date().describe('Timestamp of when the resource was created.'),
7616
+ updatedAt: z
7617
+ .date()
7618
+ .describe('Timestamp of when the resource was last updated.'),
7619
+ deletedAt: z
7620
+ .date()
7621
+ .optional()
7622
+ .describe('Timestamp of when the resource was permanently deleted.'),
7623
+ type: notificationEventV1InvoiceType,
7624
+ supplier: notificationEventV1BillingParty,
7625
+ customer: notificationEventV1BillingInvoiceCustomerExtendedDetails,
7626
+ number: notificationEventV1InvoiceNumber,
7627
+ currency: notificationEventV1CurrencyCode,
7628
+ preceding: z
7629
+ .array(notificationEventV1InvoiceDocumentRef)
7630
+ .optional()
7631
+ .describe('Key information regarding previous invoices and potentially details as to why they were corrected.'),
7632
+ totals: notificationEventV1InvoiceTotals,
7633
+ status: notificationEventV1InvoiceStatus,
7634
+ statusDetails: notificationEventV1InvoiceStatusDetails,
7635
+ issuedAt: z
7636
+ .date()
7637
+ .optional()
7638
+ .describe('The time the invoice was issued. Depending on the status of the invoice this can mean multiple things: - draft, gathering: The time the invoice will be issued based on the workflow settings. - issued: The time the invoice was issued.'),
7639
+ draftUntil: z
7640
+ .date()
7641
+ .optional()
7642
+ .describe('The time until the invoice is in draft status. On draft invoice creation it is calculated from the workflow settings. If manual approval is required, the draftUntil time is set.'),
7643
+ quantitySnapshotedAt: z
7644
+ .date()
7645
+ .optional()
7646
+ .describe('The time when the quantity snapshots on the invoice lines were taken.'),
7647
+ collectionAt: z
7648
+ .date()
7649
+ .optional()
7650
+ .describe('The time when the invoice will be/has been collected.'),
7651
+ dueAt: z
7652
+ .date()
7653
+ .optional()
7654
+ .describe('Due time of the fulfillment of the invoice (if available).'),
7655
+ period: notificationEventV1Period.optional(),
7656
+ voidedAt: z
7657
+ .date()
7658
+ .optional()
7659
+ .describe('The time the invoice was voided. If the invoice was voided, this field will be set to the time the invoice was voided.'),
7660
+ sentToCustomerAt: z
7661
+ .date()
7662
+ .optional()
7663
+ .describe('The time the invoice was sent to customer.'),
7664
+ workflow: notificationEventV1InvoiceWorkflowSettings,
7665
+ lines: z
7666
+ .array(notificationEventV1InvoiceLine)
7667
+ .optional()
7668
+ .describe('List of invoice lines representing each of the items sold to the customer.'),
7669
+ payment: notificationEventV1InvoicePaymentTerms.optional(),
7670
+ validationIssues: z
7671
+ .array(notificationEventV1ValidationIssue)
7672
+ .optional()
7673
+ .describe('Validation issues reported by the invoice workflow.'),
7674
+ externalIds: notificationEventV1InvoiceAppExternalIds.optional(),
7675
+ })
7676
+ .describe('Payload of `v1.billing.invoice.created`, the legacy `invoice.created` Event type: the invoice as it was created.');
7677
+ export const invoiceUpdatedV1Payload = z
7678
+ .object({
7679
+ id: z
7680
+ .string()
7681
+ .regex(new RegExp('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$'))
7682
+ .describe('A unique identifier for the resource.'),
7683
+ description: z
7684
+ .string()
7685
+ .max(1024)
7686
+ .optional()
7687
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
7688
+ metadata: notificationEventV1Metadata
7689
+ .nullable()
7690
+ .optional()
7691
+ .describe('Additional metadata for the resource.'),
7692
+ createdAt: z.date().describe('Timestamp of when the resource was created.'),
7693
+ updatedAt: z
7694
+ .date()
7695
+ .describe('Timestamp of when the resource was last updated.'),
7696
+ deletedAt: z
7697
+ .date()
7698
+ .optional()
7699
+ .describe('Timestamp of when the resource was permanently deleted.'),
7700
+ type: notificationEventV1InvoiceType,
7701
+ supplier: notificationEventV1BillingParty,
7702
+ customer: notificationEventV1BillingInvoiceCustomerExtendedDetails,
7703
+ number: notificationEventV1InvoiceNumber,
7704
+ currency: notificationEventV1CurrencyCode,
7705
+ preceding: z
7706
+ .array(notificationEventV1InvoiceDocumentRef)
7707
+ .optional()
7708
+ .describe('Key information regarding previous invoices and potentially details as to why they were corrected.'),
7709
+ totals: notificationEventV1InvoiceTotals,
7710
+ status: notificationEventV1InvoiceStatus,
7711
+ statusDetails: notificationEventV1InvoiceStatusDetails,
7712
+ issuedAt: z
7713
+ .date()
7714
+ .optional()
7715
+ .describe('The time the invoice was issued. Depending on the status of the invoice this can mean multiple things: - draft, gathering: The time the invoice will be issued based on the workflow settings. - issued: The time the invoice was issued.'),
7716
+ draftUntil: z
7717
+ .date()
7718
+ .optional()
7719
+ .describe('The time until the invoice is in draft status. On draft invoice creation it is calculated from the workflow settings. If manual approval is required, the draftUntil time is set.'),
7720
+ quantitySnapshotedAt: z
7721
+ .date()
7722
+ .optional()
7723
+ .describe('The time when the quantity snapshots on the invoice lines were taken.'),
7724
+ collectionAt: z
7725
+ .date()
7726
+ .optional()
7727
+ .describe('The time when the invoice will be/has been collected.'),
7728
+ dueAt: z
7729
+ .date()
7730
+ .optional()
7731
+ .describe('Due time of the fulfillment of the invoice (if available).'),
7732
+ period: notificationEventV1Period.optional(),
7733
+ voidedAt: z
7734
+ .date()
7735
+ .optional()
7736
+ .describe('The time the invoice was voided. If the invoice was voided, this field will be set to the time the invoice was voided.'),
7737
+ sentToCustomerAt: z
7738
+ .date()
7739
+ .optional()
7740
+ .describe('The time the invoice was sent to customer.'),
7741
+ workflow: notificationEventV1InvoiceWorkflowSettings,
7742
+ lines: z
7743
+ .array(notificationEventV1InvoiceLine)
7744
+ .optional()
7745
+ .describe('List of invoice lines representing each of the items sold to the customer.'),
7746
+ payment: notificationEventV1InvoicePaymentTerms.optional(),
7747
+ validationIssues: z
7748
+ .array(notificationEventV1ValidationIssue)
7749
+ .optional()
7750
+ .describe('Validation issues reported by the invoice workflow.'),
7751
+ externalIds: notificationEventV1InvoiceAppExternalIds.optional(),
7752
+ })
7753
+ .describe('Payload of `v1.billing.invoice.updated`, the legacy `invoice.updated` Event type: the invoice after the update.');
7546
7754
  export const notificationEventV1Invoice = z
7547
7755
  .object({
7548
7756
  id: z
@@ -7652,7 +7860,7 @@ export const notificationEventInvoiceCreatedPayload = z
7652
7860
  id: ulid,
7653
7861
  type: z.literal('invoice.created').describe('The type of the event.'),
7654
7862
  timestamp: dateTime,
7655
- data: notificationEventV1Invoice,
7863
+ data: invoiceCreatedV1Payload,
7656
7864
  })
7657
7865
  .describe('An invoice created notification event payload.');
7658
7866
  export const notificationEventInvoiceUpdatedPayload = z
@@ -7660,7 +7868,7 @@ export const notificationEventInvoiceUpdatedPayload = z
7660
7868
  id: ulid,
7661
7869
  type: z.literal('invoice.updated').describe('The type of the event.'),
7662
7870
  timestamp: dateTime,
7663
- data: notificationEventV1Invoice,
7871
+ data: invoiceUpdatedV1Payload,
7664
7872
  })
7665
7873
  .describe('An invoice updated notification event payload.');
7666
7874
  export const chargeFlatFee = z
@@ -10422,6 +10630,12 @@ export const subscriptionEditOperationTypeWire = z
10422
10630
  'unschedule_edit',
10423
10631
  ])
10424
10632
  .describe('The type of a subscription edit operation. - `add_item`: Add a rate card to a phase. - `remove_item`: Remove a rate card from a phase. - `add_phase`: Add a new phase to the subscription. - `remove_phase`: Remove a phase from the subscription. - `stretch_phase`: Extend the duration of a phase. - `unschedule_edit`: Discard scheduled edits on the current phase.');
10633
+ export const invoiceCreatedV1RuleConfigWire = z
10634
+ .strictObject({})
10635
+ .describe('Rule configuration of `v1.billing.invoice.created`. Invoice Rules have no type-specific settings.');
10636
+ export const invoiceUpdatedV1RuleConfigWire = z
10637
+ .strictObject({})
10638
+ .describe('Rule configuration of `v1.billing.invoice.updated`. Invoice Rules have no type-specific settings.');
10425
10639
  export const systemAccountAccessTokenWire = z
10426
10640
  .strictObject({
10427
10641
  type: z.literal('http').describe('Http authentication'),
@@ -12645,6 +12859,22 @@ export const customerProfileWire = z
12645
12859
  effective_billing_profile: profileReferenceWire,
12646
12860
  })
12647
12861
  .describe('Customer billing profile selection.');
12862
+ export const entitlementFeaturesRuleConfigWire = z
12863
+ .strictObject({
12864
+ features: z
12865
+ .array(featureReferenceWire)
12866
+ .optional()
12867
+ .describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
12868
+ })
12869
+ .describe('The feature filter shared by the entitlement Rule configurations.');
12870
+ export const entitlementUsagePeriodResetV1RuleConfigWire = z
12871
+ .strictObject({
12872
+ features: z
12873
+ .array(featureReferenceWire)
12874
+ .optional()
12875
+ .describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
12876
+ })
12877
+ .describe('Rule configuration of `v1.entitlement.usage_period.reset`.');
12648
12878
  export const createChargeCostBasisWire = z
12649
12879
  .discriminatedUnion('type', [
12650
12880
  createChargeCostBasisDynamicWire,
@@ -13794,6 +14024,19 @@ export const notificationRuleBalanceThresholdRequestWire = z
13794
14024
  .describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
13795
14025
  })
13796
14026
  .describe('Request body for a balance threshold rule.');
14027
+ export const entitlementBalanceThresholdTriggeredV1RuleConfigWire = z
14028
+ .strictObject({
14029
+ thresholds: z
14030
+ .array(notificationBalanceThresholdWire)
14031
+ .min(1)
14032
+ .max(10)
14033
+ .describe('The thresholds that generate an event when crossed.'),
14034
+ features: z
14035
+ .array(featureReferenceWire)
14036
+ .optional()
14037
+ .describe('The features the rule applies to. When omitted, the rule applies to every feature.'),
14038
+ })
14039
+ .describe('Rule configuration of `v1.entitlement.balance_threshold.triggered`.');
13797
14040
  export const notificationEventDeliveryStatusWire = z
13798
14041
  .strictObject({
13799
14042
  channel_id: ulidWire,
@@ -15587,6 +15830,25 @@ export const notificationEventV1BillingWorkflowCollectionSettingsWire = z
15587
15830
  .describe('This grace period can be used to delay the collection of the pending line items specified in alignment. This is useful, in case of multiple subscriptions having slightly different billing periods.'),
15588
15831
  })
15589
15832
  .describe('Workflow collection specifies how to collect the pending line items for an invoice');
15833
+ export const entitlementBalanceThresholdTriggeredV1PayloadWire = z
15834
+ .strictObject({
15835
+ entitlement: notificationEventV1EntitlementMeteredWire,
15836
+ feature: notificationEventV1FeatureWire,
15837
+ subject: notificationEventV1SubjectWire,
15838
+ value: notificationEventV1EntitlementValueWire,
15839
+ customer: notificationEventV1CustomerWire.optional(),
15840
+ threshold: notificationEventV1RuleBalanceThresholdValueWire,
15841
+ })
15842
+ .describe('Payload of `v1.entitlement.balance_threshold.triggered`, the legacy `entitlements.balance.threshold` Event type.');
15843
+ export const entitlementUsagePeriodResetV1PayloadWire = z
15844
+ .strictObject({
15845
+ entitlement: notificationEventV1EntitlementMeteredWire,
15846
+ feature: notificationEventV1FeatureWire,
15847
+ subject: notificationEventV1SubjectWire,
15848
+ value: notificationEventV1EntitlementValueWire,
15849
+ customer: notificationEventV1CustomerWire.optional(),
15850
+ })
15851
+ .describe('Payload of `v1.entitlement.usage_period.reset`, the legacy `entitlements.reset` Event type.');
15590
15852
  export const notificationEventV1BalanceThresholdPayloadDataWire = z
15591
15853
  .strictObject({
15592
15854
  entitlement: notificationEventV1EntitlementMeteredWire,
@@ -15974,7 +16236,7 @@ export const notificationEventBalanceThresholdPayloadWire = z
15974
16236
  .literal('entitlements.balance.threshold')
15975
16237
  .describe('The type of the event.'),
15976
16238
  timestamp: dateTimeWire,
15977
- data: notificationEventV1BalanceThresholdPayloadDataWire,
16239
+ data: entitlementBalanceThresholdTriggeredV1PayloadWire,
15978
16240
  })
15979
16241
  .describe('A balance threshold notification event payload.');
15980
16242
  export const notificationEventResetPayloadWire = z
@@ -15982,7 +16244,7 @@ export const notificationEventResetPayloadWire = z
15982
16244
  id: ulidWire,
15983
16245
  type: z.literal('entitlements.reset').describe('The type of the event.'),
15984
16246
  timestamp: dateTimeWire,
15985
- data: notificationEventV1EntitlementValuePayloadBaseWire,
16247
+ data: entitlementUsagePeriodResetV1PayloadWire,
15986
16248
  })
15987
16249
  .describe('An entitlement reset notification event payload.');
15988
16250
  export const notificationEventV1InvoiceLineWire = z
@@ -16460,6 +16722,184 @@ export const updateInvoiceStandardRequestWire = z
16460
16722
  .describe('Line items on this invoice. Always returned on single-resource GET; omitted on list endpoints unless explicitly expanded. Editable via update: existing lines are matched by `id`, lines without an `id` are created, and lines present on the invoice but omitted from the update request are deleted. Detailed (child) lines are always computed and cannot be edited directly.'),
16461
16723
  })
16462
16724
  .describe('InvoiceStandard update request.');
16725
+ export const invoiceCreatedV1PayloadWire = z
16726
+ .strictObject({
16727
+ id: z
16728
+ .string()
16729
+ .regex(new RegExp('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$'))
16730
+ .describe('A unique identifier for the resource.'),
16731
+ description: z
16732
+ .string()
16733
+ .max(1024)
16734
+ .optional()
16735
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
16736
+ metadata: notificationEventV1MetadataWire
16737
+ .nullable()
16738
+ .optional()
16739
+ .describe('Additional metadata for the resource.'),
16740
+ created_at: z
16741
+ .string()
16742
+ .datetime({ offset: true })
16743
+ .describe('Timestamp of when the resource was created.'),
16744
+ updated_at: z
16745
+ .string()
16746
+ .datetime({ offset: true })
16747
+ .describe('Timestamp of when the resource was last updated.'),
16748
+ deleted_at: z
16749
+ .string()
16750
+ .datetime({ offset: true })
16751
+ .optional()
16752
+ .describe('Timestamp of when the resource was permanently deleted.'),
16753
+ type: notificationEventV1InvoiceTypeWire,
16754
+ supplier: notificationEventV1BillingPartyWire,
16755
+ customer: notificationEventV1BillingInvoiceCustomerExtendedDetailsWire,
16756
+ number: notificationEventV1InvoiceNumberWire,
16757
+ currency: notificationEventV1CurrencyCodeWire,
16758
+ preceding: z
16759
+ .array(notificationEventV1InvoiceDocumentRefWire)
16760
+ .optional()
16761
+ .describe('Key information regarding previous invoices and potentially details as to why they were corrected.'),
16762
+ totals: notificationEventV1InvoiceTotalsWire,
16763
+ status: notificationEventV1InvoiceStatusWire,
16764
+ status_details: notificationEventV1InvoiceStatusDetailsWire,
16765
+ issued_at: z
16766
+ .string()
16767
+ .datetime({ offset: true })
16768
+ .optional()
16769
+ .describe('The time the invoice was issued. Depending on the status of the invoice this can mean multiple things: - draft, gathering: The time the invoice will be issued based on the workflow settings. - issued: The time the invoice was issued.'),
16770
+ draft_until: z
16771
+ .string()
16772
+ .datetime({ offset: true })
16773
+ .optional()
16774
+ .describe('The time until the invoice is in draft status. On draft invoice creation it is calculated from the workflow settings. If manual approval is required, the draftUntil time is set.'),
16775
+ quantity_snapshoted_at: z
16776
+ .string()
16777
+ .datetime({ offset: true })
16778
+ .optional()
16779
+ .describe('The time when the quantity snapshots on the invoice lines were taken.'),
16780
+ collection_at: z
16781
+ .string()
16782
+ .datetime({ offset: true })
16783
+ .optional()
16784
+ .describe('The time when the invoice will be/has been collected.'),
16785
+ due_at: z
16786
+ .string()
16787
+ .datetime({ offset: true })
16788
+ .optional()
16789
+ .describe('Due time of the fulfillment of the invoice (if available).'),
16790
+ period: notificationEventV1PeriodWire.optional(),
16791
+ voided_at: z
16792
+ .string()
16793
+ .datetime({ offset: true })
16794
+ .optional()
16795
+ .describe('The time the invoice was voided. If the invoice was voided, this field will be set to the time the invoice was voided.'),
16796
+ sent_to_customer_at: z
16797
+ .string()
16798
+ .datetime({ offset: true })
16799
+ .optional()
16800
+ .describe('The time the invoice was sent to customer.'),
16801
+ workflow: notificationEventV1InvoiceWorkflowSettingsWire,
16802
+ lines: z
16803
+ .array(notificationEventV1InvoiceLineWire)
16804
+ .optional()
16805
+ .describe('List of invoice lines representing each of the items sold to the customer.'),
16806
+ payment: notificationEventV1InvoicePaymentTermsWire.optional(),
16807
+ validation_issues: z
16808
+ .array(notificationEventV1ValidationIssueWire)
16809
+ .optional()
16810
+ .describe('Validation issues reported by the invoice workflow.'),
16811
+ external_ids: notificationEventV1InvoiceAppExternalIdsWire.optional(),
16812
+ })
16813
+ .describe('Payload of `v1.billing.invoice.created`, the legacy `invoice.created` Event type: the invoice as it was created.');
16814
+ export const invoiceUpdatedV1PayloadWire = z
16815
+ .strictObject({
16816
+ id: z
16817
+ .string()
16818
+ .regex(new RegExp('^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$'))
16819
+ .describe('A unique identifier for the resource.'),
16820
+ description: z
16821
+ .string()
16822
+ .max(1024)
16823
+ .optional()
16824
+ .describe('Optional description of the resource. Maximum 1024 characters.'),
16825
+ metadata: notificationEventV1MetadataWire
16826
+ .nullable()
16827
+ .optional()
16828
+ .describe('Additional metadata for the resource.'),
16829
+ created_at: z
16830
+ .string()
16831
+ .datetime({ offset: true })
16832
+ .describe('Timestamp of when the resource was created.'),
16833
+ updated_at: z
16834
+ .string()
16835
+ .datetime({ offset: true })
16836
+ .describe('Timestamp of when the resource was last updated.'),
16837
+ deleted_at: z
16838
+ .string()
16839
+ .datetime({ offset: true })
16840
+ .optional()
16841
+ .describe('Timestamp of when the resource was permanently deleted.'),
16842
+ type: notificationEventV1InvoiceTypeWire,
16843
+ supplier: notificationEventV1BillingPartyWire,
16844
+ customer: notificationEventV1BillingInvoiceCustomerExtendedDetailsWire,
16845
+ number: notificationEventV1InvoiceNumberWire,
16846
+ currency: notificationEventV1CurrencyCodeWire,
16847
+ preceding: z
16848
+ .array(notificationEventV1InvoiceDocumentRefWire)
16849
+ .optional()
16850
+ .describe('Key information regarding previous invoices and potentially details as to why they were corrected.'),
16851
+ totals: notificationEventV1InvoiceTotalsWire,
16852
+ status: notificationEventV1InvoiceStatusWire,
16853
+ status_details: notificationEventV1InvoiceStatusDetailsWire,
16854
+ issued_at: z
16855
+ .string()
16856
+ .datetime({ offset: true })
16857
+ .optional()
16858
+ .describe('The time the invoice was issued. Depending on the status of the invoice this can mean multiple things: - draft, gathering: The time the invoice will be issued based on the workflow settings. - issued: The time the invoice was issued.'),
16859
+ draft_until: z
16860
+ .string()
16861
+ .datetime({ offset: true })
16862
+ .optional()
16863
+ .describe('The time until the invoice is in draft status. On draft invoice creation it is calculated from the workflow settings. If manual approval is required, the draftUntil time is set.'),
16864
+ quantity_snapshoted_at: z
16865
+ .string()
16866
+ .datetime({ offset: true })
16867
+ .optional()
16868
+ .describe('The time when the quantity snapshots on the invoice lines were taken.'),
16869
+ collection_at: z
16870
+ .string()
16871
+ .datetime({ offset: true })
16872
+ .optional()
16873
+ .describe('The time when the invoice will be/has been collected.'),
16874
+ due_at: z
16875
+ .string()
16876
+ .datetime({ offset: true })
16877
+ .optional()
16878
+ .describe('Due time of the fulfillment of the invoice (if available).'),
16879
+ period: notificationEventV1PeriodWire.optional(),
16880
+ voided_at: z
16881
+ .string()
16882
+ .datetime({ offset: true })
16883
+ .optional()
16884
+ .describe('The time the invoice was voided. If the invoice was voided, this field will be set to the time the invoice was voided.'),
16885
+ sent_to_customer_at: z
16886
+ .string()
16887
+ .datetime({ offset: true })
16888
+ .optional()
16889
+ .describe('The time the invoice was sent to customer.'),
16890
+ workflow: notificationEventV1InvoiceWorkflowSettingsWire,
16891
+ lines: z
16892
+ .array(notificationEventV1InvoiceLineWire)
16893
+ .optional()
16894
+ .describe('List of invoice lines representing each of the items sold to the customer.'),
16895
+ payment: notificationEventV1InvoicePaymentTermsWire.optional(),
16896
+ validation_issues: z
16897
+ .array(notificationEventV1ValidationIssueWire)
16898
+ .optional()
16899
+ .describe('Validation issues reported by the invoice workflow.'),
16900
+ external_ids: notificationEventV1InvoiceAppExternalIdsWire.optional(),
16901
+ })
16902
+ .describe('Payload of `v1.billing.invoice.updated`, the legacy `invoice.updated` Event type: the invoice after the update.');
16463
16903
  export const notificationEventV1InvoiceWire = z
16464
16904
  .strictObject({
16465
16905
  id: z
@@ -16581,7 +17021,7 @@ export const notificationEventInvoiceCreatedPayloadWire = z
16581
17021
  id: ulidWire,
16582
17022
  type: z.literal('invoice.created').describe('The type of the event.'),
16583
17023
  timestamp: dateTimeWire,
16584
- data: notificationEventV1InvoiceWire,
17024
+ data: invoiceCreatedV1PayloadWire,
16585
17025
  })
16586
17026
  .describe('An invoice created notification event payload.');
16587
17027
  export const notificationEventInvoiceUpdatedPayloadWire = z
@@ -16589,7 +17029,7 @@ export const notificationEventInvoiceUpdatedPayloadWire = z
16589
17029
  id: ulidWire,
16590
17030
  type: z.literal('invoice.updated').describe('The type of the event.'),
16591
17031
  timestamp: dateTimeWire,
16592
- data: notificationEventV1InvoiceWire,
17032
+ data: invoiceUpdatedV1PayloadWire,
16593
17033
  })
16594
17034
  .describe('An invoice updated notification event payload.');
16595
17035
  export const chargeFlatFeeWire = z