OfferDetail.type tells you which checkout the offer needs: 'coinlist::token_sale', 'superstate::swap', 'ondo::swap', or 'centrifuge::vault'. Switch on it exhaustively, or hand the offer to CheckoutContainer and let the SDK dispatch. v0.13.0 added 'centrifuge::vault', so an exhaustive switch written for an earlier version needs a new case - see the changelog.Prerequisites
- Completed OAuth and a working
PassageProvider - An offer id from Fetch offers (for example
offer.idfromOffersGridContaineronOfferClick)
Recommended: useOfferDetails
The hook mirrors the SDK client methodpassage.offers.get: it waits until the provider is ready, then loads details and exposes offerDetailsState:
LOADING- provider not ready or request in flight. Withenabled: falseand nodata, the hook also staysLOADING: it has noDISABLEDstate. A seeded or already-fetchedCONTENTsurvivesenabled: false.ERROR-reasonisnot-authenticatedwhen no CoinList user is signed in (NotAuthenticatedError), which includes a wallet session, andgeneric-errorfor any other failureCONTENT-offerDetailis theOfferDetail
data with an OfferDetail your server fetched with passage.offers.get(id) on PassageServer, and the hook uses it as-is and sends no request. With no user session, the server can fetch it with an app-level token instead: passage.offers.get(id, await passage.auth.clientCredentials()). Load it this way on a wallet session, a sign-in with a wallet for a user with no CoinList account, because useOfferDetails and passage.offers.get in the browser need a CoinList user. The hook has no refetch().
When the user picks an offer from the grid, keep that offer in React state and pass offer.id - TypeScript then matches the branded id type the hook expects.
Offer options
offerDetail.options lists the options of the offer. Each option has its own requirements and its own minimum purchase (minimumPurchaseUsd), so show the user the option they will buy.
When the user picks an option, pass its id to CheckoutContainer as optionId. optionId is required for every offer type, even an offer with one option: the SDK never picks one for you. If your page selects an option automatically, pick it yourself and pass its id. The Ondo checkouts and the Centrifuge deposit checkout send that id with the order, so the API runs that option’s requirements. An Ondo buy and a Centrifuge deposit also check the amount against that option’s minimum; an Ondo sell has no minimum. For an id the offer does not show, they show “Option not available” (unknown-option) and send no request. The token sale buys that option, at its price and minimum, and shows “Sale option not found” (unknown-option) for an id the offer does not show. The Superstate swap and a Centrifuge redemption ignore optionId, but you still pass it. The checkout reads optionId once, at mount: to switch options, remount it with a key that covers the option.
REST: GET /v1/offers/
Use the API directly when you are not in React or you need a one-off server fetch with a token you already hold.Example: fetch with Bearer token
Example: fetch with Bearer token
Display the full terms and link to the sale agreement URL as provided - do not summarize or paraphrase legal terms.
Lower-level client
passage.offers.get in React
passage.offers.get in React
Equivalent to the hook, without the built-in state machine. Pass the same Prefer
offer.id you get from OffersGridContainer:useOfferDetails unless you need custom control flow.Next step
Requirements
Show the user what they must satisfy before they can participate.