@usebillow/sdk 0.11.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { f as SavedPaymentMethod, g as CreateHostedDomainInput, h as PayInvoiceInput } from './index.d-DSEYhV2c.js';
2
- export { i as ContractAddSubscriptionItemInput, j as ContractApplySubscriptionCouponInput, k as ContractCancelSubscriptionInput, l as ContractChangeSubscriptionPlanInput, m as ContractCreateChargeInput, n as ContractCreateCustomerInput, o as ContractCreateMerchantInitiatedChargeInput, p as ContractCreatePortalSessionInput, q as ContractCreateProductInput, r as ContractCreateSubscriptionInput, s as ContractCreateWebhookEndpointInput, M as ContractMigrateSubscribersInput, R as ContractRefundChargeInput, t as ContractResolveRefundInput, U as ContractUpdateProductInput, u as ContractUpdateSubscriptionItemInput, v as ContractUpdateWebhookEndpointInput, H as HostedDomain, w as HostedDomainList, I as InvoicePaymentResult } from './index.d-DSEYhV2c.js';
1
+ import { f as SavedPaymentMethod, g as CreateHostedDomainInput, h as PayInvoiceInput } from './index.d-D5v2ETKF.js';
2
+ export { i as ContractAddSubscriptionItemInput, j as ContractApplySubscriptionCouponInput, k as ContractCancelSubscriptionInput, l as ContractChangeSubscriptionPlanInput, m as ContractCreateChargeInput, n as ContractCreateCustomerInput, o as ContractCreateMerchantInitiatedChargeInput, p as ContractCreatePortalSessionInput, q as ContractCreateProductInput, r as ContractCreateSubscriptionInput, s as ContractCreateWebhookEndpointInput, M as ContractMigrateSubscribersInput, R as ContractRefundChargeInput, t as ContractResolveRefundInput, U as ContractUpdateProductInput, u as ContractUpdateSubscriptionItemInput, v as ContractUpdateWebhookEndpointInput, H as HostedDomain, w as HostedDomainList, I as InvoicePaymentResult } from './index.d-D5v2ETKF.js';
3
3
  import { C as ChargeStatus, P as PaymentMethodStatus, I as InvoiceStatus, R as RefundStatus, W as WebhookDeliveryStatus } from './billing-status-DZkB0VPK.js';
4
4
  export { a as CHARGE_STATUSES, b as INVOICE_STATUSES, c as PAYMENT_METHOD_STATUSES, d as REFUND_STATUSES, e as WEBHOOK_DELIVERY_STATUSES } from './billing-status-DZkB0VPK.js';
5
5
  import { SubscriptionStatus } from './status.js';
6
6
  export { ACTIVE_SUBSCRIPTION_STATUSES, NEVER_ACTIVATED_SUBSCRIPTION_STATUSES, SUBSCRIPTION_STATUSES, TERMINAL_SUBSCRIPTION_STATUSES, grantsAccess, isTerminal } from './status.js';
