@whooshbang/contracts 2.0.0-rc.6 → 2.0.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/contract-manifest.json +41 -42
  3. package/dist/generated/artifact-index.d.ts +34 -34
  4. package/dist/generated/artifact-index.js +40 -41
  5. package/dist/generated/artifact-index.js.map +1 -1
  6. package/dist/generated/validators-standalone.d.ts +479 -441
  7. package/dist/generated/validators-standalone.js +41132 -28858
  8. package/dist/generated/validators-standalone.js.map +1 -1
  9. package/dist/generated/validators.d.ts +13 -10
  10. package/dist/generated/validators.js +17 -11
  11. package/dist/generated/validators.js.map +1 -1
  12. package/dist/generated/whooshbang-event-v1.d.ts +34 -18
  13. package/dist/generated/whooshbang-v1.d.ts +382 -100
  14. package/dist/index.d.ts +2 -2
  15. package/dist/index.js +1 -1
  16. package/dist/index.js.map +1 -1
  17. package/fixtures/core-v1/fixture-index.json +60 -71
  18. package/fixtures/core-v1/requests/assert-email-service.json +10 -0
  19. package/fixtures/core-v1/requests/update-billing-receipt-email.json +3 -0
  20. package/fixtures/core-v1/scenarios/api-credential-invalid-indistinguishable.json +1 -1
  21. package/fixtures/core-v1/scenarios/api-credential-one-time-reveal.json +1 -1
  22. package/fixtures/core-v1/scenarios/api-credential-revocation-replay.json +1 -1
  23. package/fixtures/core-v1/scenarios/api-credential-rotation-overlap.json +1 -1
  24. package/fixtures/core-v1/scenarios/cancellation-too-late.json +1 -1
  25. package/fixtures/core-v1/scenarios/cross-organization-project.json +1 -1
  26. package/fixtures/core-v1/scenarios/cross-project-resource.json +1 -1
  27. package/fixtures/core-v1/scenarios/environment-mismatch.json +1 -1
  28. package/fixtures/core-v1/scenarios/idempotency-conflict.json +1 -1
  29. package/fixtures/core-v1/scenarios/idempotency-equivalent-replay.json +1 -1
  30. package/fixtures/core-v1/scenarios/malformed-bearer.json +1 -1
  31. package/fixtures/core-v1/scenarios/metadata-overrun.json +1 -1
  32. package/fixtures/core-v1/scenarios/missing-scope.json +1 -1
  33. package/fixtures/core-v1/scenarios/project-create-equivalent-replay.json +1 -1
  34. package/fixtures/core-v1/scenarios/project-slug-conflict.json +1 -1
  35. package/fixtures/core-v1/scenarios/provider-outcome-unknown.json +1 -1
  36. package/fixtures/core-v1/scenarios/subscription-activation-replay.json +1 -1
  37. package/fixtures/core-v1/scenarios/subscription-authorization-capability-opacity.json +1 -1
  38. package/fixtures/core-v1/scenarios/subscription-cross-connection-callback-rejected.json +1 -1
  39. package/fixtures/core-v1/scenarios/subscription-expired-replay.json +1 -1
  40. package/fixtures/core-v1/scenarios/subscription-selected-connection-replay.json +1 -1
  41. package/fixtures/core-v1/success/auto-top-up-settings.json +2 -2
  42. package/fixtures/core-v1/success/billing-account.json +4 -2
  43. package/fixtures/core-v1/success/billing-entitlements.json +3 -4
  44. package/fixtures/core-v1/success/billing-invoices.json +33 -0
  45. package/fixtures/core-v1/success/card-setup.json +7 -0
  46. package/fixtures/core-v1/success/credit-purchase.json +15 -0
  47. package/fixtures/core-v1/success/reconcile-card-setup.json +12 -0
  48. package/fixtures/core-v1/success/subscription-change.json +4 -2
  49. package/fixtures/interaction-machine-v1/scenarios/ack-conflict.json +1 -1
  50. package/fixtures/interaction-machine-v1/scenarios/ack-cross-machine.json +1 -1
  51. package/fixtures/interaction-machine-v1/scenarios/ack-out-of-order.json +1 -1
  52. package/fixtures/interaction-machine-v1/scenarios/ack-replay.json +1 -1
  53. package/fixtures/interaction-machine-v1/scenarios/ambiguous-free-text.json +1 -1
  54. package/fixtures/interaction-machine-v1/scenarios/callback-token-opacity.json +1 -1
  55. package/fixtures/interaction-machine-v1/scenarios/credential-registration-conflict.json +1 -1
  56. package/fixtures/interaction-machine-v1/scenarios/credential-registration-replay.json +1 -1
  57. package/fixtures/interaction-machine-v1/scenarios/credential-revocation-replay.json +1 -1
  58. package/fixtures/interaction-machine-v1/scenarios/credential-rotation.json +1 -1
  59. package/fixtures/interaction-machine-v1/scenarios/first-credential-activates.json +1 -1
  60. package/fixtures/interaction-machine-v1/scenarios/interaction-duplicate.json +1 -1
  61. package/fixtures/interaction-machine-v1/scenarios/interaction-expired.json +1 -1
  62. package/fixtures/interaction-machine-v1/scenarios/interaction-mismatch.json +1 -1
  63. package/fixtures/interaction-machine-v1/scenarios/interaction-retired.json +1 -1
  64. package/fixtures/interaction-machine-v1/scenarios/interaction-stale.json +1 -1
  65. package/fixtures/interaction-machine-v1/scenarios/machine-admin-denied.json +1 -1
  66. package/fixtures/interaction-machine-v1/scenarios/machine-bound-message-create.json +1 -1
  67. package/fixtures/interaction-machine-v1/scenarios/machine-cancel-denied.json +1 -1
  68. package/fixtures/interaction-machine-v1/scenarios/machine-crash-before-ack.json +1 -1
  69. package/fixtures/interaction-machine-v1/scenarios/machine-notifier-mismatch.json +1 -1
  70. package/fixtures/interaction-machine-v1/scenarios/machine-other-message-read.json +1 -1
  71. package/fixtures/interaction-machine-v1/scenarios/machine-owned-message-read.json +1 -1
  72. package/fixtures/interaction-machine-v1/scenarios/machine-subscriber-mismatch.json +1 -1
  73. package/fixtures/interaction-machine-v1/scenarios/poll-uncommitted-cursor-rejected.json +1 -1
  74. package/fixtures/interaction-machine-v1/scenarios/project-credential-machine-endpoint-denied.json +1 -1
  75. package/fixtures/interaction-machine-v1/scenarios/quarantine-integrity-rejected.json +1 -1
  76. package/fixtures/interaction-machine-v1/scenarios/quarantine-signature-rejected.json +1 -1
  77. package/fixtures/interaction-machine-v1/scenarios/quarantine-valid.json +1 -1
  78. package/fixtures/interaction-machine-v1/scenarios/revoked-machine-credential.json +1 -1
  79. package/fixtures/recipient-experience-v1/scenarios/membership-broadcast-snapshot.json +1 -1
  80. package/fixtures/recipient-experience-v1/scenarios/preferred-binding-resolution.json +1 -1
  81. package/fixtures/recipient-experience-v1/scenarios/recipient-session-security.json +1 -1
  82. package/fixtures/recipient-experience-v1/scenarios/subscriber-initial-groups-transaction.json +1 -1
  83. package/openapi/generated/whooshbang-v1.bundle.json +1164 -504
  84. package/openapi/whooshbang-v1.yaml +418 -331
  85. package/package.json +1 -1
  86. package/schemas/core-scenario.schema.json +1 -1
  87. package/schemas/events/agent-binding-degraded-v1.schema.json +1 -1
  88. package/schemas/events/interaction-expired-v1.schema.json +1 -1
  89. package/schemas/events/interaction-received-v1.schema.json +1 -1
  90. package/schemas/events/message-delivered-v1.schema.json +1 -1
  91. package/schemas/events/message-expired-v1.schema.json +1 -1
  92. package/schemas/events/message-failed-v1.schema.json +1 -1
  93. package/schemas/events/message-provider-accepted-v1.schema.json +1 -1
  94. package/schemas/events/subscription-activated-v1.schema.json +1 -1
  95. package/schemas/events/subscription-revoked-v1.schema.json +1 -1
  96. package/schemas/events/whooshbang-event-v1.schema.json +145 -65
  97. package/schemas/fixture-index.schema.json +1 -1
  98. package/schemas/interaction-machine-scenario.schema.json +1 -1
  99. package/schemas/interaction-v1.schema.json +1 -1
  100. package/schemas/machine-v1.schema.json +1 -1
  101. package/schemas/provider-capabilities-v1.schema.json +1 -1
  102. package/schemas/webhooks/webhook-delivery-case-v1.schema.json +1 -1
  103. package/schemas/webhooks/webhook-signing-vector-v1.schema.json +1 -1
  104. package/schemas/whooshbang-v1.schema.json +1183 -422
  105. package/fixtures/core-v1/success/auto-top-up-setup.json +0 -5
  106. package/fixtures/core-v1/success/billing-portal-session.json +0 -3
  107. package/fixtures/core-v1/success/reconcile-auto-top-up-setup.json +0 -17
  108. package/fixtures/core-v1/success/reconcile-subscription-checkout.json +0 -35
  109. package/fixtures/core-v1/success/reconcile-wallet-checkout.json +0 -36
  110. package/fixtures/core-v1/success/subscription-checkout.json +0 -5
  111. package/fixtures/core-v1/success/wallet-checkout.json +0 -5
  112. /package/fixtures/core-v1/requests/{create-wallet-checkout.json → create-credit-purchase.json} +0 -0
  113. /package/fixtures/core-v1/requests/{create-subscription-checkout.json → create-subscription-change.json} +0 -0
