createCoinbaseOnrampOrder
Creates a Coinbase onramp order for purchasing cryptocurrency with fiat. This returns a payment link URL that you can display in an iframe within your app, providing an embedded purchase experience. This function is typically used with addCoinbaseOnrampOrderEventListener to track the order status in real-time.Usage
Parameters
Returns
Promise<CoinbaseOnrampOrderResponse> - A promise that resolves to the created order, including:
Prerequisites
This function requires the user to have verified email and phone number. Use getMissingVerificationForCoinbaseOnrampOrder to check verification status before creating an order.Complete Example
Here’s a full implementation showing how to create an order, display it in an iframe, and handle events:Related functions
- addCoinbaseOnrampOrderEventListener - Listen for order events (required for embedded flow)
- getMissingVerificationForCoinbaseOnrampOrder - Check verification requirements
- getCoinbaseBuyUrl - Simpler redirect-based flow (no event tracking)