Skip to main content

Overview

@elata-biosciences/app-payments lets your app open Elata’s checkout and check what the user owns. Elata runs checkout, takes payment in USDC, and records ownership. Your app never touches wallets or payment details.
Your item catalog is set up by the Elata team. Contact us with the items, titles, and prices you want to sell.

The correct flow

Gate your UI on ownership first, then purchase, then apply the benefit.
requestPurchase records that the user owns an item. Your app decides what owning it does.

Things to know

If the user already owns the item, Elata skips payment and returns { status: "success", txHash: "" }. Code that checks if (result.txHash) will mishandle this.
CatalogItem.priceUsdc is in USDC base units (6 decimals): "50000" is $0.05. RequestPurchaseInput.priceUsdc is a free-form display hint Elata ignores. Elata always charges the catalog price.
Each item is bought once. Consumables (spend-per-use balances) and recurring billing aren’t supported through items. For recurring revenue use a subscription plan.
requestPurchase waits up to 5 minutes for the user to finish checkout. getCatalog, getOwnedItems, and hasItem default to 10 seconds. Outside Elata nothing answers, so handle timeout by showing items as available.

Errors

Calls reject only with AppPaymentsError, which has a code: A normal cancelled or error purchase outcome resolves; it doesn’t reject.

Security model

  • Your app can’t fake ownership. Ownership is recorded by Elata only after payment is verified.
  • Your app never sees payment details, wallet keys, or session tokens.
  • Repeating a request with the same requestId won’t charge twice.
  • Revenue from item sales is paid to the app owner’s wallet.

Try it