@@ -5,15 +5,15 @@
5
5
  /**
6
6
  * Public request, resource, summary, and Problem Details models for the WhooshBang V1 REST API.
7
7
  */
8
- export type WhooshBangV1ContractDocument = OrganizationProjection | CloseOrganizationRequest | OrganizationClosureResult | CreateProjectRequest | Project | UpdateProjectRequest | PrivacyMode | ProjectCollection | RecipientCopyOverrideCollection | UpdateRecipientCopyOverrideRequest | CreateApiCredentialRequest | RotateApiCredentialRequest | ApiCredential | ApiCredentialCollection | ApiCredentialSecretReveal | ApiCredentialRotation | CreateOrganizationCredentialRequest | RotateOrganizationCredentialRequest | OrganizationCredential | OrganizationCredentialCollection | OrganizationCredentialSecretReveal | OrganizationCredentialRotation | CreateCustomerEndpointRequest | CustomerEndpoint | CustomerEndpointCollection | CustomerEndpointMutationResult | CustomerEndpointAttemptCollection | CustomerEndpointVerificationChallenge | CreateSubscriptionLinkRequest | SubscriptionLink | CreateMessageRequest | Message | Problem | IdempotencyKey | ProviderCapabilitiesCollection | ProviderInstallationCollection | EmailDomainCollection | CreateEmailDomainRequest | CreateEmailBindingImportRequest | EmailBindingImportJob | ConnectionProviderCollection | ChannelConnection | ChannelConnectionCollection | CreateChannelConnectionRequest | UpdateChannelConnectionRequest | RotateChannelConnectionCredentialRequest | NotifierConnectionCollection | AttachNotifierConnectionRequest | ConnectionTest | ConnectionTestCollection | CreateConnectionTestRequest | CustomerApplicationManifest | ProjectRecipientExperience | UpdateProjectRecipientExperienceRequest | RecipientBrandLogoUpload | NotificationImageAsset | EnvironmentRecipientExperience | UpdateEnvironmentRecipientExperienceRequest | SubscriberChannelSettings | AcknowledgeEmailRemediationRequest | CreateRecipientSessionRequest | CreateRecipientSessionResponse | RecipientSession | CreateProviderHandoffRequest | ProviderHandoff | RecipientHandoffCompletion | SetPreferredBindingRequest | PreferredBinding | CreateSubscriberRequest | UpdateSubscriberRequest | SubscriberCollection | Subscriber | SubscriberDataExport | CreateSubscriberGroupRequest | SubscriberGroup | SubscriberGroupCollection | SubscriberGroupMembership | SubscriberGroupMembershipCollection | CreateGroupBroadcastRequest | GroupBroadcast | AssertEmailConsentRequest | BindingSummary | UsageReport | MessageListEntry | MessageListPage | MessageDeliveryTimelineEntry | RetainedMessageContent | MessageDeliveryHistory | InteractionTimelineEntry | InteractionTimeline | UpdateEmailSenderRequest | CustomerEventDeliveryAttempt | CustomerEventDeliveryHistory | DeliveryHolds | MachineClientOperations | MachineClientOperationsList | RecipientCopyCatalogue | MessageNotificationImage | BillingAccount | CreateWalletCheckoutRequest | WalletCheckout | ReconcileWalletCheckoutResult | BillingEntitlements | CreateSubscriptionCheckoutRequest | SubscriptionCheckout | ReconcileSubscriptionCheckoutResult | ProjectAttribution | UpdateProjectAttributionRequest | BillingPortalSession | BillingProjectSlots | AssignBillingProjectSlotsRequest | UpdateAutoTopUpSettingsRequest | AutoTopUpSettings | AutoTopUpSetup | ReconcileAutoTopUpSetupResult | SubscriptionChange | ConfirmSubscriptionChangeRequest;
8
+ export type WhooshBangV1ContractDocument = OrganizationProjection | Teammate | TeammateCollection | TeammateAccessRequest | InviteTeammateRequest | CloseOrganizationRequest | OrganizationClosureResult | CreateProjectRequest | Project | UpdateProjectRequest | PrivacyMode | ProjectCollection | RecipientCopyOverrideCollection | UpdateRecipientCopyOverrideRequest | CreateApiCredentialRequest | RotateApiCredentialRequest | ApiCredential | ApiCredentialCollection | ApiCredentialSecretReveal | ApiCredentialRotation | CreateOrganizationCredentialRequest | RotateOrganizationCredentialRequest | OrganizationCredential | OrganizationCredentialCollection | OrganizationCredentialSecretReveal | OrganizationCredentialRotation | CreateCustomerEndpointRequest | CustomerEndpoint | CustomerEndpointCollection | CustomerEndpointMutationResult | CustomerEndpointAttemptCollection | CustomerEndpointVerificationChallenge | CreateSubscriptionLinkRequest | SubscriptionLink | CreateMessageRequest | Message | Problem | IdempotencyKey | ProviderCapabilitiesCollection | ProviderInstallationCollection | EmailDomainCollection | CreateEmailDomainRequest | CreateEmailBindingImportRequest | EmailBindingImportJob | ConnectionProviderCollection | ChannelConnection | ChannelConnectionCollection | CreateChannelConnectionRequest | UpdateChannelConnectionRequest | RotateChannelConnectionCredentialRequest | NotifierConnectionCollection | AttachNotifierConnectionRequest | ConnectionTest | ConnectionTestCollection | CreateConnectionTestRequest | CustomerApplicationManifest | ProjectRecipientExperience | UpdateProjectRecipientExperienceRequest | RecipientBrandLogoUpload | NotificationImageAsset | EnvironmentRecipientExperience | UpdateEnvironmentRecipientExperienceRequest | SubscriberChannelSettings | AcknowledgeEmailRemediationRequest | CreateRecipientSessionRequest | CreateRecipientSessionResponse | RecipientSession | CreateProviderHandoffRequest | ProviderHandoff | RecipientHandoffCompletion | SetPreferredBindingRequest | PreferredBinding | CreateSubscriberRequest | UpdateSubscriberRequest | SubscriberCollection | Subscriber | SubscriberDataExport | CreateSubscriberGroupRequest | SubscriberGroup | SubscriberGroupCollection | SubscriberGroupMembership | SubscriberGroupMembershipCollection | CreateGroupBroadcastRequest | GroupBroadcast | AssertEmailConsentRequest | BindingSummary | UsageReport | MessageListEntry | MessageListPage | MessageDeliveryTimelineEntry | RetainedMessageContent | MessageDeliveryHistory | InteractionTimelineEntry | InteractionTimeline | UpdateEmailSenderRequest | CustomerEventDeliveryAttempt | CustomerEventDeliveryHistory | DeliveryHolds | MachineClientOperations | MachineClientOperationsList | RecipientCopyCatalogue | MessageNotificationImage | BillingAccount | BillingCard | CardSetup | CreateCreditPurchaseRequest | CreditPurchase | BillingInvoice | BillingInvoiceCollection | UpdateBillingReceiptEmailRequest | BillingEntitlements | SubscriptionSelection1 | ProjectAttribution | UpdateProjectAttributionRequest | BillingProjectSlots | AssignBillingProjectSlotsRequest | UpdateAutoTopUpSettingsRequest | AutoTopUpSettings | SubscriptionChange | ConfirmSubscriptionChangeRequest;
9
9
  /**
10
10
  * An opaque identifier. Its shape, ordering, and embedded content are not public promises.
11
11
  */