7
- import { c as TaxBehavior, d as Customer, U as UnappliedPaymentReason, e as CreateChargeInput, R as RequestOptions, f as Charge, g as CreateMerchantInitiatedChargeInput, I as IdempotentRequestOptions, h as CallOptions, C as CreateProductInput, i as UpdateProductInput, j as MigrationResult, k as CreateSubscriptionInput, B as BillowOptions, a as CreateCouponInput, l as Coupon, F as FeatureKind, M as MeterConfig, m as Feature, n as UpdateFeatureInput, o as UsageAlert, p as CreateUsageAlertInput, b as CheckResult, T as TrackResult, E as EntitlementView, A as AttachResult } from './billing-Bs10EcjR.js';
8
- export { q as ActivatedSubscriptionResult, r as BillingInterval, s as CouponDuration, t as CouponKind, u as CreateSubscriptionResult, v as EntitlementInput, w as MeterAggregation, x as MeterFilter, y as MeterRoundingMode, z as PendingSubscriptionCheckoutResult, D as PriceInput, P as Product, G as ProductEntitlement, H as ProductPrice, S as Subscription, J as SubscriptionDetail, K as SubscriptionItem, L as UpdatePriceInput, N as UsageAlertKind, O as UsageAlertMetric, Q as UsageModel, V as UsageTier } from './billing-Bs10EcjR.js';
9
- import { a as CreditThresholdLevel, e as CreditGrant, f as CreditTopUp, g as CreditIncludedWindow, h as CreateCreditGrantInput, i as CreditGrantRequestResult, j as CreditAccount, k as CreditPacks, l as CreateCreditPackInput, m as CreditPack, U as UpdateCreditPackInput, n as CreateCreditIncludedRuleInput, o as CreditIncludedRule, p as UpdateCreditIncludedRuleInput, q as CreditIncludedWindowListParams, r as CreateCreditTopUpInput, s as CreditTopUpRequestResult, t as CreditTopUpListParams, u as CreditBalance, v as CreditLedgerEntry, w as CreditUsageParams, x as CreditUsage } from './hosted-domains-BrnwkHqq.js';
10
- export { y as CreditAccountStatus, z as CreditAllocationInterval, C as CreditGrantKind, A as CreditMoney, B as CreditPackBreakdown, D as CreditPackListItem, E as CreditTopUpStatus, F as CreditTransactionType, G as CreditUsageGroupBy, I as CreditWindowState, H as HostedDomainActivatedData, d as HostedDomainDisabledData, b as HostedDomainDnsFailingData, J as HostedDomainEventBase, c as HostedDomainReassignmentPendingData, K as HostedDomainStatus, L as HostedDomainStatusReason, M as IncludedCredits, N as IncludedPeriod } from './hosted-domains-BrnwkHqq.js';
7
+ import { c as TaxBehavior, d as Customer, U as UnappliedPaymentReason, e as CreateChargeInput, R as RequestOptions, f as Charge, g as CreateMerchantInitiatedChargeInput, I as IdempotentRequestOptions, h as CallOptions, C as CreateProductInput, i as UpdateProductInput, j as MigrationResult, k as CreateSubscriptionInput, B as BillowOptions, a as CreateCouponInput, l as Coupon, F as FeatureKind, M as MeterConfig, m as Feature, n as UpdateFeatureInput, o as UsageAlert, p as CreateUsageAlertInput, b as CheckResult, T as TrackResult, E as EntitlementView, A as AttachResult } from './billing-BEbVLGe9.js';
8
+ export { q as ActivatedSubscriptionResult, r as BillingInterval, s as CouponDuration, t as CouponKind, u as CreateSubscriptionResult, v as EntitlementInput, w as MeterAggregation, x as MeterFilter, y as MeterRoundingMode, z as PendingSubscriptionCheckoutResult, D as PriceInput, P as Product, G as ProductEntitlement, H as ProductPrice, S as Subscription, J as SubscriptionDetail, K as SubscriptionItem, L as UpdatePriceInput, N as UsageAlertKind, O as UsageAlertMetric, Q as UsageModel, V as UsageTier } from './billing-BEbVLGe9.js';
9
+ import { a as CreditThresholdLevel, e as CreditGrant, f as CreditTopUp, g as CreditIncludedWindow, h as CreateCreditGrantInput, i as CreditGrantRequestResult, j as CreditAccount, k as CreditPacks, l as CreateCreditPackInput, m as CreditPack, U as UpdateCreditPackInput, n as CreateCreditIncludedRuleInput, o as CreditIncludedRule, p as UpdateCreditIncludedRuleInput, q as CreditIncludedWindowListParams, r as CreateCreditTopUpInput, s as CreditTopUpRequestResult, t as CreditTopUpListParams, u as CreditBalance, v as CreditLedgerEntry, w as CreditUsageParams, x as CreditUsage } from './hosted-domains-DMgokjiv.js';
10
+ export { y as CreditAccountStatus, z as CreditAllocationInterval, C as CreditGrantKind, A as CreditMoney, B as CreditPackBreakdown, D as CreditPackListItem, E as CreditTopUpStatus, F as CreditTransactionType, G as CreditUsageGroupBy, I as CreditWindowState, H as HostedDomainActivatedData, d as HostedDomainDisabledData, b as HostedDomainDnsFailingData, J as HostedDomainEventBase, c as HostedDomainReassignmentPendingData, K as HostedDomainStatus, L as HostedDomainStatusReason, M as IncludedCredits, N as IncludedPeriod } from './hosted-domains-DMgokjiv.js';
11
11
  import 'zod';
12
12
 
13
13
  /**
@@ -19,7 +19,7 @@ import 'zod';
19
19
  * differently). The `code` field stays widened to `string` for forward-compatibility, so a code a
20
20
  * newer server adds never breaks type-checking against an older SDK.
21
21
  */
22
- declare const BILLOW_ERROR_CODES: readonly ["not_found", "validation_error", "authentication_error", "api_key_expired", "permission_denied", "conflict", "invalid_state_transition", "provider_error", "rate_limited", "quota_exceeded", "internal_error", "insufficient_credits", "account_frozen", "account_closed", "idempotency_conflict", "commit_exceeds_hold", "reversal_exceeds_consumption"];
22
+ declare const BILLOW_ERROR_CODES: readonly ["not_found", "validation_error", "authentication_error", "api_key_expired", "permission_denied", "conflict", "invalid_state_transition", "provider_error", "rate_limited", "quota_exceeded", "internal_error", "insufficient_credits", "account_frozen", "account_closed", "idempotency_conflict", "commit_exceeds_hold", "reversal_exceeds_consumption", "hosted_domain_unavailable"];
23
23
  type BillowErrorCode = (typeof BILLOW_ERROR_CODES)[number];
24
24
 
25
25
  /** Public SDK types for this domain. Re-exported by ../types.ts. */
