This reference targets protocol 0.5. See version information for SDK availability and HTTP examples.
Related:Versions and integration
Verify host login and issue the current customer's session on your backend. Browsers cannot choose an arbitrary customerId.
Current exports and methods
await indiana.features({ attributes? })Permissions
features:readLoad flags with the existing Customer or Guest session. isOn/getFeatureValue synchronously use local rules or the latest remote result, with a fallback while remote evaluation is pending. Attribute changes discard previous remote results; subscribe observes updates and destroy releases refresh listeners.
Returns FeatureClient
indiana.track(name, properties); await indiana.flush()Permissions
events:writeBatch by 100 events and request size, flushing periodically and when the page is hidden. Failures retain event IDs; identify/reset clears previous identity queues and flag results. The server fixes the Customer from the session; browsers cannot select another Customer. The unpublished 0.4 source candidate adds environment collection controls: enable the required categories in the selected environment's integration settings. Disabled collection is acknowledged as skipped and preserves history.
Returns { inserted, duplicates, rejected }
resolvePaywall({ selector, locale, commerce, requirement? })Permissions
entitlements:readResolve the independent Paywall, pinned Offering Version and current presentation capabilities without a Funnel or purchase.
Returns { paywall }
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:readQuote a plan, seat or cancellation change for a membership billed by a Stripe subscription; upgrades are immediate and prorated, downgrades take effect at the end of the cycle.
Returns { quote }
update({ operationId })Permissions
billing:writeConfirm the quote: Indiana execution runs it once in Stripe; record-only mode returns the Stripe instructions for the merchant.
Returns { operation }
readSubscriptionUpdate({ operationId })Permissions
billing:readRead the change status; a booked downgrade or cancellation is scheduled until it takes effect.
Returns { operation }
previewAttach({ entityId?, requestId, plans, provider, currency, offerId? })Permissions
billing:readSave a quote of up to 24 hours with the identified customer session and hold the selected offer. Omit customerId; preview initiates no payment. In record-only mode, quote.execution tells your backend how to create the Stripe Checkout Session with its own Stripe key.
Returns { quote }
attach({ operationId, intent? })Permissions
billing:writeExecute after explicit quote acceptance; intent cancel abandons the quote and releases its held offer. While pending, it returns checkoutUrl when Indiana executes Stripe, or the same execution in record-only mode; it becomes complete once verified Stripe notifications are recorded. 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({ membershipId, 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
resolveOffering({ selector, commerce, requirement? })Permissions
entitlements:readResolve a published Offering and Product availability for the verified current Customer. Browsers cannot override customerId. Preserve document.items and the returned Version; resolving does not purchase.
Returns { offering, candidates, availability, check }
checkEntitlement({ requirement, commerce?, paywallId? })Permissions
entitlements:readAvailable in npm 0.1.0 beta. With a matching server, 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, internal_feature_id, 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