Skip to content
Indiana
Dashboard
Docs
Browse docs / Browser client

Browser client

Current holdings, ledger, quotes and offers; business actions use Funnel.

SDK 0.0.1Updated

Browser SDK

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 })

    Permissionsbilling:write

    Create a standalone card setup, without a subscription, entitlement or usage billing consent.

    Returns { setup }

  • readPaymentSetup({ setupId })

    Permissionsbilling:read

    Verify the actual provider result of the original setup without duplicate charges.

    Returns { setup }

  • readBillingInvoice({ invoiceId, after, limit })

    Permissionsbilling:read

    Page through all verified invoice items with nextCursor, without charging.

    Returns { detail }

  • readCreditStatement({ from, to, entityId?, snapshotAt, after, limit })

    Permissionscredits:read

    Up 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 })

    Permissionsbilling:read

    Fix a plan or seat quote for an explicit membership while retaining sibling plans in the subscription.

    Returns { quote }

  • update({ operationId })

    Permissionsbilling:write

    Confirm the fixed quote and recover its original charge attempt; verified payment determines fulfillment.

    Returns { operation }

  • readSubscriptionUpdate({ operationId })

    Permissionsbilling:read

    Read the update status; pending payment, scheduled and effective results retain the original operation identity.

    Returns { operation }

  • previewAttach({ entityId?, requestId, plans, provider, currency, offerId? })

    Permissionsbilling:read

    Save a 15-minute quote with the identified customer session. Omit customerId; preview initiates no payment or paid grant.

    Returns { quote }

  • attach({ operationId })

    Permissionsbilling:write

    Execute 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? })

    Permissionsbilling:write

    Recover a store-verified purchase under the identified customer session.

    Returns { restore }

  • readSubscriptionOperation({ operationId })

    Permissionsbilling:read

    Recover the original order status and verified delivery without initiating a new charge.

    Returns { operation }

  • setBillingCoupons({ authorizationId, requestId, grantIds })

    Permissionsbilling:write

    Set 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 })

    Permissionsbilling:write

    Call only after the customer reviews and accepts the fixed additional invoice; loading or automatic retry does not imply consent.

    Returns { invoice }

  • readBillingControls(input?)

    Permissionsbilling:read

    Read the verified customer's authorizations, limits, usage windows and automatic top-up state.

    Returns { controls }

  • prepareBillingAuthorization(input)

    Permissionsbilling:write

    Retain requestId to prepare fixed version and limit terms; preparation is not customer consent.

    Returns { prepared }

  • confirmBillingAuthorization({ authorizationId, accepted: true })

    Permissionsbilling:write

    Call after explicit customer consent; the server rechecks the current authorization and provider setup.

    Returns { authorization }

  • revokeBillingAuthorization({ authorizationId, requestId })

    Permissionsbilling:write

    Revoke the current customer's authorization; retries retain the request UUID.

    Returns { authorization }

  • listBillingInvoices({ after, limit }?)

    Permissionsbilling:read

    Read usage invoices for the current customer; page with nextCursor and a maximum limit of 100.

    Returns { invoices }

  • readBillingControls(input) / listBillingInvoices({ after, limit })

    Permissionsbilling:read

    Read 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 })

    Permissionsbilling:write

    Prepare 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? })

    Permissionsentitlements:read

    Later 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()

    Permissionsentitlements:read

    Read memberships and balances for the authenticated customer; no customerId is accepted.

    Returns { holdings }

  • readLedger(query)

    Permissionscredits:read

    Page the authenticated customer's full history; cursors retain entry type and precise timestamp.

    Returns { ledger }

  • quoteBalance(command)

    Permissionscredits:read

    Supply operation: quote, entitlementId, decimal quantity and properties. Quotes do not consume funds.

    Returns { quote }

  • listOffers()

    Permissionsoffers:resolve

    Read the current customer's available offers. Claims and purchases execute through published Funnel nodes.

    Returns Offer[]

  • redeemCoupon(code, requestId)

    Permissionsoffers:resolve

    Redeem a code in the current scope; retain requestId for retries after lost responses.

    Returns { offer, reason }

  • redeemReward(input) / createReferralCode(input)

    Permissionsoffers:resolve

    Use configured reward and referral programs; referral-code creation also requires offers:resolve.

    Returns Reward / referral code

  • setBillingCoupons(input)

    Permissionsbilling:write

    Replace 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)

    Permissionsoffers:resolve

    Pass 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 / formatCouponMoney

    Format the authoritative coupon terms returned by the server; labels do not determine eligibility or actual charges.

    Returns string