@usebillow/sdk 0.7.0 → 0.9.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.cts CHANGED
@@ -1,13 +1,13 @@
1
- import { f as SavedPaymentMethod, g as CreateHostedDomainInput, h as PayInvoiceInput } from './index.d-CKQAhQfJ.cjs';
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-CKQAhQfJ.cjs';
1
+ import { f as SavedPaymentMethod, g as CreateHostedDomainInput, h as PayInvoiceInput } from './index.d-DSEYhV2c.cjs';
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.cjs';
3
3
  import { C as ChargeStatus, P as PaymentMethodStatus, I as InvoiceStatus, R as RefundStatus, W as WebhookDeliveryStatus } from './billing-status-BZQN_gm7.cjs';
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-BZQN_gm7.cjs';
5
5
  import { SubscriptionStatus } from './status.cjs';
6
6
  export { ACTIVE_SUBSCRIPTION_STATUSES, NEVER_ACTIVATED_SUBSCRIPTION_STATUSES, SUBSCRIPTION_STATUSES, TERMINAL_SUBSCRIPTION_STATUSES, grantsAccess, isTerminal } from './status.cjs';
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-B-VyZCXV.cjs';
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-B-VyZCXV.cjs';
9
- import { a as CreditThresholdLevel, e as CreditGrant, f as CreditTopUp, g as CreateCreditGrantInput, h as CreditGrantRequestResult, i as CreditPacks, j as CreateCreditPackInput, k as CreditPack, U as UpdateCreditPackInput, l as CreateCreditTopUpInput, m as CreditTopUpRequestResult, n as CreditTopUpListParams, o as CreditBalance, p as CreditLedgerEntry, q as CreditUsageParams, r as CreditUsage } from './hosted-domains-BYYl2DSa.cjs';
10
- export { s as CreditAccountStatus, C as CreditGrantKind, t as CreditMoney, u as CreditPackBreakdown, v as CreditPackListItem, w as CreditTopUpStatus, x as CreditTransactionType, y as CreditUsageGroupBy, H as HostedDomainActivatedData, d as HostedDomainDisabledData, b as HostedDomainDnsFailingData, z as HostedDomainEventBase, c as HostedDomainReassignmentPendingData, A as HostedDomainStatus, B as HostedDomainStatusReason } from './hosted-domains-BYYl2DSa.cjs';
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-B16zL5xU.cjs';
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-B16zL5xU.cjs';
9
+ import { a as CreditThresholdLevel, e as CreditGrant, f as CreditTopUp, g as CreditIncludedWindow, h as CreateCreditGrantInput, i as CreditGrantRequestResult, j as CreditPacks, k as CreateCreditPackInput, l as CreditPack, U as UpdateCreditPackInput, m as CreateCreditIncludedRuleInput, n as CreditIncludedRule, o as UpdateCreditIncludedRuleInput, p as CreditIncludedWindowListParams, q as CreateCreditTopUpInput, r as CreditTopUpRequestResult, s as CreditTopUpListParams, t as CreditBalance, u as CreditLedgerEntry, v as CreditUsageParams, w as CreditUsage } from './hosted-domains-DwakPG4J.cjs';
10
+ export { x as CreditAccountStatus, y as CreditAllocationInterval, C as CreditGrantKind, z as CreditMoney, A as CreditPackBreakdown, B as CreditPackListItem, D as CreditTopUpStatus, E as CreditTransactionType, F as CreditUsageGroupBy, G as CreditWindowState, H as HostedDomainActivatedData, d as HostedDomainDisabledData, b as HostedDomainDnsFailingData, I as HostedDomainEventBase, c as HostedDomainReassignmentPendingData, J as HostedDomainStatus, K as HostedDomainStatusReason, L as IncludedCredits, M as IncludedPeriod } from './hosted-domains-DwakPG4J.cjs';
11
11
  import 'zod';
12
12
 
13
13
  /**
@@ -261,9 +261,9 @@ interface CursorPaginated<T> {
261
261
  * The return type of a cursor-paginated `.list()`: like {@link ListPromise}, BOTH a Promise for
262
262
  * the first page AND async-iterable across ALL pages (`for await`, or `.listAll()`). The walk
263
263
  * follows `nextCursor` until it is null, so rows arriving at the head meanwhile never make it skip
264
- * or repeat a row.
264
+ * or repeat a row. `Page` is the first page's type, for a list whose pages carry more than rows.
265
265
  */