@@ -329,7 +329,7 @@ interface OutboxEventListItem {
329
329
  interface OutboxEventListParams extends ListParams {
330
330
  status?: OutboxEventStatus;
331
331
  }
332
- type InboundWebhookOutcome = "signature_failed" | "shape_rejected" | "replayed" | "matched" | "unmatched" | "dispute_matched" | "dispute_unknown" | "dispute_deferred" | "accepted";
332
+ type InboundWebhookOutcome = "signature_failed" | "shape_rejected" | "replayed" | "matched" | "unmatched" | "dispute_matched" | "dispute_unknown" | "dispute_deferred" | "card_deferred" | "accepted";
333
333
  interface InboundWebhookListItem {
334
334
  id: string;
335
335
  provider: string;
@@ -349,6 +349,8 @@ interface InboundWebhookListParams extends ListParams {
349
349
  interface CustomerUsage {
350
350
  /** The metered feature's slug. */
351
351
  feature: string;
352
+ /** The metered feature's display name, as you named it (`API calls` for `api_calls`). */
353
+ featureName: string;
352
354
  /** Granted units this period; null = unlimited. */
353
355
  allowance: number | null;
354
356
  /** Gross units used this period (sum of positive events in the period). */
@@ -443,6 +445,15 @@ interface ScheduledSubscriptionChange {
443
445
  productSlug: string;
444
446
  productName: string;
445
447
  effectiveAt: string | null;
448
+ /**
449
+ * Set while the change cannot land at renewal - the customer has since subscribed to its
450
+ * product, or to one billing its usage: why, and since when. The subscription renews on its
451
+ * current plan meanwhile; each renewal tries the change again until it lands or is cleared.
452
+ */
453
+ blocked: {
454
+ reason: string;
455
+ since: string;
456
+ } | null;
446
457
  }
447
458
  interface SubscriptionListParams extends ListParams {
448
459
  status?: SubscriptionStatus;
@@ -729,13 +740,18 @@ interface CreditRateCardItem {
729
740
  /** How many units `unitPrice` buys. */
730
741
  perUnits: string;
731
742
  }
732
- /** An immutable Rate Card version: a price change is a new version. */
743
+ /**
744
+ * An immutable Rate Card version: a price change is a new version. One scheduled for the future
745
+ * may be retracted until it takes effect.
746
+ */
733
747
  interface CreditRateCard {
734
748
  id: string;
735
749
  /** 1, 2, 3... in the order versions were published (and take effect). */
736
750
  version: number;
737
- /** From when it prices new quotes and reservations made from items. */
751
+ /** From when it prices new quotes and reservations made from items, unless retracted before. */
738
752
  effectiveAt: string;
753
+ /** When it was retracted, before `effectiveAt`; null unless retracted. It never takes effect. */
754
+ retractedAt: string | null;
739
755
  /** Its prices, by action. */
740
756
  items: CreditRateCardItem[];
741
757
  createdAt: string;
@@ -744,7 +760,7 @@ interface CreditRateCard {
744
760
  interface PublishCreditRateCardInput {
745
761
  /**
746
762
  * When it takes effect (ISO 8601 with a timezone): now when omitted; never in the past, nor
747
- * before the version before it takes effect.
763
+ * before the last version before it not retracted takes effect.
748
764
  */
749
765
  effectiveAt?: string;
750
766
  items: Array<{
@@ -933,6 +949,20 @@ interface CreatePortalSessionInput {
933
949
  * `localhost` is also accepted over `http`, on any port, in either environment.
934
950
  */
935
951
  returnUrl?: string;
952
+ /**
953
+ * The host to open the session on. Omitted: the Project's primary custom domain when it can take
954
+ * sessions right now, otherwise the shared portal host - so a merchant's DNS trouble never stops
955
+ * billing from opening. A hostname: that custom domain of the Project, or a 422
956
+ * `hosted_domain_unavailable` when it cannot take sessions. `null`: the shared portal host.
957
+ * Sandbox sessions always use the shared portal host.
958
+ */
959
+ domain?: string | null;
960
+ /**
961
+ * Mint for Billow's hosted portal only: the URL's token opens the portal link once and is good
962
+ * for nothing else - never a bearer for your own surface's `/portal` calls. Sessions on a custom
963
+ * domain always behave this way.
964
+ */
965
+ hostedOnly?: boolean;
936
966
  }
937
967
  /**
938
968
  * The minted portal session: redirect the Customer to `url` at once. Its token is a single-use
@@ -996,17 +1026,30 @@ interface PortalView {
996
1026
  };
997
1027
  flow: PortalSessionFlow;
998
1028
  returnUrl: string | null;
999
- subscriptions: SubscriptionListItem[];
1029
+ subscriptions: PortalSubscription[];
1000
1030
  usage: CustomerUsage[];
1001
1031
  paymentMethods: SavedPaymentMethod[];
1002
1032
  }
1033
+ /**
1034
+ * A scheduled plan change as the Customer sees it: `blocked` says only that it is on hold and
1035
+ * since when - the reason is for the Operator (`ScheduledSubscriptionChange.blocked`).
1036
+ */
1037
+ type PortalScheduledChange = Omit<ScheduledSubscriptionChange, "blocked"> & {
1038
+ blocked: {
1039
+ since: string;
1040
+ } | null;
1041
+ };
1042
+ /** A subscription as the portal lists it. */
1043
+ type PortalSubscription = Omit<SubscriptionListItem, "scheduledChange"> & {
1044
+ scheduledChange: PortalScheduledChange | null;
1045
+ };
1003
1046
  /** The subscription's state after a portal cancel (scheduled at period end). */
1004
1047
  interface PortalSubscriptionStatus {
1005
1048
  id: string;
1006
1049
  status: string;
1007
1050
  cancelAtPeriodEnd: boolean;
1008
1051
  currentPeriodEnd: string | null;
1009
- scheduledChange: ScheduledSubscriptionChange | null;
1052
+ scheduledChange: PortalScheduledChange | null;
1010
1053
  }
1011
1054
  /** The outcome of a portal-driven plan change (PRD-15). */
1012
1055
  interface PortalPlanChange {
@@ -1156,6 +1199,18 @@ interface CustomerDataExport {
1156
1199
  createdAt: string;
1157
1200
  updatedAt: string;
1158
1201
  }>;
1202
+ /** Credit notes voided on those refunds (the provider reversed the refund), as issued. */
1203
+ voidedCreditNotes: Array<{
1204
+ id: string;
1205
+ refundId: string;
1206
+ number: string;
1207
+ amount: number;
1208
+ subtotal: number;
1209
+ tax: number;
1210
+ currency: string;
1211
+ issuedAt: string;
1212
+ voidedAt: string;
1213
+ }>;
1159
1214
  usageEvents: Array<{
1160
1215
  id: string;
1161
1216
  featureId: string;
@@ -1237,6 +1292,15 @@ interface CustomerAnonymizationResult {
1237
1292
  * - `conflict_on_charge`: another refund of the charge has an unresolved provider conflict.
1238
1293
  */
1239
1294
  type RefundReviewReason = "unconfirmed" | "unconfirmable_without_provider_id" | "provider_conflict" | "conflict_on_charge";
1295
+ /** A credit note voided on a refund, exactly as it was issued (see `Refund.voidedCreditNotes`). */
1296
+ interface VoidedCreditNote {
1297
+ number: string;
1298
+ amount: number;
1299
+ subtotal: number;
1300
+ tax: number;
1301
+ issuedAt: string;
1302
+ voidedAt: string;
1303
+ }
1240
1304
  interface Refund {
1241
1305
  id: string;
1242
1306
  chargeId: string;
@@ -1257,12 +1321,20 @@ interface Refund {
1257
1321
  /** Why it needs (or needed) review - see `RefundReviewReason`. */
1258
1322
  reviewReason: RefundReviewReason | null;
1259
1323
  providerRefundId: string | null;
1324
+ /** The refund's credit note in force (null when it has none, e.g. once it was voided). */
1260
1325
  creditNoteNumber: string | null;
1326
+ /**
1327
+ * Credit notes issued for this refund and voided since: the provider reversed the refund after it
1328
+ * succeeded (the customer's bank returned the money) and it was resolved as not refunded. Each is
1329
+ * kept exactly as issued; download one with `charges.voidedCreditNote`, badged VOID.
1330
+ */
1331
+ voidedCreditNotes: VoidedCreditNote[];
1261
1332
  /**
1262
1333
  * Set while the provider's own answer, which arrived after the refund was already settled the
1263
- * other way (e.g. `succeeded` for a refund resolved as not refunded), is unresolved: the money
1264
- * moved differently from what `status` says. The charge is held (no new refunds) until it is
1265
- * resolved as refunded with `charges.resolveRefund`, which clears it.
1334
+ * other way (e.g. `succeeded` for a refund resolved as not refunded, or `failed` for a refund
1335
+ * the provider reversed after it succeeded), is unresolved: the money moved differently from
1336
+ * what `status` says. The charge is held (no new refunds) until it is resolved with
1337
+ * `charges.resolveRefund`, which clears it.
1266
1338
  */
1267
1339
  providerConflictStatus: RefundStatus | null;
1268
1340
  /** When that contrary answer arrived (kept after the conflict is resolved). */
@@ -1418,6 +1490,11 @@ declare function createChargesResource(ctx: RequestContext): {
1418
1490
  receipt: (id: string, options?: CallOptions) => Promise<ArrayBuffer>;
1419
1491
  /** Download the immutable credit note for a succeeded refund. */
1420
1492
  creditNote: (chargeId: string, refundId: string, options?: CallOptions) => Promise<ArrayBuffer>;
1493
+ /**
1494
+ * Download a credit note voided on a refund (one of its `voidedCreditNotes`), exactly as it was
1495
+ * issued and badged VOID.
1496
+ */
1497
+ voidedCreditNote: (chargeId: string, refundId: string, creditNoteNumber: string, options?: CallOptions) => Promise<ArrayBuffer>;
1421
1498
  /**
1422
1499
  * Refund a succeeded charge: `{ amount }` (minor units) for a partial, `{}` for its whole
1423
1500
  * remaining balance. The `idempotencyKey` is required and must identify this one refund
@@ -1442,7 +1519,10 @@ declare function createChargesResource(ctx: RequestContext): {
1442
1519
  /**
1443
1520
  * Record the outcome you verified in the provider dashboard for a refund awaiting review
1444
1521
  * (`needsReview`): `succeeded` settles it with a credit note, `failed` releases its amount.
1445
- * A refund with a provider conflict (`providerConflictStatus`) resolves only as `succeeded`.
1522
+ * A refund with a provider conflict (`providerConflictStatus`) recorded `failed` resolves only
1523
+ * as `succeeded`; one recorded `succeeded` that the provider later reported failed (a reversal:
1524
+ * the customer's bank returned the money) resolves either way, `failed` making its amount
1525
+ * refundable again.
1446
1526
  */
1447
1527
  resolveRefund: (chargeId: string, refundId: string, input: ResolveRefundInput, options?: CallOptions) => Promise<Refund>;
1448
1528
  };
@@ -1588,13 +1668,22 @@ declare function createCreditsResource(ctx: RequestContext): {
1588
1668
  /**
1589
1669
  * Publish a new Rate Card version: what each Credit Action costs, as
1590
1670
  * `ceil(units * unitPrice / perUnits)` microcredits a line. Versions are immutable - a price
1591
- * change is a new version - and take effect in order, at `effectiveAt` (now when omitted).
1671
+ * change is a new version - and take effect in order, at `effectiveAt` (now when omitted),
1672
+ * unless retracted before then.
1592
1673
  */
1593
1674
  publish: (input: PublishCreditRateCardInput, options?: CallOptions) => Promise<CreditRateCard>;
1594
1675
  /** The version in effect now (`not_found` before the first takes effect). */
1595
1676
  current: (options?: CallOptions) => Promise<CreditRateCard>;
1596
1677
  /** One version, by its number. */
1597
1678
  get: (version: number, options?: CallOptions) => Promise<CreditRateCard>;
1679
+ /**
1680
+ * Retract a version before it takes effect: it never does (`retractedAt` is set), and
1681
+ * versions published after it take effect in order after the last one not retracted - so a
1682
+ * scheduled price change no longer holds back an earlier correction. Safe to retry: a
1683
+ * retracted version answers as retracted. A version already in effect, current or
1684
+ * superseded, throws `conflict` (409, `details.reason: "already_effective"`).
1685
+ */
1686
+ retract: (version: number, options?: CallOptions) => Promise<CreditRateCard>;
1598
1687
  /**
1599
1688
  * The published versions, newest first. Auto-paginating by cursor: `await` the first page,
1600
1689
  * `for await (…)` every version, or `.listAll()` to collect them.
@@ -2321,6 +2410,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2321
2410
  productSlug: string;
2322
2411
  productName: string;
2323
2412
  effectiveAt: string | null;
2413
+ blocked: {
2414
+ reason: string;
2415
+ since: string;
2416
+ } | null;
2324
2417
  } | null;
2325
2418
  canceledAt: string | null;
2326
2419
  remainingCycles: number | null;
@@ -2371,6 +2464,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2371
2464
  productSlug: string;
2372
2465
  productName: string;
2373
2466
  effectiveAt: string | null;
2467
+ blocked: {
2468
+ reason: string;
2469
+ since: string;
2470
+ } | null;
2374
2471
  } | null;
2375
2472
  canceledAt: string | null;
2376
2473
  remainingCycles: number | null;
@@ -2399,6 +2496,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2399
2496
  productSlug: string;
2400
2497
  productName: string;
2401
2498
  effectiveAt: string | null;
2499
+ blocked: {
2500
+ reason: string;
2501
+ since: string;
2502
+ } | null;
2402
2503
  } | null;
2403
2504
  canceledAt: string | null;
2404
2505
  remainingCycles: number | null;
@@ -2433,6 +2534,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2433
2534
  productSlug: string;
2434
2535
  productName: string;
2435
2536
  effectiveAt: string | null;
2537
+ blocked: {
2538
+ reason: string;
2539
+ since: string;
2540
+ } | null;
2436
2541
  } | null;
2437
2542
  canceledAt: string | null;
2438
2543
  remainingCycles: number | null;
@@ -2462,6 +2567,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2462
2567
  productSlug: string;
2463
2568
  productName: string;
2464
2569
  effectiveAt: string | null;
2570
+ blocked: {
2571
+ reason: string;
2572
+ since: string;
2573
+ } | null;
2465
2574
  } | null;
2466
2575
  canceledAt: string | null;
2467
2576
  remainingCycles: number | null;
@@ -2485,6 +2594,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2485
2594
  productSlug: string;
2486
2595
  productName: string;
2487
2596
  effectiveAt: string | null;
2597
+ blocked: {
2598
+ reason: string;
2599
+ since: string;
2600
+ } | null;
2488
2601
  } | null;
2489
2602
  canceledAt: string | null;
2490
2603
  remainingCycles: number | null;
@@ -2511,6 +2624,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2511
2624
  productSlug: string;
2512
2625
  productName: string;
2513
2626
  effectiveAt: string | null;
2627
+ blocked: {
2628
+ reason: string;
2629
+ since: string;
2630
+ } | null;
2514
2631
  } | null;
2515
2632
  canceledAt: string | null;
2516
2633
  remainingCycles: number | null;
@@ -2540,6 +2657,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2540
2657
  productSlug: string;
2541
2658
  productName: string;
2542
2659
  effectiveAt: string | null;
2660
+ blocked: {
2661
+ reason: string;
2662
+ since: string;
2663
+ } | null;
2543
2664
  } | null;
2544
2665
  canceledAt: string | null;
2545
2666
  remainingCycles: number | null;
@@ -2569,6 +2690,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2569
2690
  productSlug: string;
2570
2691
  productName: string;
2571
2692
  effectiveAt: string | null;
2693
+ blocked: {
2694
+ reason: string;
2695
+ since: string;
2696
+ } | null;
2572
2697
  } | null;
2573
2698
  canceledAt: string | null;
2574
2699
  remainingCycles: number | null;
@@ -2596,6 +2721,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2596
2721
  productSlug: string;
2597
2722
  productName: string;
2598
2723
  effectiveAt: string | null;
2724
+ blocked: {
2725
+ reason: string;
2726
+ since: string;
2727
+ } | null;
2599
2728
  } | null;
2600
2729
  canceledAt: string | null;
2601
2730
  remainingCycles: number | null;
@@ -3024,4 +3153,4 @@ declare class BillowPortal {
3024
3153
  };
3025
3154
  }
3026
3155
 
3027
- export { AttachResult, BILLOW_ERROR_CODES, Billow, BillowApiError, type BillowErrorCode, BillowOptions, BillowPortal, BillowPublishable, type BusinessProfile, CallOptions, type CatalogItem, Charge, type ChargeListItem, type ChargeListParams, type ChargeSearchHit, ChargeStatus, CheckResult, type CheckoutMethodInfo, type ConfigField, type ConfigFieldOption, type ConfigFieldType, Coupon, CreateChargeInput, CreateCouponInput, CreateCreditGrantInput, CreateCreditIncludedRuleInput, CreateCreditPackInput, type CreateCreditQuoteInput, type CreateCreditReservationInput, CreateCreditTopUpInput, CreateHostedDomainInput, CreateMerchantInitiatedChargeInput, type CreatePortalSessionInput, CreateProductInput, CreateSubscriptionInput, CreateUsageAlertInput, type CreateWebhookEndpointInput, type CredentialSet, CreditAccount, CreditBalance, type CreditDimensions, CreditGrant, CreditGrantRequestResult, CreditIncludedRule, CreditIncludedWindow, CreditIncludedWindowListParams, CreditLedgerEntry, type CreditLineItem, CreditPack, CreditPacks, type CreditPricedLine, type CreditQuote, type CreditRateCard, type CreditRateCardItem, type CreditReservation, type CreditReservationListParams, type CreditReservationPage, type CreditReservationRequestResult, type CreditReservationStatus, type CreditReversal, type CreditReversalRequestResult, CreditThresholdLevel, CreditTopUp, CreditTopUpListParams, CreditTopUpRequestResult, CreditUsage, CreditUsageParams, type CursorListParams, type CursorListPromise, type CursorPaginated, Customer, type CustomerAnonymizationResult, type CustomerCreditsExport, type CustomerDataExport, type CustomerListItem, type CustomerListParams, type CustomerOverview, type CustomerSearchHit, type CustomerUsage, type CustomerUsageDetail, type EmailDeliveryListItem, type EmailDeliveryListParams, type EmailDeliveryStatus, type EmailTemplateSetting, EntitlementView, type ExchangeRate, type ExportJsonValue, type ExternalPaymentMethod, type ExternalPaymentResult, Feature, FeatureKind, IdempotentRequestOptions, type InboundWebhookListItem, type InboundWebhookListParams, type InboundWebhookOutcome, type IntegrationDefinition, type IntegrationKind, type IntegrationTier, type Invoice, type InvoiceDetail, type InvoiceLineItem, type InvoiceListItem, type InvoiceListParams, type InvoiceSearchHit, InvoiceStatus, type ListParams, type ListPromise, MeterConfig, type MetricsOverview, type MetricsParams, type MetricsRollup, MigrationResult, type OutboxEventListItem, type OutboxEventListParams, type OutboxEventStatus, type Paginated, PayInvoiceInput, type PaymentMethod, PaymentMethodStatus, type PaymentProviderDefinition, type PortalCardSetupResult, type PortalCheckout, type PortalPlanChange, type PortalSession, type PortalSessionExchange, type PortalSessionExchangeInput, type PortalSessionFlow, type PortalSessionInfo, type PortalSubscriptionStatus, type PortalView, type ProviderCredentialSummary, type ProviderVerifyResult, type ProviderVerifyTarget, type ProviderVerifyTargetResult, type PublishCreditRateCardInput, type RecordExternalPaymentInput, type Refund, type RefundChargeInput, type RefundRequestResult, type RefundReviewReason, RefundStatus, RequestOptions, type ResolveRefundInput, type ReverseCreditConsumptionInput, SavedPaymentMethod, type ScheduledSubscriptionChange, type SearchResults, type SubscriptionListItem, type SubscriptionListParams, type SubscriptionSearchHit, SubscriptionStatus, TaxBehavior, type TimeseriesInterval, type TimeseriesMetric, type TimeseriesParams, type TimeseriesPoint, type TimeseriesResult, TrackResult, UnappliedPaymentReason, type UpdateBusinessProfileInput, UpdateCreditIncludedRuleInput, UpdateCreditPackInput, type UpdateEmailTemplateInput, UpdateFeatureInput, UpdateProductInput, type UpdateWebhookEndpointInput, type UpsertCredentialsInput, UsageAlert, type WebhookDelivery, WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEndpointWithSecret, type Whoami, currencyExponent, formatMoney, isSecretField, toMajorUnits, toMinorUnits };
3156
+ export { AttachResult, BILLOW_ERROR_CODES, Billow, BillowApiError, type BillowErrorCode, BillowOptions, BillowPortal, BillowPublishable, type BusinessProfile, CallOptions, type CatalogItem, Charge, type ChargeListItem, type ChargeListParams, type ChargeSearchHit, ChargeStatus, CheckResult, type CheckoutMethodInfo, type ConfigField, type ConfigFieldOption, type ConfigFieldType, Coupon, CreateChargeInput, CreateCouponInput, CreateCreditGrantInput, CreateCreditIncludedRuleInput, CreateCreditPackInput, type CreateCreditQuoteInput, type CreateCreditReservationInput, CreateCreditTopUpInput, CreateHostedDomainInput, CreateMerchantInitiatedChargeInput, type CreatePortalSessionInput, CreateProductInput, CreateSubscriptionInput, CreateUsageAlertInput, type CreateWebhookEndpointInput, type CredentialSet, CreditAccount, CreditBalance, type CreditDimensions, CreditGrant, CreditGrantRequestResult, CreditIncludedRule, CreditIncludedWindow, CreditIncludedWindowListParams, CreditLedgerEntry, type CreditLineItem, CreditPack, CreditPacks, type CreditPricedLine, type CreditQuote, type CreditRateCard, type CreditRateCardItem, type CreditReservation, type CreditReservationListParams, type CreditReservationPage, type CreditReservationRequestResult, type CreditReservationStatus, type CreditReversal, type CreditReversalRequestResult, CreditThresholdLevel, CreditTopUp, CreditTopUpListParams, CreditTopUpRequestResult, CreditUsage, CreditUsageParams, type CursorListParams, type CursorListPromise, type CursorPaginated, Customer, type CustomerAnonymizationResult, type CustomerCreditsExport, type CustomerDataExport, type CustomerListItem, type CustomerListParams, type CustomerOverview, type CustomerSearchHit, type CustomerUsage, type CustomerUsageDetail, type EmailDeliveryListItem, type EmailDeliveryListParams, type EmailDeliveryStatus, type EmailTemplateSetting, EntitlementView, type ExchangeRate, type ExportJsonValue, type ExternalPaymentMethod, type ExternalPaymentResult, Feature, FeatureKind, IdempotentRequestOptions, type InboundWebhookListItem, type InboundWebhookListParams, type InboundWebhookOutcome, type IntegrationDefinition, type IntegrationKind, type IntegrationTier, type Invoice, type InvoiceDetail, type InvoiceLineItem, type InvoiceListItem, type InvoiceListParams, type InvoiceSearchHit, InvoiceStatus, type ListParams, type ListPromise, MeterConfig, type MetricsOverview, type MetricsParams, type MetricsRollup, MigrationResult, type OutboxEventListItem, type OutboxEventListParams, type OutboxEventStatus, type Paginated, PayInvoiceInput, type PaymentMethod, PaymentMethodStatus, type PaymentProviderDefinition, type PortalCardSetupResult, type PortalCheckout, type PortalPlanChange, type PortalScheduledChange, type PortalSession, type PortalSessionExchange, type PortalSessionExchangeInput, type PortalSessionFlow, type PortalSessionInfo, type PortalSubscription, type PortalSubscriptionStatus, type PortalView, type ProviderCredentialSummary, type ProviderVerifyResult, type ProviderVerifyTarget, type ProviderVerifyTargetResult, type PublishCreditRateCardInput, type RecordExternalPaymentInput, type Refund, type RefundChargeInput, type RefundRequestResult, type RefundReviewReason, RefundStatus, RequestOptions, type ResolveRefundInput, type ReverseCreditConsumptionInput, SavedPaymentMethod, type ScheduledSubscriptionChange, type SearchResults, type SubscriptionListItem, type SubscriptionListParams, type SubscriptionSearchHit, SubscriptionStatus, TaxBehavior, type TimeseriesInterval, type TimeseriesMetric, type TimeseriesParams, type TimeseriesPoint, type TimeseriesResult, TrackResult, UnappliedPaymentReason, type UpdateBusinessProfileInput, UpdateCreditIncludedRuleInput, UpdateCreditPackInput, type UpdateEmailTemplateInput, UpdateFeatureInput, UpdateProductInput, type UpdateWebhookEndpointInput, type UpsertCredentialsInput, UsageAlert, type VoidedCreditNote, type WebhookDelivery, WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEndpointWithSecret, type Whoami, currencyExponent, formatMoney, isSecretField, toMajorUnits, toMinorUnits };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { BILLOW_ERROR_CODES, Billow, BillowApiError, BillowPortal, BillowPublishable, currencyExponent, formatMoney, isSecretField, toMajorUnits, toMinorUnits } from './chunk-XUFQG6EA.js';
1
+ export { BILLOW_ERROR_CODES, Billow, BillowApiError, BillowPortal, BillowPublishable, currencyExponent, formatMoney, isSecretField, toMajorUnits, toMinorUnits } from './chunk-H6C7CONO.js';
2
2
  export { ACTIVE_SUBSCRIPTION_STATUSES, CHARGE_STATUSES, INVOICE_STATUSES, NEVER_ACTIVATED_SUBSCRIPTION_STATUSES, PAYMENT_METHOD_STATUSES, REFUND_STATUSES, SUBSCRIPTION_STATUSES, TERMINAL_SUBSCRIPTION_STATUSES, WEBHOOK_DELIVERY_STATUSES, grantsAccess, isTerminal } from './chunk-47J7FYM5.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
@@ -1,10 +1,10 @@
1
1
  import { Billow } from './index.cjs';
2
- import './index.d-DSEYhV2c.cjs';
2
+ import './index.d-D5v2ETKF.cjs';
3
3
  import 'zod';
4
4
  import './billing-status-DZkB0VPK.cjs';
5
5
  import './status.cjs';
6
- import './billing-8ug1Gw05.cjs';
7
- import './hosted-domains-zWm2srOk.cjs';
6
+ import './billing-CDEO8Jqv.cjs';
7
+ import './hosted-domains-Cuk3j04R.cjs';
8
8
 
9
9
  /**
10
10
  * Auto-metering (PRD-16): ingestion strategies that call billow's `track()` for you,
@@ -1,10 +1,10 @@
1
1
  import { Billow } from './index.js';
2
- import './index.d-DSEYhV2c.js';
2
+ import './index.d-D5v2ETKF.js';
3
3
  import 'zod';
4
4
  import './billing-status-DZkB0VPK.js';
5
5
  import './status.js';
6
- import './billing-Bs10EcjR.js';
7
- import './hosted-domains-BrnwkHqq.js';
6
+ import './billing-BEbVLGe9.js';
7
+ import './hosted-domains-DMgokjiv.js';
8
8
 
9
9
  /**
10
10
  * Auto-metering (PRD-16): ingestion strategies that call billow's `track()` for you,
package/dist/react.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { A as AttachResult, b as CheckResult, E as EntitlementView, P as Product, T as TrackResult } from './billing-8ug1Gw05.cjs';
4
- import './index.d-DSEYhV2c.cjs';
3
+ import { A as AttachResult, b as CheckResult, E as EntitlementView, P as Product, T as TrackResult } from './billing-CDEO8Jqv.cjs';
4
+ import './index.d-D5v2ETKF.cjs';
5
5
  import 'zod';
6
6
  import './billing-status-DZkB0VPK.cjs';
7
7
 
package/dist/react.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { A as AttachResult, b as CheckResult, E as EntitlementView, P as Product, T as TrackResult } from './billing-Bs10EcjR.js';
4
- import './index.d-DSEYhV2c.js';
3
+ import { A as AttachResult, b as CheckResult, E as EntitlementView, P as Product, T as TrackResult } from './billing-BEbVLGe9.js';
4
+ import './index.d-D5v2ETKF.js';
5
5
  import 'zod';
6
6
  import './billing-status-DZkB0VPK.js';
7
7
 
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { BillowPublishable } from './chunk-XUFQG6EA.js';
2
+ import { BillowPublishable } from './chunk-H6C7CONO.js';
3
3
  import './chunk-47J7FYM5.js';
4
4
  import { createContext, useCallback, useState, useEffect, useMemo, useContext } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
package/dist/server.d.cts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { Billow } from './index.cjs';
2
- import './index.d-DSEYhV2c.cjs';
2
+ import './index.d-D5v2ETKF.cjs';
3
3
  import 'zod';
4
4
  import './billing-status-DZkB0VPK.cjs';
5
5
  import './status.cjs';
6
- import './billing-8ug1Gw05.cjs';
7
- import './hosted-domains-zWm2srOk.cjs';
6
+ import './billing-CDEO8Jqv.cjs';
7
+ import './hosted-domains-Cuk3j04R.cjs';
8
8
 
9
9
  /**
10
10
  * Backend handler for the browser-facing surface (the React hooks talk to this,
package/dist/server.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { Billow } from './index.js';
2
- import './index.d-DSEYhV2c.js';
2
+ import './index.d-D5v2ETKF.js';
3
3
  import 'zod';
4
4
  import './billing-status-DZkB0VPK.js';
5
5
  import './status.js';
6
- import './billing-Bs10EcjR.js';
7
- import './hosted-domains-BrnwkHqq.js';
6
+ import './billing-BEbVLGe9.js';
7
+ import './hosted-domains-DMgokjiv.js';
8
8
 
9
9
  /**
10
10
  * Backend handler for the browser-facing surface (the React hooks talk to this,
package/dist/webhooks.cjs CHANGED
@@ -5,6 +5,7 @@ var WEBHOOK_EVENT_TYPES = [
5
5
  "charge.succeeded",
6
6
  "charge.failed",
7
7
  "charge.refunded",
8
+ "charge.refund_reversed",
8
9
  "charge.disputed",
9
10
  "charge.dispute_resolved",
10
11
  "invoice.paid",