12
12
  export type OpaqueIdentifier = string;
13
13
  /**
14
- * The stable WhooshBang authorization role projected from the current Clerk organization membership.
14
+ * The person's WhooshBang role in the organization. `admin` does everything, including billing, API keys and teammates. `member` runs the projects they were given: channels, subscribers, messages and project settings. `messenger` sends messages and reads replies in the projects they were given. Clients must tolerate roles added later.
15
15
  */
16
- export type OrganizationRole = "admin" | "member";
16
+ export type OrganizationRole = "admin" | "member" | "messenger";
17
17
  /**
18
18
  * An RFC 3339 timestamp with a UTC offset. The server is authoritative.
19
19
  */
@@ -22,6 +22,26 @@ export type Timestamp = string;
22
22
  * A safe public identifier used to correlate protected service diagnostics.
23
23
  */
24
24
  export type DiagnosticId = string;
25
+ /**
26
+ * `active` has joined. `invited` has an invitation they have not accepted.
27
+ */
28
+ export type TeammateStatus = "active" | "invited";
29
+ /**
30
+ * A 1-based page number. Present on a response only when the request addressed the list by page rather than by cursor: a cursor walk cannot know which page it is on. What is bounded is the row a page starts at, not the page number: a request whose first row would be past 50,000 — the deepest row any published list ceiling reaches — is refused as `request_invalid`. Bounding the page number instead would make the last rows of a large list unreachable at a small page size, which is exactly when a person is paging through one.
31
+ */
32
+ export type ListPageNumber = number;
33
+ /**
34
+ * The page size that produced `items`, echoed so a caller that sent no `limit` can still divide `total` into pages without knowing the server default.
35
+ */
36
+ export type ListPageSize = number;
37
+ /**
38
+ * How many records the list holds in total, not only on this page. Counted while the page was read, so a write landing between the count and the page can leave it a record or two out of step with `items`. That is noise on an inspection surface; it never changes which records a page addresses.
39
+ */
40
+ export type ListTotal = number;
41
+ /**
42
+ * Exactly one mailbox: an unquoted ASCII dot-atom local part plus a canonical lower-case IDNA domain. The comparison key preserves local-part bytes and case and lower-cases only the domain; dot, plus-tag, alias and provider equivalence are never inferred.
43
+ */
44
+ export type EmailAddress = string;
25
45
  /**
26
46
  * A provider that can back a Channel Connection. A member can be frozen before its adapter exists; deployments advertise only providers they can execute.
27
47
  */
