This page describes the current source; use an SDK matching the Indiana deployment. npm 0.0.1 beta is published. Methods and DTOs for the current source come from this page and contracts; a workspace version is not a publication receipt.
Verify host login and issue the current customer's session on your backend. Browsers cannot choose an arbitrary customerId.
Current exports and methods
setupPayment({ requestId, currency, makeDefault })Permissions
billing:writeCreate a standalone card setup, without a subscription, entitlement or usage billing consent.
Returns { setup }
readPaymentSetup({ setupId })Permissions
billing:readVerify the actual provider result of the original setup without duplicate charges.
Returns { setup }
readBillingInvoice({ invoiceId, after, limit })Permissions
billing:readPage through all verified invoice items with nextCursor, without charging.
Returns { detail }
readCreditStatement({ from, to, entityId?, snapshotAt, after, limit })Permissions
credits:readUp to 366 days. The first page uses null snapshotAt/after; subsequent pages retain the original snapshot and complete cursor.
Returns { statement }
previewUpdate({ requestId, membershipId, timing, change })Permissions
billing:readFix a plan or seat quote for an explicit membership while retaining sibling plans in the subscription.
Returns { quote }
update({ operationId })Permissions
billing:writeConfirm the fixed quote and recover its original charge attempt; verified payment determines fulfillment.
Returns { operation }
readSubscriptionUpdate({ operationId })Permissions
billing:readRead the update status; pending payment, scheduled and effective results retain the original operation identity.
Returns { operation }
previewAttach({ entityId?, requestId, plans, provider, currency, offerId? })Permissions
billing:readSave a 15-minute quote with the identified customer session. Omit customerId; preview initiates no payment or paid grant.
Returns { quote }
attach({ operationId })Permissions
billing:writeExecute after explicit quote acceptance. The host presents checkoutUrl; retry the same operationId after a lost response.
Returns { operation }
restoreNativePurchase({ requestId, provider, purchaseIntentId, productId, signedTransaction?, purchaseToken? })Permissions
billing:writeRecover a store-verified purchase under the identified customer session.
Returns { restore }
readSubscriptionOperation({ operationId })Permissions
billing:readRecover the original order status and verified delivery without initiating a new charge.
Returns { operation }
setBillingCoupons({ authorizationId, requestId, grantIds })Permissions
billing:writeSet ordered discounts for the current customer's active authorization using owned grants. Retrying requestId retains the original receipt; discounts cannot change during collection.
Returns { coupons }
confirmBillingAdjustment({ invoiceId, accepted: true })Permissions
billing:writeCall only after the customer reviews and accepts the fixed additional invoice; loading or automatic retry does not imply consent.
Returns { invoice }
readBillingControls(input?)Permissions
billing:readRead the verified customer's authorizations, limits, usage windows and automatic top-up state.
Returns { controls }
prepareBillingAuthorization(input)Permissions
billing:writeRetain requestId to prepare fixed version and limit terms; preparation is not customer consent.
Returns { prepared }
confirmBillingAuthorization({ authorizationId, accepted: true })Permissions
billing:writeCall after explicit customer consent; the server rechecks the current authorization and provider setup.
Returns { authorization }
revokeBillingAuthorization({ authorizationId, requestId })Permissions
billing:writeRevoke the current customer's authorization; retries retain the request UUID.
Returns { authorization }
listBillingInvoices({ after, limit }?)Permissions
billing:readRead usage invoices for the current customer; page with nextCursor and a maximum limit of 100.
Returns { invoices }
readBillingControls(input) / listBillingInvoices({ after, limit })Permissions
billing:readRead the authenticated customer's payment authorizations, usage windows, limits and paginated invoices. Reads, refreshes and pagination do not charge.
Returns { controls } / { invoices }
prepareBillingAuthorization(input) / confirmBillingAuthorization({ authorizationId, accepted: true }) / revokeBillingAuthorization({ authorizationId, requestId })Permissions
billing:writePrepare fixed terms and a Sandbox payment method with a persistent requestId. Payments require completed setup and explicit customer acceptance. Revocation blocks subsequent automatic charges and retains existing financial facts.
Returns { prepared } / { authorization }
identify(customerToken) / reset()Keep the token in memory only. Reset or identity changes abort old requests; destroy and discard active Funnel runs too.
Returns void
subscribeIdentity(listener)Observe identify/reset to clear host UI; returns an unsubscribe function.
Returns Unsubscribe function
checkEntitlement({ requirement, commerce?, paywallId? })Permissions
entitlements:readLater source entry, absent from the published npm 0.0.1 artifact. With matching SDK/server versions, use the current customer token to read allowed, denial reason and product recommendations. Browsers cannot choose a customer identity.
Returns { check }
readHoldings()Permissions
entitlements:readRead memberships and balances for the authenticated customer; no customerId is accepted.
Returns { holdings }
readLedger(query)Permissions
credits:readPage the authenticated customer's full history; cursors retain entry type and precise timestamp.
Returns { ledger }
quoteBalance(command)Permissions
credits:readSupply operation: quote, entitlementId, decimal quantity and properties. Quotes do not consume funds.
Returns { quote }
listOffers()Permissions
offers:resolveRead the current customer's available offers. Claims and purchases execute through published Funnel nodes.
Returns Offer[]
redeemCoupon(code, requestId)Permissions
offers:resolveRedeem a code in the current scope; retain requestId for retries after lost responses.
Returns { offer, reason }
redeemReward(input) / createReferralCode(input)Permissions
offers:resolveUse configured reward and referral programs; referral-code creation also requires offers:resolve.
Returns Reward / referral code
setBillingCoupons(input)Permissions
billing:writeReplace the ordered coupon list for future collections on a confirmed authorization. An empty list removes attachments. Retain requestId for retries; changes wait for an active collection.
Returns BillingCoupons
claimRewardProduct(input)Permissions
offers:resolvePass accepted: true after reviewing the reward and renewal terms. Retain redemptionId and requestId for retries. New subscriptions return type: checkout. Matching paid subscriptions return type: subscription and the discount operation status, retaining their native subscription and existing discounts.
Returns RewardProductCheckout
formatCouponTerms / formatCouponDiscount / formatCouponMoneyFormat the authoritative coupon terms returned by the server; labels do not determine eligibility or actual charges.
Returns string