@usebillow/sdk 0.11.0 → 0.13.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/CHANGELOG.md +26 -0
- package/dist/{billing-Bs10EcjR.d.ts → billing-BEbVLGe9.d.ts} +6 -3
- package/dist/{billing-8ug1Gw05.d.cts → billing-CDEO8Jqv.d.cts} +6 -3
- package/dist/{chunk-XUFQG6EA.js → chunk-XRZZUXOR.js} +36 -6
- package/dist/chunk-XRZZUXOR.js.map +1 -0
- package/dist/config.d.cts +3 -3
- package/dist/config.d.ts +3 -3
- package/dist/{hosted-domains-zWm2srOk.d.cts → hosted-domains-Cuk3j04R.d.cts} +3 -3
- package/dist/{hosted-domains-BrnwkHqq.d.ts → hosted-domains-DMgokjiv.d.ts} +3 -3
- package/dist/index.cjs +34 -4
- package/dist/index.cjs.map +1 -1
- package/dist/{index.d-DSEYhV2c.d.ts → index.d-D5v2ETKF.d.cts} +21 -1
- package/dist/{index.d-DSEYhV2c.d.cts → index.d-D5v2ETKF.d.ts} +21 -1
- package/dist/index.d.cts +155 -20
- package/dist/index.d.ts +155 -20
- package/dist/index.js +1 -1
- package/dist/ingestion.d.cts +3 -3
- package/dist/ingestion.d.ts +3 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/webhooks.cjs +1 -0
- package/dist/webhooks.cjs.map +1 -1
- package/dist/webhooks.d.cts +23 -4
- package/dist/webhooks.d.ts +23 -4
- package/dist/webhooks.js +1 -0
- package/dist/webhooks.js.map +1 -1
- package/package.json +3 -3
- package/dist/chunk-XUFQG6EA.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { f as SavedPaymentMethod, g as CreateHostedDomainInput, h as PayInvoiceInput } from './index.d-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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
|
-
/**
|
|
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
|
+
* The same for sandbox and live sessions: a Project's custom domains serve both.
|
|
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
|
|
@@ -954,6 +984,12 @@ interface PortalSessionExchangeInput {
|
|
|
954
984
|
* exchanged the link lands on its own session, and only that browser's. */
|
|
955
985
|
sessionToken?: string;
|
|
956
986
|
}
|
|
987
|
+
/** Starting a `checkout` session's subscription (`BillowPortal.checkout.start`). */
|
|
988
|
+
interface PortalCheckoutStartInput {
|
|
989
|
+
/** Where the payment page returns the customer when the session has no `returnUrl` of its
|
|
990
|
+
* own: a page of the session's portal, or a URL that passes the return URL rules. */
|
|
991
|
+
returnUrl?: string;
|
|
992
|
+
}
|
|
957
993
|
/** What the exchange returns: the session's bearer from now on, and its unchanged expiry. */
|
|
958
994
|
interface PortalSessionExchange {
|
|
959
995
|
sessionToken: string;
|
|
@@ -996,17 +1032,30 @@ interface PortalView {
|
|
|
996
1032
|
};
|
|
997
1033
|
flow: PortalSessionFlow;
|
|
998
1034
|
returnUrl: string | null;
|
|
999
|
-
subscriptions:
|
|
1035
|
+
subscriptions: PortalSubscription[];
|
|
1000
1036
|
usage: CustomerUsage[];
|
|
1001
1037
|
paymentMethods: SavedPaymentMethod[];
|
|
1002
1038
|
}
|
|
1039
|
+
/**
|
|
1040
|
+
* A scheduled plan change as the Customer sees it: `blocked` says only that it is on hold and
|
|
1041
|
+
* since when - the reason is for the Operator (`ScheduledSubscriptionChange.blocked`).
|
|
1042
|
+
*/
|
|
1043
|
+
type PortalScheduledChange = Omit<ScheduledSubscriptionChange, "blocked"> & {
|
|
1044
|
+
blocked: {
|
|
1045
|
+
since: string;
|
|
1046
|
+
} | null;
|
|
1047
|
+
};
|
|
1048
|
+
/** A subscription as the portal lists it. */
|
|
1049
|
+
type PortalSubscription = Omit<SubscriptionListItem, "scheduledChange"> & {
|
|
1050
|
+
scheduledChange: PortalScheduledChange | null;
|
|
1051
|
+
};
|
|
1003
1052
|
/** The subscription's state after a portal cancel (scheduled at period end). */
|
|
1004
1053
|
interface PortalSubscriptionStatus {
|
|
1005
1054
|
id: string;
|
|
1006
1055
|
status: string;
|
|
1007
1056
|
cancelAtPeriodEnd: boolean;
|
|
1008
1057
|
currentPeriodEnd: string | null;
|
|
1009
|
-
scheduledChange:
|
|
1058
|
+
scheduledChange: PortalScheduledChange | null;
|
|
1010
1059
|
}
|
|
1011
1060
|
/** The outcome of a portal-driven plan change (PRD-15). */
|
|
1012
1061
|
interface PortalPlanChange {
|
|
@@ -1156,6 +1205,18 @@ interface CustomerDataExport {
|
|
|
1156
1205
|
createdAt: string;
|
|
1157
1206
|
updatedAt: string;
|
|
1158
1207
|
}>;
|
|
1208
|
+
/** Credit notes voided on those refunds (the provider reversed the refund), as issued. */
|
|
1209
|
+
voidedCreditNotes: Array<{
|
|
1210
|
+
id: string;
|
|
1211
|
+
refundId: string;
|
|
1212
|
+
number: string;
|
|
1213
|
+
amount: number;
|
|
1214
|
+
subtotal: number;
|
|
1215
|
+
tax: number;
|
|
1216
|
+
currency: string;
|
|
1217
|
+
issuedAt: string;
|
|
1218
|
+
voidedAt: string;
|
|
1219
|
+
}>;
|
|
1159
1220
|
usageEvents: Array<{
|
|
1160
1221
|
id: string;
|
|
1161
1222
|
featureId: string;
|
|
@@ -1237,6 +1298,15 @@ interface CustomerAnonymizationResult {
|
|
|
1237
1298
|
* - `conflict_on_charge`: another refund of the charge has an unresolved provider conflict.
|
|
1238
1299
|
*/
|
|
1239
1300
|
type RefundReviewReason = "unconfirmed" | "unconfirmable_without_provider_id" | "provider_conflict" | "conflict_on_charge";
|
|
1301
|
+
/** A credit note voided on a refund, exactly as it was issued (see `Refund.voidedCreditNotes`). */
|
|
1302
|
+
interface VoidedCreditNote {
|
|
1303
|
+
number: string;
|
|
1304
|
+
amount: number;
|
|
1305
|
+
subtotal: number;
|
|
1306
|
+
tax: number;
|
|
1307
|
+
issuedAt: string;
|
|
1308
|
+
voidedAt: string;
|
|
1309
|
+
}
|
|
1240
1310
|
interface Refund {
|
|
1241
1311
|
id: string;
|
|
1242
1312
|
chargeId: string;
|
|
@@ -1257,12 +1327,20 @@ interface Refund {
|
|
|
1257
1327
|
/** Why it needs (or needed) review - see `RefundReviewReason`. */
|
|
1258
1328
|
reviewReason: RefundReviewReason | null;
|
|
1259
1329
|
providerRefundId: string | null;
|
|
1330
|
+
/** The refund's credit note in force (null when it has none, e.g. once it was voided). */
|
|
1260
1331
|
creditNoteNumber: string | null;
|
|
1332
|
+
/**
|
|
1333
|
+
* Credit notes issued for this refund and voided since: the provider reversed the refund after it
|
|
1334
|
+
* succeeded (the customer's bank returned the money) and it was resolved as not refunded. Each is
|
|
1335
|
+
* kept exactly as issued; download one with `charges.voidedCreditNote`, badged VOID.
|
|
1336
|
+
*/
|
|
1337
|
+
voidedCreditNotes: VoidedCreditNote[];
|
|
1261
1338
|
/**
|
|
1262
1339
|
* 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
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1340
|
+
* other way (e.g. `succeeded` for a refund resolved as not refunded, or `failed` for a refund
|
|
1341
|
+
* the provider reversed after it succeeded), is unresolved: the money moved differently from
|
|
1342
|
+
* what `status` says. The charge is held (no new refunds) until it is resolved with
|
|
1343
|
+
* `charges.resolveRefund`, which clears it.
|
|
1266
1344
|
*/
|
|
1267
1345
|
providerConflictStatus: RefundStatus | null;
|
|
1268
1346
|
/** When that contrary answer arrived (kept after the conflict is resolved). */
|
|
@@ -1418,6 +1496,11 @@ declare function createChargesResource(ctx: RequestContext): {
|
|
|
1418
1496
|
receipt: (id: string, options?: CallOptions) => Promise<ArrayBuffer>;
|
|
1419
1497
|
/** Download the immutable credit note for a succeeded refund. */
|
|
1420
1498
|
creditNote: (chargeId: string, refundId: string, options?: CallOptions) => Promise<ArrayBuffer>;
|
|
1499
|
+
/**
|
|
1500
|
+
* Download a credit note voided on a refund (one of its `voidedCreditNotes`), exactly as it was
|
|
1501
|
+
* issued and badged VOID.
|
|
1502
|
+
*/
|
|
1503
|
+
voidedCreditNote: (chargeId: string, refundId: string, creditNoteNumber: string, options?: CallOptions) => Promise<ArrayBuffer>;
|
|
1421
1504
|
/**
|
|
1422
1505
|
* Refund a succeeded charge: `{ amount }` (minor units) for a partial, `{}` for its whole
|
|
1423
1506
|
* remaining balance. The `idempotencyKey` is required and must identify this one refund
|
|
@@ -1442,7 +1525,10 @@ declare function createChargesResource(ctx: RequestContext): {
|
|
|
1442
1525
|
/**
|
|
1443
1526
|
* Record the outcome you verified in the provider dashboard for a refund awaiting review
|
|
1444
1527
|
* (`needsReview`): `succeeded` settles it with a credit note, `failed` releases its amount.
|
|
1445
|
-
* A refund with a provider conflict (`providerConflictStatus`) resolves only
|
|
1528
|
+
* A refund with a provider conflict (`providerConflictStatus`) recorded `failed` resolves only
|
|
1529
|
+
* as `succeeded`; one recorded `succeeded` that the provider later reported failed (a reversal:
|
|
1530
|
+
* the customer's bank returned the money) resolves either way, `failed` making its amount
|
|
1531
|
+
* refundable again.
|
|
1446
1532
|
*/
|
|
1447
1533
|
resolveRefund: (chargeId: string, refundId: string, input: ResolveRefundInput, options?: CallOptions) => Promise<Refund>;
|
|
1448
1534
|
};
|
|
@@ -1588,13 +1674,22 @@ declare function createCreditsResource(ctx: RequestContext): {
|
|
|
1588
1674
|
/**
|
|
1589
1675
|
* Publish a new Rate Card version: what each Credit Action costs, as
|
|
1590
1676
|
* `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)
|
|
1677
|
+
* change is a new version - and take effect in order, at `effectiveAt` (now when omitted),
|
|
1678
|
+
* unless retracted before then.
|
|
1592
1679
|
*/
|
|
1593
1680
|
publish: (input: PublishCreditRateCardInput, options?: CallOptions) => Promise<CreditRateCard>;
|
|
1594
1681
|
/** The version in effect now (`not_found` before the first takes effect). */
|
|
1595
1682
|
current: (options?: CallOptions) => Promise<CreditRateCard>;
|
|
1596
1683
|
/** One version, by its number. */
|
|
1597
1684
|
get: (version: number, options?: CallOptions) => Promise<CreditRateCard>;
|
|
1685
|
+
/**
|
|
1686
|
+
* Retract a version before it takes effect: it never does (`retractedAt` is set), and
|
|
1687
|
+
* versions published after it take effect in order after the last one not retracted - so a
|
|
1688
|
+
* scheduled price change no longer holds back an earlier correction. Safe to retry: a
|
|
1689
|
+
* retracted version answers as retracted. A version already in effect, current or
|
|
1690
|
+
* superseded, throws `conflict` (409, `details.reason: "already_effective"`).
|
|
1691
|
+
*/
|
|
1692
|
+
retract: (version: number, options?: CallOptions) => Promise<CreditRateCard>;
|
|
1598
1693
|
/**
|
|
1599
1694
|
* The published versions, newest first. Auto-paginating by cursor: `await` the first page,
|
|
1600
1695
|
* `for await (…)` every version, or `.listAll()` to collect them.
|
|
@@ -2321,6 +2416,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2321
2416
|
productSlug: string;
|
|
2322
2417
|
productName: string;
|
|
2323
2418
|
effectiveAt: string | null;
|
|
2419
|
+
blocked: {
|
|
2420
|
+
reason: string;
|
|
2421
|
+
since: string;
|
|
2422
|
+
} | null;
|
|
2324
2423
|
} | null;
|
|
2325
2424
|
canceledAt: string | null;
|
|
2326
2425
|
remainingCycles: number | null;
|
|
@@ -2371,6 +2470,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2371
2470
|
productSlug: string;
|
|
2372
2471
|
productName: string;
|
|
2373
2472
|
effectiveAt: string | null;
|
|
2473
|
+
blocked: {
|
|
2474
|
+
reason: string;
|
|
2475
|
+
since: string;
|
|
2476
|
+
} | null;
|
|
2374
2477
|
} | null;
|
|
2375
2478
|
canceledAt: string | null;
|
|
2376
2479
|
remainingCycles: number | null;
|
|
@@ -2399,6 +2502,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2399
2502
|
productSlug: string;
|
|
2400
2503
|
productName: string;
|
|
2401
2504
|
effectiveAt: string | null;
|
|
2505
|
+
blocked: {
|
|
2506
|
+
reason: string;
|
|
2507
|
+
since: string;
|
|
2508
|
+
} | null;
|
|
2402
2509
|
} | null;
|
|
2403
2510
|
canceledAt: string | null;
|
|
2404
2511
|
remainingCycles: number | null;
|
|
@@ -2433,6 +2540,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2433
2540
|
productSlug: string;
|
|
2434
2541
|
productName: string;
|
|
2435
2542
|
effectiveAt: string | null;
|
|
2543
|
+
blocked: {
|
|
2544
|
+
reason: string;
|
|
2545
|
+
since: string;
|
|
2546
|
+
} | null;
|
|
2436
2547
|
} | null;
|
|
2437
2548
|
canceledAt: string | null;
|
|
2438
2549
|
remainingCycles: number | null;
|
|
@@ -2462,6 +2573,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2462
2573
|
productSlug: string;
|
|
2463
2574
|
productName: string;
|
|
2464
2575
|
effectiveAt: string | null;
|
|
2576
|
+
blocked: {
|
|
2577
|
+
reason: string;
|
|
2578
|
+
since: string;
|
|
2579
|
+
} | null;
|
|
2465
2580
|
} | null;
|
|
2466
2581
|
canceledAt: string | null;
|
|
2467
2582
|
remainingCycles: number | null;
|
|
@@ -2485,6 +2600,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2485
2600
|
productSlug: string;
|
|
2486
2601
|
productName: string;
|
|
2487
2602
|
effectiveAt: string | null;
|
|
2603
|
+
blocked: {
|
|
2604
|
+
reason: string;
|
|
2605
|
+
since: string;
|
|
2606
|
+
} | null;
|
|
2488
2607
|
} | null;
|
|
2489
2608
|
canceledAt: string | null;
|
|
2490
2609
|
remainingCycles: number | null;
|
|
@@ -2511,6 +2630,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2511
2630
|
productSlug: string;
|
|
2512
2631
|
productName: string;
|
|
2513
2632
|
effectiveAt: string | null;
|
|
2633
|
+
blocked: {
|
|
2634
|
+
reason: string;
|
|
2635
|
+
since: string;
|
|
2636
|
+
} | null;
|
|
2514
2637
|
} | null;
|
|
2515
2638
|
canceledAt: string | null;
|
|
2516
2639
|
remainingCycles: number | null;
|
|
@@ -2540,6 +2663,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2540
2663
|
productSlug: string;
|
|
2541
2664
|
productName: string;
|
|
2542
2665
|
effectiveAt: string | null;
|
|
2666
|
+
blocked: {
|
|
2667
|
+
reason: string;
|
|
2668
|
+
since: string;
|
|
2669
|
+
} | null;
|
|
2543
2670
|
} | null;
|
|
2544
2671
|
canceledAt: string | null;
|
|
2545
2672
|
remainingCycles: number | null;
|
|
@@ -2569,6 +2696,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2569
2696
|
productSlug: string;
|
|
2570
2697
|
productName: string;
|
|
2571
2698
|
effectiveAt: string | null;
|
|
2699
|
+
blocked: {
|
|
2700
|
+
reason: string;
|
|
2701
|
+
since: string;
|
|
2702
|
+
} | null;
|
|
2572
2703
|
} | null;
|
|
2573
2704
|
canceledAt: string | null;
|
|
2574
2705
|
remainingCycles: number | null;
|
|
@@ -2596,6 +2727,10 @@ declare function createSubscriptionsResource(ctx: RequestContext): {
|
|
|
2596
2727
|
productSlug: string;
|
|
2597
2728
|
productName: string;
|
|
2598
2729
|
effectiveAt: string | null;
|
|
2730
|
+
blocked: {
|
|
2731
|
+
reason: string;
|
|
2732
|
+
since: string;
|
|
2733
|
+
} | null;
|
|
2599
2734
|
} | null;
|
|
2600
2735
|
canceledAt: string | null;
|
|
2601
2736
|
remainingCycles: number | null;
|
|
@@ -3018,10 +3153,10 @@ declare class BillowPortal {
|
|
|
3018
3153
|
/** The plan being confirmed (product + base price). */
|
|
3019
3154
|
get: (options?: CallOptions) => Promise<PortalCheckout>;
|
|
3020
3155
|
/** Subscribe to the plan → returns the hosted Paymob checkout URL to redirect to. */
|
|
3021
|
-
start: () => Promise<{
|
|
3156
|
+
start: (input?: PortalCheckoutStartInput) => Promise<{
|
|
3022
3157
|
checkoutUrl: string | null;
|
|
3023
3158
|
}>;
|
|
3024
3159
|
};
|
|
3025
3160
|
}
|
|
3026
3161
|
|
|
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 };
|
|
3162
|
+
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 PortalCheckoutStartInput, 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-
|
|
1
|
+
export { BILLOW_ERROR_CODES, Billow, BillowApiError, BillowPortal, BillowPublishable, currencyExponent, formatMoney, isSecretField, toMajorUnits, toMinorUnits } from './chunk-XRZZUXOR.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
|
package/dist/ingestion.d.cts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Billow } from './index.cjs';
|
|
2
|
-
import './index.d-
|
|
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-
|
|
7
|
-
import './hosted-domains-
|
|
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,
|
package/dist/ingestion.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Billow } from './index.js';
|
|
2
|
-
import './index.d-
|
|
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-
|
|
7
|
-
import './hosted-domains-
|
|
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,
|