@@ -38,18 +58,6 @@ export type Environment = "test" | "live";
38
58
  * Project profile collection policy. standard (the default for new projects) permits messenger profile data, including the name a subscriber's channel gives; minimal keeps recipient language only; private retains delivery routing and the customer-supplied subscriber identifier, with no profile data. Lowering collection erases existing fields the new mode disallows.
39
59
  */
40
60
  export type PrivacyMode = "minimal" | "standard" | "private";
41
- /**
42
- * A 1-based page number. Present on a response only when the request addressed the list by page rather than by cursor: a cursor walk cannot know which page it is on. What is bounded is the row a page starts at, not the page number: a request whose first row would be past 50,000 — the deepest row any published list ceiling reaches — is refused as `request_invalid`. Bounding the page number instead would make the last rows of a large list unreachable at a small page size, which is exactly when a person is paging through one.
43
- */
44
- export type ListPageNumber = number;
45
- /**
46
- * The page size that produced `items`, echoed so a caller that sent no `limit` can still divide `total` into pages without knowing the server default.
47
- */
48
- export type ListPageSize = number;
49
- /**
50
- * How many records the list holds in total, not only on this page. Counted while the page was read, so a write landing between the count and the page can leave it a record or two out of step with `items`. That is noise on an inspection surface; it never changes which records a page addresses.
51
- */
52
- export type ListTotal = number;
53
61
  /**
54
62
  * Every recipient-facing text is customizable (owner decision 2026-09-30, FXO-2739). Labels do not change the actions or capability semantics of recipient controls.
55
63
  */
@@ -326,7 +334,7 @@ export type CreateSubscriptionLinkRequest = {
326
334
  */
327
335
  connection_id?: string;
328
336
  /**
329
- * The exact recipient address for a server-initiated email verification. It is accepted only when the selected channel is email, stored encrypted, and does not assert consent. Omit it when the recipient will enter the address on the hosted page.
337
+ * Exactly one mailbox: an unquoted ASCII dot-atom local part plus a canonical lower-case IDNA domain. The comparison key preserves local-part bytes and case and lower-cases only the domain; dot, plus-tag, alias and provider equivalence are never inferred.
330
338
  */
331
339
  address?: string;
332
340
  /**
@@ -470,8 +478,52 @@ export type BindingSummary = {
470
478
  };
471
479
  domain_id: OpaqueIdentifier;
472
480
  };
481
+ } | {
482
+ id: OpaqueIdentifier;
483
+ project_id: OpaqueIdentifier;
484
+ environment: Environment;
485
+ subscriber_id: OpaqueIdentifier;
486
+ notifier_id: OpaqueIdentifier;
487
+ channel: "email";
488
+ connection_id: OpaqueIdentifier;
489
+ status: "active" | "paused" | "revoked";
490
+ /**
491
+ * Exactly one mailbox: an unquoted ASCII dot-atom local part plus a canonical lower-case IDNA domain. The comparison key preserves local-part bytes and case and lower-cases only the domain; dot, plus-tag, alias and provider equivalence are never inferred.
492
+ */
493
+ address: string;
494
+ basis: "service";
495
+ service: {
496
+ source: string;
497
+ asserted_at: Timestamp;
498
+ asserted_by: {
499
+ kind: "credential" | "grant" | "session";
500
+ id: OpaqueIdentifier;
501
+ };
502
+ domain_id: OpaqueIdentifier;
503
+ relationship_started_at: Timestamp;
504
+ };
505
+ } | {
506
+ id: OpaqueIdentifier;
507
+ project_id: OpaqueIdentifier;
508
+ environment: Environment;
509
+ subscriber_id: OpaqueIdentifier;
510
+ notifier_id: OpaqueIdentifier;
511
+ channel: "email";
512
+ connection_id: OpaqueIdentifier;
513
+ status: "active" | "paused" | "revoked";
514
+ basis: "service";
515
+ service: {
516
+ source: string;
517
+ asserted_at: Timestamp;
518
+ asserted_by: {
519
+ kind: "credential" | "grant" | "session";
520
+ id: OpaqueIdentifier;
521
+ };
522
+ domain_id: OpaqueIdentifier;
523
+ relationship_started_at: Timestamp;
524
+ };
473
525
  };
474
- export type ProblemCode = "authentication_required" | "credential_invalid" | "scope_forbidden" | "environment_mismatch" | "idempotency_key_required" | "idempotency_conflict" | "privacy_operation_in_progress" | "project_slug_conflict" | "request_invalid" | "replay_unavailable" | "subscriber_unbound" | "subscriber_not_connected" | "recipient_configuration_invalid" | "recipient_origin_forbidden" | "return_destination_not_found" | "recipient_capability_invalid" | "recipient_handoff_invalid" | "preferred_binding_conflict" | "preferred_binding_unavailable" | "subscriber_conflict" | "subscriber_group_conflict" | "subscriber_group_archived" | "resource_not_found" | "resource_expired" | "cancellation_too_late" | "credential_organization_mismatch" | "endpoint_rotation_conflict" | "rate_limited" | "provider_retryable" | "provider_terminal" | "provider_outcome_unknown" | "internal_error";
526
+ export type ProblemCode = "authentication_required" | "credential_invalid" | "scope_forbidden" | "environment_mismatch" | "idempotency_key_required" | "idempotency_conflict" | "privacy_operation_in_progress" | "project_slug_conflict" | "request_invalid" | "replay_unavailable" | "subscriber_unbound" | "subscriber_not_connected" | "recipient_configuration_invalid" | "recipient_origin_forbidden" | "return_destination_not_found" | "recipient_capability_invalid" | "recipient_handoff_invalid" | "preferred_binding_conflict" | "preferred_binding_unavailable" | "subscriber_conflict" | "subscriber_group_conflict" | "subscriber_group_archived" | "resource_not_found" | "resource_expired" | "cancellation_too_late" | "credential_organization_mismatch" | "endpoint_rotation_conflict" | "rate_limited" | "provider_retryable" | "provider_terminal" | "provider_outcome_unknown" | "internal_error" | "not_consented_for_marketing";
475
527
  /**
476
528
  * Creates one logical message for one subscriber and one resolved channel binding.
477
529
  */