266
- interface CursorListPromise<T> extends Promise<CursorPaginated<T>>, AsyncIterable<T> {
266
+ interface CursorListPromise<T, Page extends CursorPaginated<T> = CursorPaginated<T>> extends Promise<Page>, AsyncIterable<T> {
267
267
  /** Page through the entire list and collect every item into one array. */
268
268
  listAll(): Promise<T[]>;
269
269
  }
@@ -599,6 +599,7 @@ interface InvoiceListParams extends ListParams {
599
599
  }
600
600
  interface InvoiceDetail {
601
601
  invoice: Invoice;
602
+ /** In the order the invoice lists them (as its PDF and receipt email do). */
602
603
  lineItems: InvoiceLineItem[];
603
604
  }
604
605
  /** How an offline payment was collected (ADR-0026). `other` is the escape hatch. */
@@ -716,6 +717,7 @@ interface Whoami {
716
717
  * Every credit quantity - and every count of units - is a `string` of a whole number, e.g.
717
718
  * `"5000000"` for 5 credits: never a `number`, which would silently round past 2^53.
718
719
  */
720
+
719
721
  /** One Credit Action's price in a Rate Card version: `ceil(units * unitPrice / perUnits)` a line. */
720
722
  interface CreditRateCardItem {
721
723
  /** The Credit Action key, e.g. `send_message`. */
@@ -829,6 +831,29 @@ interface CreditReservation {
829
831
  metadata: Record<string, string> | null;
830
832
  createdAt: string;
831
833
  }
834
+ /** Narrow the project's reservations list. */
835
+ interface CreditReservationListParams {
836
+ /** Page size: 1 to 100 (default 25); the server clamps a larger one. */
837
+ limit?: number;
838
+ /** A `nextCursor` to continue from; omit to start at the oldest reservation. */
839
+ cursor?: string;
840
+ status?: CreditReservationStatus;
841
+ /** Only this customer's reservations (by external id). */
842
+ customer?: string;
843
+ /**
844
+ * Only reservations protected more than this many seconds ago, whatever their status now (with
845
+ * `status: "protected"`, the ones still waiting). A reservation never protected never matches.
846
+ */
847
+ protectedLongerThan?: number;
848
+ }
849
+ /** A page of the project's reservations, oldest first. */
850
+ interface CreditReservationPage extends CursorPaginated<CreditReservation> {
851
+ /**
852
+ * Your project's protected-hold maximum, in seconds (7 days unless configured): a protected hold
853
+ * never expires, so one protected longer than this needs your decision - commit or release it.
854
+ */
855
+ protectedHoldMaxSeconds: number;
856
+ }
832
857
  /** What a reservation holds for and how it is identified; give `quoteId` or `items`. */
833
858
  interface CreateCreditReservationBase {
834
859
  /** The customer's external id. */
@@ -1086,6 +1111,7 @@ interface CustomerDataExport {
1086
1111
  createdAt: string;
1087
1112
  updatedAt: string;
1088
1113
  }>;
1114
+ /** By invoice, each invoice's lines in the order it lists them. */
1089
1115
  invoiceLineItems: Array<{
1090
1116
  id: string;
1091
1117
  invoiceId: string;
@@ -1094,6 +1120,8 @@ interface CustomerDataExport {
1094
1120
  amount: number;
1095
1121
  quantity: number;
1096
1122
  currency: string;
1123
+ /** Where the line sits on its invoice, from 0. */
1124
+ position: number;
1097
1125
  createdAt: string;
1098
1126
  updatedAt: string;
1099
1127
  }>;
@@ -1162,6 +1190,8 @@ interface CustomerCreditsExport {
1162
1190
  reversals: CreditReversal[];
1163
1191
  /** Every quote made for the customer (even with no credit account), with its priced lines. */
1164
1192
  quotes: CreditQuote[];
1193
+ /** Every Included Credit Window of the customer's subscriptions, oldest first. */
1194
+ includedWindows: CreditIncludedWindow[];
1165
1195
  /** Every ledger transaction, in the order it was written, with its postings. */
1166
1196
  ledger: Array<{
1167
1197
  id: string;
@@ -1445,6 +1475,45 @@ declare function createCreditsResource(ctx: RequestContext): {
1445
1475
  /** Edit a pack's terms or Price, or archive it; top-ups already made keep their terms. */
1446
1476
  update: (packId: string, input: UpdateCreditPackInput, options?: CallOptions) => Promise<CreditPack>;
1447
1477
  };
1478
+ includedRules: {
1479
+ /**
1480
+ * Configure an Included Credit Rule on a recurring base Price: the credits a subscription on
1481
+ * it includes for each period Billow grants it - per billing period, or per month of a Price
1482
+ * billed for longer than a month - and for a trial. Configuration, so no idempotency key:
1483
+ * a second live rule for the same Price throws `conflict` (409,
1484
+ * `details.reason: "included_rule_exists"`, with the live rule's `ruleId`). Throws
1485
+ * `validation_error` (422) with `details.reason: "not_a_base_price"` for a Price that is not
1486
+ * a recurring base Price, or `"allocation_not_shorter_than_billing"` for a monthly
1487
+ * allocation on a Price not billed for longer than a month.
1488
+ */
1489
+ create: (input: CreateCreditIncludedRuleInput, options?: CallOptions) => Promise<CreditIncludedRule>;
1490
+ /** A rule, archived or not. */
1491
+ get: (ruleId: string, options?: CallOptions) => Promise<CreditIncludedRule>;
1492
+ /**
1493
+ * Every rule, archived ones included, newest first. Auto-paginating by cursor: `await` the
1494
+ * first page, `for await (…)` every rule, or `.listAll()` to collect them.
1495
+ */
1496
+ list: (params?: CursorListParams, options?: CallOptions) => CursorListPromise<CreditIncludedRule>;
1497
+ /**
1498
+ * Edit a rule's credits, per-seat choice, trial credits or allocation interval, or archive
1499
+ * it (`archived: false` brings it back). It takes effect from the next period granted;
1500
+ * periods already granted keep what they were granted. A rule left live is judged against
1501
+ * its Price as it is now, with the same errors as `create`.
1502
+ */
1503
+ update: (ruleId: string, input: UpdateCreditIncludedRuleInput, options?: CallOptions) => Promise<CreditIncludedRule>;
1504
+ };
1505
+ includedWindows: {
1506
+ /**
1507
+ * The Included Credit Windows of one or more subscriptions (`subscription`, an id or a list
1508
+ * of up to 100), or of a customer (`customer`, by external id) - newest first: what each
1509
+ * period Billow granted includes (the whole period, each month of it under a monthly rule,
1510
+ * or a trial), how far it was issued, and its `state`. With `current: true`, only each
1511
+ * subscription's latest window that has started - what it stands at now. Auto-paginating by
1512
+ * cursor: `await` the first page, `for await (…)` every window, or `.listAll()` to collect
1513
+ * them.
1514
+ */
1515
+ list: (params: CreditIncludedWindowListParams, options?: CallOptions) => CursorListPromise<CreditIncludedWindow>;
1516
+ };
1448
1517
  topUps: {
1449
1518
  /**
1450
1519
  * Buy a Credit Pack for a customer: answers the top-up with `checkoutUrl`, the hosted
@@ -1535,6 +1604,15 @@ declare function createCreditsResource(ctx: RequestContext): {
1535
1604
  create: (input: CreateCreditReservationInput, options: IdempotentRequestOptions) => Promise<CreditReservationRequestResult>;
1536
1605
  /** A reservation as it now stands. */
1537
1606
  get: (reservationId: string, options?: CallOptions) => Promise<CreditReservation>;
1607
+ /**
1608
+ * Your project's reservations, oldest first, optionally of one `status`, one `customer` (by
1609
+ * external id), or protected more than `protectedLongerThan` seconds ago - with
1610
+ * `{ status: "protected", protectedLongerThan: page.protectedHoldMaxSeconds }`, the paid
1611
+ * operations waiting past your maximum for a decision (commit or release each). Every page
1612
+ * carries `protectedHoldMaxSeconds`. Auto-paginating by cursor: `await` the first page,
1613
+ * `for await (…)` every reservation, or `.listAll()` to collect them.
1614
+ */
1615
+ list: (params?: CreditReservationListParams, options?: CallOptions) => CursorListPromise<CreditReservation, CreditReservationPage>;
1538
1616
  /**
1539
1617
  * A customer's reservation (by external id) made with `operationKey` - how to find one whose
1540
1618
  * reply was lost. Throws `not_found` (404) when there is none.
@@ -1649,7 +1727,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1649
1727
  hostnameUnicode: string;
1650
1728
  environment: "live";
1651
1729
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1652
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1730
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1653
1731
  isPrimary: boolean;
1654
1732
  records: {
1655
1733
  type: "TXT" | "CNAME";
@@ -1706,7 +1784,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1706
1784
  hostnameUnicode: string;
1707
1785
  environment: "live";
1708
1786
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1709
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1787
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1710
1788
  isPrimary: boolean;
1711
1789
  records: {
1712
1790
  type: "TXT" | "CNAME";
@@ -1754,7 +1832,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1754
1832
  hostnameUnicode: string;
1755
1833
  environment: "live";
1756
1834
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1757
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1835
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1758
1836
  isPrimary: boolean;
1759
1837
  records: {
1760
1838
  type: "TXT" | "CNAME";
@@ -1803,7 +1881,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1803
1881
  hostnameUnicode: string;
1804
1882
  environment: "live";
1805
1883
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1806
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1884
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1807
1885
  isPrimary: boolean;
1808
1886
  records: {
1809
1887
  type: "TXT" | "CNAME";
@@ -1852,7 +1930,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1852
1930
  hostnameUnicode: string;
1853
1931
  environment: "live";
1854
1932
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1855
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1933
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1856
1934
  isPrimary: boolean;
1857
1935
  records: {
1858
1936
  type: "TXT" | "CNAME";
@@ -2391,6 +2469,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2391
2469
  defaultPaymentMethodId: string | null;
2392
2470
  createdAt: string;
2393
2471
  }>;
2472
+ /**
2473
+ * Pause an active or trialing subscription: no renewals and no access until it is resumed.
2474
+ * Refused while one of its invoices is still being collected.
2475
+ */
2394
2476
  pause: (id: string) => Promise<{
2395
2477
  id: string;
2396
2478
  status: "active" | "incomplete" | "incomplete_expired" | "trialing" | "past_due" | "paused" | "canceled" | "unpaid";
@@ -2413,6 +2495,13 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2413
2495
  defaultPaymentMethodId: string | null;
2414
2496
  createdAt: string;
2415
2497
  }>;
2498
+ /**
2499
+ * Resume a paused subscription. Paused time is never billed: resumed before its paid period
2500
+ * ends, it carries on and renews at `currentPeriodEnd`; resumed after, a fresh full period
2501
+ * starts now and is charged at once like a renewal, with the ended period's usage (a decline
2502
+ * returns it `past_due`). Usage recorded while paused is never billed. A paused trial resumes
2503
+ * `trialing`. Duplicate calls are safe.
2504
+ */
2416
2505
  resume: (id: string) => Promise<{
2417
2506
  id: string;
2418
2507
  status: "active" | "incomplete" | "incomplete_expired" | "trialing" | "past_due" | "paused" | "canceled" | "unpaid";
@@ -2913,4 +3002,4 @@ declare class BillowPortal {
2913
3002
  };
2914
3003
  }
2915
3004
 
2916
- 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, CreateCreditPackInput, type CreateCreditQuoteInput, type CreateCreditReservationInput, CreateCreditTopUpInput, CreateHostedDomainInput, CreateMerchantInitiatedChargeInput, type CreatePortalSessionInput, CreateProductInput, CreateSubscriptionInput, CreateUsageAlertInput, type CreateWebhookEndpointInput, type CredentialSet, CreditBalance, type CreditDimensions, CreditGrant, CreditGrantRequestResult, CreditLedgerEntry, type CreditLineItem, CreditPack, CreditPacks, type CreditPricedLine, type CreditQuote, type CreditRateCard, type CreditRateCardItem, type CreditReservation, 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, UpdateCreditPackInput, type UpdateEmailTemplateInput, UpdateFeatureInput, UpdateProductInput, type UpdateWebhookEndpointInput, type UpsertCredentialsInput, UsageAlert, type WebhookDelivery, WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEndpointWithSecret, type Whoami, currencyExponent, formatMoney, isSecretField, toMajorUnits, toMinorUnits };
3005
+ 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, 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 };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
- import { f as SavedPaymentMethod, g as CreateHostedDomainInput, h as PayInvoiceInput } from './index.d-CKQAhQfJ.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-CKQAhQfJ.js';
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';
3
3
  import { C as ChargeStatus, P as PaymentMethodStatus, I as InvoiceStatus, R as RefundStatus, W as WebhookDeliveryStatus } from './billing-status-BZQN_gm7.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-BZQN_gm7.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-CgjcWmvb.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-CgjcWmvb.js';
9
- import { a as CreditThresholdLevel, e as CreditGrant, f as CreditTopUp, g as CreateCreditGrantInput, h as CreditGrantRequestResult, i as CreditPacks, j as CreateCreditPackInput, k as CreditPack, U as UpdateCreditPackInput, l as CreateCreditTopUpInput, m as CreditTopUpRequestResult, n as CreditTopUpListParams, o as CreditBalance, p as CreditLedgerEntry, q as CreditUsageParams, r as CreditUsage } from './hosted-domains-z_I0edmM.js';
10
- export { s as CreditAccountStatus, C as CreditGrantKind, t as CreditMoney, u as CreditPackBreakdown, v as CreditPackListItem, w as CreditTopUpStatus, x as CreditTransactionType, y as CreditUsageGroupBy, H as HostedDomainActivatedData, d as HostedDomainDisabledData, b as HostedDomainDnsFailingData, z as HostedDomainEventBase, c as HostedDomainReassignmentPendingData, A as HostedDomainStatus, B as HostedDomainStatusReason } from './hosted-domains-z_I0edmM.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-BF4OGaLI.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-BF4OGaLI.js';
9
+ import { a as CreditThresholdLevel, e as CreditGrant, f as CreditTopUp, g as CreditIncludedWindow, h as CreateCreditGrantInput, i as CreditGrantRequestResult, j as CreditPacks, k as CreateCreditPackInput, l as CreditPack, U as UpdateCreditPackInput, m as CreateCreditIncludedRuleInput, n as CreditIncludedRule, o as UpdateCreditIncludedRuleInput, p as CreditIncludedWindowListParams, q as CreateCreditTopUpInput, r as CreditTopUpRequestResult, s as CreditTopUpListParams, t as CreditBalance, u as CreditLedgerEntry, v as CreditUsageParams, w as CreditUsage } from './hosted-domains-DSTQ1GZz.js';
10
+ export { x as CreditAccountStatus, y as CreditAllocationInterval, C as CreditGrantKind, z as CreditMoney, A as CreditPackBreakdown, B as CreditPackListItem, D as CreditTopUpStatus, E as CreditTransactionType, F as CreditUsageGroupBy, G as CreditWindowState, H as HostedDomainActivatedData, d as HostedDomainDisabledData, b as HostedDomainDnsFailingData, I as HostedDomainEventBase, c as HostedDomainReassignmentPendingData, J as HostedDomainStatus, K as HostedDomainStatusReason, L as IncludedCredits, M as IncludedPeriod } from './hosted-domains-DSTQ1GZz.js';
11
11
  import 'zod';
12
12
 
13
13
  /**
@@ -261,9 +261,9 @@ interface CursorPaginated<T> {
261
261
  * The return type of a cursor-paginated `.list()`: like {@link ListPromise}, BOTH a Promise for
262
262
  * the first page AND async-iterable across ALL pages (`for await`, or `.listAll()`). The walk
263
263
  * follows `nextCursor` until it is null, so rows arriving at the head meanwhile never make it skip
264
- * or repeat a row.
264
+ * or repeat a row. `Page` is the first page's type, for a list whose pages carry more than rows.
265
265
  */
266
- interface CursorListPromise<T> extends Promise<CursorPaginated<T>>, AsyncIterable<T> {
266
+ interface CursorListPromise<T, Page extends CursorPaginated<T> = CursorPaginated<T>> extends Promise<Page>, AsyncIterable<T> {
267
267
  /** Page through the entire list and collect every item into one array. */
268
268
  listAll(): Promise<T[]>;
269
269
  }
@@ -599,6 +599,7 @@ interface InvoiceListParams extends ListParams {
599
599
  }
600
600
  interface InvoiceDetail {
601
601
  invoice: Invoice;
602
+ /** In the order the invoice lists them (as its PDF and receipt email do). */
602
603
  lineItems: InvoiceLineItem[];
603
604
  }
604
605
  /** How an offline payment was collected (ADR-0026). `other` is the escape hatch. */
@@ -716,6 +717,7 @@ interface Whoami {
716
717
  * Every credit quantity - and every count of units - is a `string` of a whole number, e.g.
717
718
  * `"5000000"` for 5 credits: never a `number`, which would silently round past 2^53.
718
719
  */
720
+
719
721
  /** One Credit Action's price in a Rate Card version: `ceil(units * unitPrice / perUnits)` a line. */
720
722
  interface CreditRateCardItem {
721
723
  /** The Credit Action key, e.g. `send_message`. */
@@ -829,6 +831,29 @@ interface CreditReservation {
829
831
  metadata: Record<string, string> | null;
830
832
  createdAt: string;
831
833
  }
834
+ /** Narrow the project's reservations list. */
835
+ interface CreditReservationListParams {
836
+ /** Page size: 1 to 100 (default 25); the server clamps a larger one. */
837
+ limit?: number;
838
+ /** A `nextCursor` to continue from; omit to start at the oldest reservation. */
839
+ cursor?: string;
840
+ status?: CreditReservationStatus;
841
+ /** Only this customer's reservations (by external id). */
842
+ customer?: string;
843
+ /**
844
+ * Only reservations protected more than this many seconds ago, whatever their status now (with
845
+ * `status: "protected"`, the ones still waiting). A reservation never protected never matches.
846
+ */
847
+ protectedLongerThan?: number;
848
+ }
849
+ /** A page of the project's reservations, oldest first. */
850
+ interface CreditReservationPage extends CursorPaginated<CreditReservation> {
851
+ /**
852
+ * Your project's protected-hold maximum, in seconds (7 days unless configured): a protected hold
853
+ * never expires, so one protected longer than this needs your decision - commit or release it.
854
+ */
855
+ protectedHoldMaxSeconds: number;
856
+ }
832
857
  /** What a reservation holds for and how it is identified; give `quoteId` or `items`. */
833
858
  interface CreateCreditReservationBase {
834
859
  /** The customer's external id. */
@@ -1086,6 +1111,7 @@ interface CustomerDataExport {
1086
1111
  createdAt: string;
1087
1112
  updatedAt: string;
1088
1113
  }>;
1114
+ /** By invoice, each invoice's lines in the order it lists them. */
1089
1115
  invoiceLineItems: Array<{
1090
1116
  id: string;
1091
1117
  invoiceId: string;
@@ -1094,6 +1120,8 @@ interface CustomerDataExport {
1094
1120
  amount: number;
1095
1121
  quantity: number;
1096
1122
  currency: string;
1123
+ /** Where the line sits on its invoice, from 0. */
1124
+ position: number;
1097
1125
  createdAt: string;
1098
1126
  updatedAt: string;
1099
1127
  }>;
@@ -1162,6 +1190,8 @@ interface CustomerCreditsExport {
1162
1190
  reversals: CreditReversal[];
1163
1191
  /** Every quote made for the customer (even with no credit account), with its priced lines. */
1164
1192
  quotes: CreditQuote[];
1193
+ /** Every Included Credit Window of the customer's subscriptions, oldest first. */
1194
+ includedWindows: CreditIncludedWindow[];
1165
1195
  /** Every ledger transaction, in the order it was written, with its postings. */
1166
1196
  ledger: Array<{
1167
1197
  id: string;
@@ -1445,6 +1475,45 @@ declare function createCreditsResource(ctx: RequestContext): {
1445
1475
  /** Edit a pack's terms or Price, or archive it; top-ups already made keep their terms. */
1446
1476
  update: (packId: string, input: UpdateCreditPackInput, options?: CallOptions) => Promise<CreditPack>;
1447
1477
  };
1478
+ includedRules: {
1479
+ /**
1480
+ * Configure an Included Credit Rule on a recurring base Price: the credits a subscription on
1481
+ * it includes for each period Billow grants it - per billing period, or per month of a Price
1482
+ * billed for longer than a month - and for a trial. Configuration, so no idempotency key:
1483
+ * a second live rule for the same Price throws `conflict` (409,
1484
+ * `details.reason: "included_rule_exists"`, with the live rule's `ruleId`). Throws
1485
+ * `validation_error` (422) with `details.reason: "not_a_base_price"` for a Price that is not
1486
+ * a recurring base Price, or `"allocation_not_shorter_than_billing"` for a monthly
1487
+ * allocation on a Price not billed for longer than a month.
1488
+ */
1489
+ create: (input: CreateCreditIncludedRuleInput, options?: CallOptions) => Promise<CreditIncludedRule>;
1490
+ /** A rule, archived or not. */
1491
+ get: (ruleId: string, options?: CallOptions) => Promise<CreditIncludedRule>;
1492
+ /**
1493
+ * Every rule, archived ones included, newest first. Auto-paginating by cursor: `await` the
1494
+ * first page, `for await (…)` every rule, or `.listAll()` to collect them.
1495
+ */
1496
+ list: (params?: CursorListParams, options?: CallOptions) => CursorListPromise<CreditIncludedRule>;
1497
+ /**
1498
+ * Edit a rule's credits, per-seat choice, trial credits or allocation interval, or archive
1499
+ * it (`archived: false` brings it back). It takes effect from the next period granted;
1500
+ * periods already granted keep what they were granted. A rule left live is judged against
1501
+ * its Price as it is now, with the same errors as `create`.
1502
+ */
1503
+ update: (ruleId: string, input: UpdateCreditIncludedRuleInput, options?: CallOptions) => Promise<CreditIncludedRule>;
1504
+ };
1505
+ includedWindows: {
1506
+ /**
1507
+ * The Included Credit Windows of one or more subscriptions (`subscription`, an id or a list
1508
+ * of up to 100), or of a customer (`customer`, by external id) - newest first: what each
1509
+ * period Billow granted includes (the whole period, each month of it under a monthly rule,
1510
+ * or a trial), how far it was issued, and its `state`. With `current: true`, only each
1511
+ * subscription's latest window that has started - what it stands at now. Auto-paginating by
1512
+ * cursor: `await` the first page, `for await (…)` every window, or `.listAll()` to collect
1513
+ * them.
1514
+ */
1515
+ list: (params: CreditIncludedWindowListParams, options?: CallOptions) => CursorListPromise<CreditIncludedWindow>;
1516
+ };
1448
1517
  topUps: {
1449
1518
  /**
1450
1519
  * Buy a Credit Pack for a customer: answers the top-up with `checkoutUrl`, the hosted
@@ -1535,6 +1604,15 @@ declare function createCreditsResource(ctx: RequestContext): {
1535
1604
  create: (input: CreateCreditReservationInput, options: IdempotentRequestOptions) => Promise<CreditReservationRequestResult>;
1536
1605
  /** A reservation as it now stands. */
1537
1606
  get: (reservationId: string, options?: CallOptions) => Promise<CreditReservation>;
1607
+ /**
1608
+ * Your project's reservations, oldest first, optionally of one `status`, one `customer` (by
1609
+ * external id), or protected more than `protectedLongerThan` seconds ago - with
1610
+ * `{ status: "protected", protectedLongerThan: page.protectedHoldMaxSeconds }`, the paid
1611
+ * operations waiting past your maximum for a decision (commit or release each). Every page
1612
+ * carries `protectedHoldMaxSeconds`. Auto-paginating by cursor: `await` the first page,
1613
+ * `for await (…)` every reservation, or `.listAll()` to collect them.
1614
+ */
1615
+ list: (params?: CreditReservationListParams, options?: CallOptions) => CursorListPromise<CreditReservation, CreditReservationPage>;
1538
1616
  /**
1539
1617
  * A customer's reservation (by external id) made with `operationKey` - how to find one whose
1540
1618
  * reply was lost. Throws `not_found` (404) when there is none.
@@ -1649,7 +1727,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1649
1727
  hostnameUnicode: string;
1650
1728
  environment: "live";
1651
1729
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1652
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1730
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1653
1731
  isPrimary: boolean;
1654
1732
  records: {
1655
1733
  type: "TXT" | "CNAME";
@@ -1706,7 +1784,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1706
1784
  hostnameUnicode: string;
1707
1785
  environment: "live";
1708
1786
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1709
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1787
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1710
1788
  isPrimary: boolean;
1711
1789
  records: {
1712
1790
  type: "TXT" | "CNAME";
@@ -1754,7 +1832,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1754
1832
  hostnameUnicode: string;
1755
1833
  environment: "live";
1756
1834
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1757
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1835
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1758
1836
  isPrimary: boolean;
1759
1837
  records: {
1760
1838
  type: "TXT" | "CNAME";
@@ -1803,7 +1881,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1803
1881
  hostnameUnicode: string;
1804
1882
  environment: "live";
1805
1883
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1806
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1884
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1807
1885
  isPrimary: boolean;
1808
1886
  records: {
1809
1887
  type: "TXT" | "CNAME";
@@ -1852,7 +1930,7 @@ declare function createHostedDomainsResource(ctx: RequestContext): {
1852
1930
  hostnameUnicode: string;
1853
1931
  environment: "live";
1854
1932
  status: "failed" | "active" | "pending_verification" | "verified" | "disabled";
1855
- statusReason: "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | "suspended" | null;
1933
+ statusReason: "suspended" | "verification_expired" | "tls_unavailable" | "edge_blocked" | "dns_lost" | "reassigned" | "entitlement_lapsed" | null;
1856
1934
  isPrimary: boolean;
1857
1935
  records: {
1858
1936
  type: "TXT" | "CNAME";
@@ -2391,6 +2469,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2391
2469
  defaultPaymentMethodId: string | null;
2392
2470
  createdAt: string;
2393
2471
  }>;
2472
+ /**
2473
+ * Pause an active or trialing subscription: no renewals and no access until it is resumed.
2474
+ * Refused while one of its invoices is still being collected.
2475
+ */
2394
2476
  pause: (id: string) => Promise<{
2395
2477
  id: string;
2396
2478
  status: "active" | "incomplete" | "incomplete_expired" | "trialing" | "past_due" | "paused" | "canceled" | "unpaid";
@@ -2413,6 +2495,13 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
2413
2495
  defaultPaymentMethodId: string | null;
2414
2496
  createdAt: string;
2415
2497
  }>;
2498
+ /**
2499
+ * Resume a paused subscription. Paused time is never billed: resumed before its paid period
2500
+ * ends, it carries on and renews at `currentPeriodEnd`; resumed after, a fresh full period
2501
+ * starts now and is charged at once like a renewal, with the ended period's usage (a decline
2502
+ * returns it `past_due`). Usage recorded while paused is never billed. A paused trial resumes
2503
+ * `trialing`. Duplicate calls are safe.
2504
+ */
2416
2505
  resume: (id: string) => Promise<{
2417
2506
  id: string;
2418
2507
  status: "active" | "incomplete" | "incomplete_expired" | "trialing" | "past_due" | "paused" | "canceled" | "unpaid";
@@ -2913,4 +3002,4 @@ declare class BillowPortal {
2913
3002
  };
2914
3003
  }
2915
3004
 
2916
- 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, CreateCreditPackInput, type CreateCreditQuoteInput, type CreateCreditReservationInput, CreateCreditTopUpInput, CreateHostedDomainInput, CreateMerchantInitiatedChargeInput, type CreatePortalSessionInput, CreateProductInput, CreateSubscriptionInput, CreateUsageAlertInput, type CreateWebhookEndpointInput, type CredentialSet, CreditBalance, type CreditDimensions, CreditGrant, CreditGrantRequestResult, CreditLedgerEntry, type CreditLineItem, CreditPack, CreditPacks, type CreditPricedLine, type CreditQuote, type CreditRateCard, type CreditRateCardItem, type CreditReservation, 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, UpdateCreditPackInput, type UpdateEmailTemplateInput, UpdateFeatureInput, UpdateProductInput, type UpdateWebhookEndpointInput, type UpsertCredentialsInput, UsageAlert, type WebhookDelivery, WebhookDeliveryStatus, type WebhookEndpoint, type WebhookEndpointWithSecret, type Whoami, currencyExponent, formatMoney, isSecretField, toMajorUnits, toMinorUnits };
3005
+ 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, 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 };
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-JG2OOAMX.js';
1
+ export { BILLOW_ERROR_CODES, Billow, BillowApiError, BillowPortal, BillowPublishable, currencyExponent, formatMoney, isSecretField, toMajorUnits, toMinorUnits } from './chunk-GT5VBLN5.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-CCG4F5FK.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-CKQAhQfJ.cjs';
2
+ import './index.d-DSEYhV2c.cjs';
3
3
  import 'zod';
4
4
  import './billing-status-BZQN_gm7.cjs';
5
5
  import './status.cjs';
6
- import './billing-B-VyZCXV.cjs';
7
- import './hosted-domains-BYYl2DSa.cjs';
6
+ import './billing-B16zL5xU.cjs';
7
+ import './hosted-domains-DwakPG4J.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-CKQAhQfJ.js';
2
+ import './index.d-DSEYhV2c.js';
3
3
  import 'zod';
4
4
  import './billing-status-BZQN_gm7.js';
5
5
  import './status.js';
6
- import './billing-CgjcWmvb.js';
7
- import './hosted-domains-z_I0edmM.js';
6
+ import './billing-BF4OGaLI.js';
7
+ import './hosted-domains-DSTQ1GZz.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-B-VyZCXV.cjs';
4
- import './index.d-CKQAhQfJ.cjs';
3
+ import { A as AttachResult, b as CheckResult, E as EntitlementView, P as Product, T as TrackResult } from './billing-B16zL5xU.cjs';
4
+ import './index.d-DSEYhV2c.cjs';
5
5
  import 'zod';
6
6
  import './billing-status-BZQN_gm7.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-CgjcWmvb.js';
4
- import './index.d-CKQAhQfJ.js';
3
+ import { A as AttachResult, b as CheckResult, E as EntitlementView, P as Product, T as TrackResult } from './billing-BF4OGaLI.js';
4
+ import './index.d-DSEYhV2c.js';
5
5
  import 'zod';
6
6
  import './billing-status-BZQN_gm7.js';
7
7
 
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { BillowPublishable } from './chunk-JG2OOAMX.js';
2
+ import { BillowPublishable } from './chunk-GT5VBLN5.js';
3
3
  import './chunk-CCG4F5FK.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-CKQAhQfJ.cjs';
2
+ import './index.d-DSEYhV2c.cjs';
3
3
  import 'zod';
4
4
  import './billing-status-BZQN_gm7.cjs';
5
5
  import './status.cjs';
6
- import './billing-B-VyZCXV.cjs';
7
- import './hosted-domains-BYYl2DSa.cjs';
6
+ import './billing-B16zL5xU.cjs';
7
+ import './hosted-domains-DwakPG4J.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-CKQAhQfJ.js';
2
+ import './index.d-DSEYhV2c.js';
3
3
  import 'zod';
4
4
  import './billing-status-BZQN_gm7.js';
5
5
  import './status.js';
6
- import './billing-CgjcWmvb.js';
7
- import './hosted-domains-z_I0edmM.js';
6
+ import './billing-BF4OGaLI.js';
7
+ import './hosted-domains-DSTQ1GZz.js';
8
8
 
9
9
  /**
10
10
  * Backend handler for the browser-facing surface (the React hooks talk to this,