import { type CancelSubscriptionsMatchingResult, type ChargeInvoiceResult, type CreateOneTimePaymentResult, type CreateSubscriptionResult, type OneTimePayment, type PaymentLink, type SandboxChargeMode } from "@autlantic/billing-engine"; import type { BillingInterval, RecurringInvoice, RecurringSubscription } from "@autlantic/payments-recurring-core"; import type { AutlanticBillingConfig, BillingCatalogPrice, BillingCatalogProduct, BillingCoupon, CreateBillingCouponRequest, CreateCatalogPriceRequest, CreateCatalogProductRequest, CreatePaymentLinkRequest, CreatePaymentRequest, CreateSubscriptionRequest, UpdateBillingCouponRequest, UpdateCatalogPriceRequest, UpdateCatalogProductRequest } from "./config"; import { type BillingLogger } from "./logger"; export declare const AUTLANTIC_BILLING_SDK_VERSION = "0.3.13"; /** Hosted API contract pin (Stripe-style). Sent as `Autlantic-Version`. */ export declare const AUTLANTIC_API_VERSION = "2026-01-01"; /** Hosted mode from API key prefix (Stripe-style). */ export declare function billingModeFromApiKey(apiKey: string | null | undefined): "test" | "live"; /** * Sandbox charge / in-process behavior for fromEnv. * Test keys always sandbox. Live keys only with ALLOW_LIVE_SANDBOX break-glass. */ export declare function sandboxFromApiKeyAndEnv(apiKey: string | null | undefined, env?: Record): boolean; export declare class AutlanticBilling { private readonly config; private readonly localStore; private readonly logger; constructor(config: AutlanticBillingConfig); /** Effective logger (custom or resolved console / noop). */ getLogger(): BillingLogger; static sandbox(input: { merchantId: string; webhookSecret?: string; debug?: boolean; logger?: BillingLogger; }): AutlanticBilling; static fromEnv(env?: Record): AutlanticBilling; createSubscription(input: CreateSubscriptionRequest): Promise; /** * Create a one-time USDC payment. * Hosted mode returns `checkoutUrl` for `/checkout/pay/:id`. */ createPayment(input: CreatePaymentRequest): Promise; /** * Create a shareable payment link. Hosted mode returns `url` for `/checkout/link/:id`. */ createPaymentLink(input: CreatePaymentLinkRequest): Promise<{ paymentLink: PaymentLink; url: string; }>; listPaymentLinks(): Promise>; getPaymentLink(id: string): Promise<{ paymentLink: PaymentLink; url?: string; }>; disablePaymentLink(id: string): Promise<{ paymentLink: PaymentLink; url?: string; }>; /** * Open a payment link (mint a one-time payment). Sandbox-only helper; * hosted checkout uses POST /checkout/link/:id/open. */ openPaymentLink(id: string, input: { customerWallet: string; }): Promise<{ payment: OneTimePayment; paymentLink: PaymentLink; checkoutUrl?: string; }>; getPayment(id: string): Promise; confirmPayment(id: string, input?: { txHash?: string; }): Promise<{ payment: OneTimePayment; alreadyPaid?: boolean; }>; /** Active products and prices from the merchant catalog (hosted API). */ listProducts(input?: { includeInactive?: boolean; }): Promise<{ products: BillingCatalogProduct[]; }>; /** Create a catalog product (optional nested price). Hosted API only. */ createProduct(input: CreateCatalogProductRequest): Promise<{ product: BillingCatalogProduct; }>; /** Update a catalog product. Hosted API only. */ updateProduct(productId: string, input: UpdateCatalogProductRequest): Promise<{ product: BillingCatalogProduct; }>; /** Create a price on a catalog product. Hosted API only. */ createPrice(productId: string, input: CreateCatalogPriceRequest): Promise<{ price: BillingCatalogPrice; }>; /** Update a catalog price. Hosted API only. */ updatePrice(priceId: string, input: UpdateCatalogPriceRequest): Promise<{ price: BillingCatalogPrice; }>; /** List merchant coupons (hosted API). */ listCoupons(input?: { includeInactive?: boolean; }): Promise<{ coupons: BillingCoupon[]; }>; /** Create a merchant coupon. Hosted API only. */ createCoupon(input: CreateBillingCouponRequest): Promise<{ coupon: BillingCoupon; }>; /** Update a merchant coupon. Hosted API only. */ updateCoupon(couponId: string, input: UpdateBillingCouponRequest): Promise<{ coupon: BillingCoupon; }>; /** Delete a merchant coupon. Hosted API only. */ deleteCoupon(couponId: string): Promise<{ ok: true; }>; listSubscriptions(input?: { status?: string; }): Promise<{ subscriptions: RecurringSubscription[]; }>; getCheckoutSession(id: string): Promise<{ session: unknown; }>; activateSubscription(id: string, input?: { onChainSubscriptionId?: string; }): Promise<{ subscription: RecurringSubscription; charge: ChargeInvoiceResult | null; txHash?: string; }>; getSubscription(id: string): Promise; updateSubscription(id: string, input: { amountUsdc?: number; interval?: BillingInterval; planId?: string; metadata?: Record; }): Promise<{ subscription: RecurringSubscription; }>; completeSubscription(id: string): Promise<{ subscription: RecurringSubscription; }>; cancelSubscription(id: string, immediate?: boolean): Promise<{ subscription: RecurringSubscription; }>; /** * Cancel all merchant subscriptions for a creator (metadata.creatorId). * Used for forced store offboarding. Immediate cancel voids open invoices. */ cancelSubscriptionsMatching(input: { creatorId: string; billingKinds?: string[]; immediate?: boolean; reason?: string; statuses?: string[]; }): Promise; /** Undo cancel-at-period-end so renewals continue. */ resumeSubscription(id: string): Promise<{ subscription: RecurringSubscription; }>; listInvoices(input?: { subscriptionId?: string; }): Promise<{ invoices: RecurringInvoice[]; }>; chargeInvoice(invoiceId: string, sandboxMode?: SandboxChargeMode): Promise; refundInvoice(invoiceId: string, input?: { amountUsdc?: number; }): Promise<{ invoice: RecurringInvoice; }>; voidInvoice(invoiceId: string): Promise<{ invoice: RecurringInvoice; }>; getInvoice(id: string): Promise; private requireApiBase; private headers; private get; private post; private patch; private delete; private fetchJson; } //# sourceMappingURL=client.d.ts.map