@@ -499,6 +551,10 @@ export type CreateMessageRequest = {
499
551
  * A required-type tagged union. C0 supports confirm, single-select, and input only.
500
552
  */
501
553
  interaction?: ConfirmInteractionRequest | SelectInteractionRequest | InputInteractionRequest;
554
+ /**
555
+ * Omitted means service. Marketing refuses service-only bindings before charging and at every delayed dispatch.
556
+ */
557
+ purpose?: "service" | "marketing";
502
558
  };
503
559
  export type MessageContent = TextContent | DocumentContent;
504
560
  /**
@@ -583,6 +639,10 @@ export type Message = {
583
639
  */
584
640
  connection_test_id?: string;
585
641
  outcome_guidance?: "Delivery may have been accepted by the provider. No automatic retry is scheduled; create a new message explicitly if another attempt is appropriate.";
642
+ /**
643
+ * Omitted means service. Marketing refuses service-only bindings before charging and at every delayed dispatch.
644
+ */
645
+ purpose?: "service" | "marketing";
586
646
  };
587
647
  /**
588
648
  * The effective provider boundary selected for a message. Connection delivery uses the exact authorized environment connection; simulator delivery never calls a provider.
@@ -1129,6 +1189,13 @@ export type Problem1 = {
1129
1189
  code?: "internal_error";
1130
1190
  retryable?: true;
1131
1191
  [k: string]: unknown;
1192
+ } | {
1193
+ type?: "https://whooshbang.flowxo.com/problems/not_consented_for_marketing";
1194
+ title?: "Marketing consent required";
1195
+ status?: 422;
1196
+ code?: "not_consented_for_marketing";
1197
+ retryable?: false;
1198
+ [k: string]: unknown;
1132
1199
  };
1133
1200
  /**
1134
1201
  * Visible ASCII, scoped by authenticated environment, operation ID, and key, and retained for seven days from first acceptance.
@@ -1288,10 +1355,6 @@ export type EmailDomainGuide = {
1288
1355
  */
1289
1356
  instructions_url?: string;
1290
1357
  };
1291
- /**
1292
- * Exactly one mailbox: an unquoted ASCII dot-atom local part plus a canonical lower-case IDNA domain. The comparison key preserves local-part bytes and case and lower-cases only the domain; dot, plus-tag, alias and provider equivalence are never inferred.
1293
- */
1294
- export type EmailAddress = string;
1295
1358
  /**
1296
1359
  * How consent for this exact subscriber, notifier and connection was established. A customer assertion never becomes recipient-observed verification. Complaint, unsubscribe and suppression override either arm.
1297
1360
  */
@@ -2361,6 +2424,40 @@ export type SubscriberGroupMembership = {
2361
2424
  updated_at: Timestamp;
2362
2425
  diagnostic_id: DiagnosticId;
2363
2426
  };
2427
+ /**
2428
+ * Assert prior consent or enroll an application-verified user for service email on an exact customer-owned connection. Revocation and sending restrictions always win.
2429
+ */
2430
+ export type AssertEmailConsentRequest = {
2431
+ subscriber_id: OpaqueIdentifier;
2432
+ notifier_id: OpaqueIdentifier;
2433
+ connection_id: OpaqueIdentifier;
2434
+ domain_id: OpaqueIdentifier;
2435
+ address: EmailAddress;
2436
+ consented: true;
2437
+ /**
2438
+ * An RFC 3339 timestamp with a UTC offset. The server is authoritative.
2439
+ */
2440
+ consented_at: string;
2441
+ /**
2442
+ * A bounded customer description of where consent was collected. The authenticated asserting actor is recorded by the service, never accepted from this object.
2443
+ */
2444
+ source?: string;
2445
+ } | {
2446
+ subscriber_id: OpaqueIdentifier;
2447
+ notifier_id: OpaqueIdentifier;
2448
+ connection_id: OpaqueIdentifier;
2449
+ domain_id: OpaqueIdentifier;
2450
+ address: EmailAddress;
2451
+ /**
2452
+ * A bounded customer description of the service relationship. The authenticated asserting actor is recorded by the service, never accepted from this object.
2453
+ */
2454
+ source: string;
2455
+ basis: "service";
2456
+ /**
2457
+ * An RFC 3339 timestamp with a UTC offset. The server is authoritative.
2458
+ */
2459
+ relationship_started_at: string;
2460
+ };
2364
2461
  /**
2365
2462
  * A calendar day in UTC, as `YYYY-MM-DD`.
2366
2463
  */
@@ -2415,24 +2512,6 @@ export type MachineScopeSummary = [
2415
2512
  ("machine-messages:write" | "machine-messages:read" | "machine-events:read" | "machine-events:ack"),
2416
2513
  ("machine-messages:write" | "machine-messages:read" | "machine-events:read" | "machine-events:ack")
2417
2514
  ];
2418
- /**
2419
- * Account subscription selection for initial Checkout or a quoted change. Additional project quantities have a technical Checkout bound. The server selects approved prices and allowances. Attribution is included on Team and Agency; PAYG may purchase the account-wide add-on.
2420
- */
2421
- export type CreateSubscriptionCheckoutRequest = CreateSubscriptionCheckoutRequest1 & {
2422
- plan: "payg" | "team" | "agency";
2423
- hide_attribution: boolean;
2424
- additional_projects: number;
2425
- };
2426
- export type CreateSubscriptionCheckoutRequest1 = {
2427
- plan?: "team" | "agency";
2428
- [k: string]: unknown;
2429
- } | {
2430
- hide_attribution?: true;
2431
- [k: string]: unknown;
2432
- } | {
2433
- additional_projects?: number;
2434
- [k: string]: unknown;
2435
- };
2436
2515
  /**
2437
2516
  * The current Clerk organization projected as a WhooshBang tenant. Clerk organization and user identifiers are not public fields.
2438
2517
  */
@@ -2448,6 +2527,81 @@ export interface OrganizationProjection {
2448
2527
  export interface OrganizationMembershipSummary {
2449
2528
  role: OrganizationRole;
2450
2529
  }
2530
+ /**
2531
+ * One person in the organization, or one invitation to it. Identity-provider identifiers are not public fields.
2532
+ */
2533
+ export interface Teammate {
2534
+ id: OpaqueIdentifier;
2535
+ status: TeammateStatus;
2536
+ role: OrganizationRole;
2537
+ /**
2538
+ * The person's name, when they have given one. Null for an invitation.
2539
+ */
2540
+ name: null | string;
2541
+ /**
2542
+ * The address the person signs in with, or the address invited.
2543
+ */
2544
+ email: null | string;
2545
+ projects: TeammateProjectAccess;
2546
+ /**
2547
+ * Whether this is the person making the request.
2548
+ */
2549
+ is_current_user: boolean;
2550
+ /**
2551
+ * An RFC 3339 timestamp with a UTC offset. The server is authoritative.
2552
+ */
2553
+ created_at: string;
2554
+ /**
2555
+ * An RFC 3339 timestamp with a UTC offset. The server is authoritative.
2556
+ */
2557
+ expires_at?: string;
2558
+ }
2559
+ /**
2560
+ * Which projects the teammate can see. An admin sees every project, including ones created later.
2561
+ */
2562
+ export interface TeammateProjectAccess {
2563
+ all: boolean;
2564
+ /**
2565
+ * The projects given to this teammate. Empty when `all` is true.
2566
+ *
2567
+ * @maxItems 1000
2568
+ */
2569
+ project_ids: OpaqueIdentifier[];
2570
+ }
2571
+ /**
2572
+ * Everybody in the organization and every open invitation, people first.
2573
+ */
2574
+ export interface TeammateCollection {
2575
+ /**
2576
+ * @maxItems 100
2577
+ */
2578
+ items: Teammate[];
2579
+ next_cursor?: string;
2580
+ page?: ListPageNumber;
2581
+ page_size?: ListPageSize;
2582
+ total: ListTotal;
2583
+ }
2584
+ /**
2585
+ * A role and, except for an admin, at least one project. An admin sees every project and takes no list.
2586
+ */
2587
+ export interface TeammateAccessRequest {
2588
+ role: OrganizationRole;
2589
+ /**
2590
+ * @maxItems 1000
2591
+ */
2592
+ project_ids?: OpaqueIdentifier[];
2593
+ }
2594
+ /**
2595
+ * Invites one person by email with their role and projects in one step.
2596
+ */
2597
+ export interface InviteTeammateRequest {
2598
+ email: EmailAddress;
2599
+ role: OrganizationRole;
2600
+ /**
2601
+ * @maxItems 1000
2602
+ */
2603
+ project_ids?: OpaqueIdentifier[];
2604
+ }
2451
2605
  /**
2452
2606
  * Exact, explicit confirmation that the current organization administrator intends to close the whole organization.
2453
2607
  */
@@ -6662,6 +6816,10 @@ export interface CreateGroupBroadcastRequest {
6662
6816
  * A required-type tagged union. C0 supports confirm, single-select, and input only.
6663
6817
  */
6664
6818
  interaction?: ConfirmInteractionRequest | SelectInteractionRequest | InputInteractionRequest;
6819
+ /**
6820
+ * Omitted means service. Marketing refuses service-only bindings before charging and at every delayed dispatch.
6821
+ */
6822
+ purpose?: "service" | "marketing";
6665
6823
  }
6666
6824
  /**
6667
6825
  * One durable acceptance against an exact group membership revision. Delivery remains represented by ordinary child messages.
@@ -6698,25 +6856,6 @@ export interface BroadcastAggregate {
6698
6856
  cancelled: number;
6699
6857
  expired: number;
6700
6858
  }
6701
- /**
6702
- * Atomically create or resolve one subscriber and assert existing consent for an exact customer-owned email connection and domain. No verification message is sent. Revocation, suppression, recipient pause, holds and unhealthy authority take precedence. An omitted source is recorded as customer.
6703
- */
6704
- export interface AssertEmailConsentRequest {
6705
- subscriber_id: OpaqueIdentifier;
6706
- notifier_id: OpaqueIdentifier;
6707
- connection_id: OpaqueIdentifier;
6708
- domain_id: OpaqueIdentifier;
6709
- address: EmailAddress;
6710
- consented: true;
6711
- /**
6712
- * An RFC 3339 timestamp with a UTC offset. The server is authoritative.
6713
- */
6714
- consented_at: string;
6715
- /**
6716
- * A bounded customer description of where consent was collected. The authenticated asserting actor is recorded by the service, never accepted from this object.
6717
- */
6718
- source?: string;
6719
- }
6720
6859
  /**
6721
6860
  * An environment's accepted messages per UTC day over an inclusive range, one bucket for every day in the range including days with none, oldest first. `totals` sums the range.
6722
6861
  */
@@ -7797,7 +7936,7 @@ export interface MessageNotificationImage {
7797
7936
  data_base64: string;
7798
7937
  }
7799
7938
  /**
7800
- * Shared account wallet. Bonus funds core sends only; shared email draws purchased or starter credit. Amounts are exact USD decimal strings. Negative purchased or bonus balances retain refund debt and are not spendable.
7939
+ * Shared account message credit. Bonus funds core sends only; shared email draws purchased or starter credit. Amounts are exact USD decimal strings. Negative purchased or bonus balances retain refund debt and are not spendable.
7801
7940
  */
7802
7941
  export interface BillingAccount {
7803
7942
  currency: "USD";
@@ -7808,23 +7947,128 @@ export interface BillingAccount {
7808
7947
  available_email_credit_usd: string;
7809
7948
  core_price_per_1000_usd: "3.000000";
7810
7949
  shared_email_price_per_1000_usd: "1.000000";
7811
- checkout_available: boolean;
7950
+ /**
7951
+ * Whether this deployment can take card payments now. When false, credit, plans and add-ons cannot be bought.
7952
+ */
7953
+ purchases_available: boolean;
7812
7954
  packs: {
7813
7955
  purchase_cents: 500 | 1000 | 2500 | 5000 | 10000;
7814
7956
  core_credit_usd: string;
7815
7957
  }[];
7958
+ card: null | BillingCard;
7959
+ /**
7960
+ * Where receipts and invoices are emailed. Null sends none.
7961
+ */
7962
+ receipt_email: null | EmailAddress;
7816
7963
  }
7817
- export interface CreateWalletCheckoutRequest {
7818
- purchase_cents: 500 | 1000 | 2500 | 5000 | 10000;
7964
+ /**
7965
+ * The organization's one default card. It pays for credit, automatic top-up, plans and add-ons. Only the brand, last four digits and expiry are ever returned.
7966
+ */
7967
+ export interface BillingCard {
7968
+ brand: string;
7969
+ last_four: string;
7970
+ exp_month: number;
7971
+ exp_year: number;
7819
7972
  }
7820
- export interface WalletCheckout {
7973
+ /**
7974
+ * A card form session. A person enters the card in the embeddable payment form mounted with client_secret and publishable_key, then reconciles. A complete setup makes that card the one default card. client_secret is present only while open.
7975
+ */
7976
+ export interface CardSetup {
7821
7977
  id: string;
7822
7978
  status: "open" | "complete" | "expired";
7823
- checkout_url: string | null;
7979
+ client_secret: string | null;
7980
+ publishable_key: string | null;
7981
+ card: null | BillingCard;
7824
7982
  }
7825
- export interface ReconcileWalletCheckoutResult {
7826
- outcome: "applied" | "unpaid" | "ignored";
7827
- account: BillingAccount;
7983
+ /**
7984
+ * Buy one credit pack now with the default card. The amount is the explicit approval of the charge.
7985
+ */
7986
+ export interface CreateCreditPurchaseRequest {
7987
+ purchase_cents: 500 | 1000 | 2500 | 5000 | 10000;
7988
+ }
7989
+ /**
7990
+ * A credit pack charged to the default card. paid means the credit is in the balance. requires_action means the card issuer asks the customer to confirm in the payment form using client_secret; reconcile afterwards. A failed purchase charged nothing; start a new one after updating the card.
7991
+ */
7992
+ export interface CreditPurchase {
7993
+ id: string;
7994
+ purchase_cents: 500 | 1000 | 2500 | 5000 | 10000;
7995
+ credit_usd: string;
7996
+ status: "processing" | "requires_action" | "paid" | "failed";
7997
+ failure: ("card_declined" | "authentication_failed") | null;
7998
+ client_secret: string | null;
7999
+ /**
8000
+ * The public key the payment form uses with client_secret. Present only with client_secret.
8001
+ */
8002
+ publishable_key: string | null;
8003
+ card: BillingCard;
8004
+ }
8005
+ /**
8006
+ * One charge or credit grant. Credit purchases carry purchase_cents; recurring invoices carry their items and paid period. document_url downloads the invoice PDF or opens the receipt.
8007
+ */
8008
+ export interface BillingInvoice {
8009
+ id: string;
8010
+ kind: "credit" | "automatic_top_up" | "recurring" | "welcome_credit";
8011
+ created_at: string;
8012
+ amount_usd: string;
8013
+ status: "paid" | "open" | "void" | "uncollectible" | "refunded" | "free";
8014
+ purchase_cents: (500 | 1000 | 2500 | 5000 | 10000) | null;
8015
+ /**
8016
+ * @maxItems 3
8017
+ */
8018
+ items: [] | [
8019
+ {
8020
+ kind: "team" | "agency" | "attribution" | "project";
8021
+ quantity: number;
8022
+ }
8023
+ ] | [
8024
+ {
8025
+ kind: "team" | "agency" | "attribution" | "project";
8026
+ quantity: number;
8027
+ },
8028
+ {
8029
+ kind: "team" | "agency" | "attribution" | "project";
8030
+ quantity: number;
8031
+ }
8032
+ ] | [
8033
+ {
8034
+ kind: "team" | "agency" | "attribution" | "project";
8035
+ quantity: number;
8036
+ },
8037
+ {
8038
+ kind: "team" | "agency" | "attribution" | "project";
8039
+ quantity: number;
8040
+ },
8041
+ {
8042
+ kind: "team" | "agency" | "attribution" | "project";
8043
+ quantity: number;
8044
+ }
8045
+ ];
8046
+ period_start: string | null;
8047
+ period_end: string | null;
8048
+ document_url: string | null;
8049
+ document_kind: ("invoice" | "receipt") | null;
8050
+ }
8051
+ /**
8052
+ * A page of invoices and receipts, newest first.
8053
+ */
8054
+ export interface BillingInvoiceCollection {
8055
+ /**
8056
+ * @maxItems 100
8057
+ */
8058
+ items: BillingInvoice[];
8059
+ next_cursor?: string;
8060
+ page?: ListPageNumber;
8061
+ page_size?: ListPageSize;
8062
+ total?: ListTotal;
8063
+ }
8064
+ /**
8065
+ * Where receipts and invoices are emailed. Null stops them.
8066
+ */
8067
+ export interface UpdateBillingReceiptEmailRequest {
8068
+ /**
8069
+ * The receipt address, or null.
8070
+ */
8071
+ email: null | EmailAddress;
7828
8072
  }
7829
8073
  export interface BillingEntitlements {
7830
8074
  /**
@@ -7838,7 +8082,10 @@ export interface BillingEntitlements {
7838
8082
  live_notifications_remaining: string;
7839
8083
  shared_emails_remaining: string;
7840
8084
  allowance_period_end: string | null;
7841
- recurring_checkout_available: boolean;
8085
+ /**
8086
+ * Whether plans and add-ons can be bought now. False when the deployment has no recurring catalog or cannot take payments.
8087
+ */
8088
+ recurring_available: boolean;
7842
8089
  offers: {
7843
8090
  kind: "team" | "agency" | "attribution" | "project";
7844
8091
  monthly_price_usd: string;
@@ -7847,19 +8094,44 @@ export interface BillingEntitlements {
7847
8094
  included_projects: number;
7848
8095
  hide_attribution: boolean;
7849
8096
  }[];
7850
- pending_subscription_checkout_id: string | null;
7851
- subscription_management_available: boolean;
7852
8097
  has_subscription: boolean;
7853
8098
  pending_subscription_change_id?: string | null;
8099
+ /**
8100
+ * A recurring charge the default card did not pay. Paid access continues until the paid boundary; another attempt follows at next_attempt_at, or none when null. Update the card to settle it.
8101
+ */
8102
+ payment_issue: null | {
8103
+ amount_usd: string;
8104
+ next_attempt_at: string | null;
8105
+ };
8106
+ recurring_selection?: SubscriptionSelection;
7854
8107
  }
7855
- export interface SubscriptionCheckout {
7856
- id: string;
7857
- status: "open" | "complete" | "expired";
7858
- checkout_url: string | null;
8108
+ /**
8109
+ * Selection that will renew; paid project capacity can also include dropped extras until their original expiry. Optional for compatibility with older servers.
8110
+ */
8111
+ export interface SubscriptionSelection {
8112
+ plan: "payg" | "team" | "agency";
8113
+ /**
8114
+ * Remove WhooshBang branding from recipient emails, messages and subscription pages.
8115
+ */
8116
+ hide_attribution: boolean;
8117
+ /**
8118
+ * Extra projects beyond the plan's included projects, each billed monthly.
8119
+ */
8120
+ additional_projects: number;
7859
8121
  }
7860
- export interface ReconcileSubscriptionCheckoutResult {
7861
- outcome: "applied" | "unpaid" | "ignored";
7862
- entitlements: BillingEntitlements;
8122
+ /**
8123
+ * An account's recurring selection: a plan, branding removal and extra projects. The server selects approved prices and allowances. Branding removal is included on Team and Agency; Pay as you go may add it. Choosing Pay as you go with nothing else ends every recurring charge at the paid boundary.
8124
+ */
8125
+ export interface SubscriptionSelection1 {
8126
+ plan: "payg" | "team" | "agency";
8127
+ /**
8128
+ * Remove WhooshBang branding from recipient emails, messages and subscription pages.
8129
+ */
8130
+ hide_attribution: boolean;
8131
+ /**
8132
+ * Extra projects beyond the plan's included projects, each billed monthly.
8133
+ */
8134
+ additional_projects: number;
7863
8135
  }
7864
8136
  /**
7865
8137
  * The saved project preference and current server-enforced paid entitlement. Expiry restores visible attribution without changing sender identity, consent, unsubscribe or answer controls.
@@ -7872,20 +8144,17 @@ export interface ProjectAttribution {
7872
8144
  export interface UpdateProjectAttributionRequest {
7873
8145
  hide_attribution: boolean;
7874
8146
  }
7875
- export interface BillingPortalSession {
7876
- portal_url: string;
7877
- }
7878
8147
  /**
7879
- * Reusable account project slots. After a downgrade the oldest requested projects retain active slots. Unassigned projects retain data, accepted delivery and answers; new live sends require an active slot.
8148
+ * Reusable account project slots. After a downgrade the oldest requested projects retain active slots. Unassigned projects retain data, accepted delivery and answers; new live sends require an active slot. Paid capacity includes all unexpired project purchases, so retained dropped extras can exceed the maximum renewing selection.
7880
8149
  */
7881
8150
  export interface BillingProjectSlots {
7882
8151
  project_capacity: number;
7883
8152
  /**
7884
- * @maxItems 10025
8153
+ * @maxItems 2147483647
7885
8154
  */
7886
8155
  requested_project_ids: OpaqueIdentifier[];
7887
8156
  /**
7888
- * @maxItems 10025
8157
+ * @maxItems 2147483647
7889
8158
  */
7890
8159
  active_project_ids: OpaqueIdentifier[];
7891
8160
  }
@@ -7904,6 +8173,9 @@ export interface UpdateAutoTopUpSettingsRequest {
7904
8173
  trigger_cents: number;
7905
8174
  monthly_cap_cents: number;
7906
8175
  }
8176
+ /**
8177
+ * Automatic top-up is off by default. When on, the default card buys the selected pack whenever credit falls below the trigger. The monthly cap counts pending and paid purchases started in each UTC calendar month; refunds do not restore it. Turning it off stops future purchases; one already processing may finish. needs_card means there is no default card yet.
8178
+ */
7907
8179
  export interface AutoTopUpSettings {
7908
8180
  enabled: boolean;
7909
8181
  purchase_cents: 500 | 1000 | 2500 | 5000 | 10000;
@@ -7912,35 +8184,45 @@ export interface AutoTopUpSettings {
7912
8184
  available: boolean;
7913
8185
  monthly_reserved_cents: number;
7914
8186
  state: "disabled" | "needs_card" | "ready" | "processing" | "card_update_required" | "monthly_cap_reached";
7915
- saved_card: null | {
7916
- brand: string;
7917
- last_four: string;
8187
+ card: null | BillingCard;
8188
+ /**
8189
+ * The most recent paid automatic purchase, if any.
8190
+ */
8191
+ last_purchase: null | {
8192
+ id: string;
8193
+ purchase_cents: 500 | 1000 | 2500 | 5000 | 10000;
8194
+ credit_usd: string;
8195
+ completed_at: string;
7918
8196
  };
7919
- pending_setup_id: string | null;
7920
- }
7921
- export interface AutoTopUpSetup {
7922
- id: string;
7923
- status: "open" | "complete" | "expired";
7924
- checkout_url: string | null;
7925
- }
7926
- export interface ReconcileAutoTopUpSetupResult {
7927
- outcome: "applied" | "unpaid" | "ignored";
7928
- settings: AutoTopUpSettings;
7929
8197
  }
7930
8198
  /**
7931
- * An owned immutable recurring selection. A reserved quote has not charged a card. Confirm its exact immediate cash charge; paid upgrades reset the cycle and carry unused paid time, while reductions start at the existing paid boundary. Processing or pending outcomes must be recovered without starting another change.
8199
+ * An owned recurring selection. A reserved quote has not charged anything. start buys the first plan or add-on; upgrade charges now, resets the cycle and credits unused paid time; boundary reductions start at the existing paid boundary. Confirm the exact immediate charge; the default card pays it. Processing or pending changes are recovered, never repeated.
7932
8200
  */
7933
8201
  export interface SubscriptionChange {
7934
8202
  id: string;
7935
- kind: "upgrade" | "boundary";
8203
+ kind: "start" | "upgrade" | "boundary";
7936
8204
  status: "reserved" | "processing" | "pending" | "scheduled" | "applied" | "expired";
7937
- selection: CreateSubscriptionCheckoutRequest;
8205
+ selection: SubscriptionSelection1;
7938
8206
  monthly_price_usd: string;
7939
8207
  charge_now_usd: string | null;
8208
+ /**
8209
+ * Compatibility field: new upgrades return 0.000000; starts and boundary changes return null. Historical quotes can retain their recorded unused-time credit. No new automatic unused-time refunds or offsets.
8210
+ */
7940
8211
  unused_time_credit_usd: string | null;
7941
8212
  effective_at: string | null;
7942
8213
  expires_at: string;
7943
- payment_url: string | null;
8214
+ /**
8215
+ * Present only while the card issuer asks the customer to confirm this charge in the payment form.
8216
+ */
8217
+ client_secret: string | null;
8218
+ /**
8219
+ * The public key the payment form uses with client_secret. Present only with client_secret.
8220
+ */
8221
+ publishable_key: string | null;
8222
+ /**
8223
+ * Why the last charge attempt failed. Update the card, then confirm again.
8224
+ */
8225
+ failure: ("card_declined" | "authentication_failed") | null;
7944
8226
  }
7945
8227
  export interface ConfirmSubscriptionChangeRequest {
7946
8228
  /**