Hosted Redirect Operation
Last updated
Was this helpful?
Last updated
Was this helpful?
Wyreโs hosted redirect is a simple way to add fiat-to-crypto into your web or mobile application. Users can purchase using Apple Pay and debit card entry.
Query Parameter
Description
Value
dest
ethereum:0xYYYY
bitcoin:1xxxxx
destCurrency
Specifies the currency to present for purchase to the user. This is present when a transfer is initiated.
ETH
, BTC
, DAI
or USDC
sourceAmount
Currency amount to purchase.
destAmount
is no longer supported in the hosted widget checkout.
0.5 10.13 125
paymentMethod
The id of the payment method type youโd like the user to start off with. Generally you'll want to leave this blank. Wyre will determine what to display based on OS.
apple-pay
or debit-card (Only specific if you have a specific use case)
redirectUrl
A url that the user will be sent to when they select any close button.
The following data will be passed to the redirectUrl as url query parameters: transferId
, orderId
, accountId
, dest
, fees
, and destAmount
(iOS) myapp://
(Web) https://myapp.com/
accountId
Your Wyre Account ID. This associates accounts created inside the widget with you, though it does not give you access to their details
failureRedirectUrl
Url to get the user redirect in case order fails. You should handle error and display messages in your end when using this property.
Optional
After initiating a purchase, users will be taken to a processing view as the payment is being completed. This process takes on average 15-45 seconds. Once Wyre has initiated a blockchain transaction, the user will be taken to the Purchase Completed view which will display information about the completed transaction.
Here is an example URL that uses URL parameters to help improve UX:
Rather than relying on redirectUrl
for callbacks, this section covers how to receive wallet order webhook updates when Digital Wallet orders change status.
Parameter
Description
Required
referenceId
Your own internal reference id.
String, optional
accountId
Your Wyre account id.
String, required for the webhook to work.
Ask a Wyre team member to register your webhook URL by providing them your accountId
and the url
where you host the widget. This configuration is per environment.
The webhook will be called for any state change in orders which were submitted with an accountId
that has a webhook URL configured.
A Webhook response looks like this. ๐
Above is MetaMask's Wyre integration using the Hosted Redirect. A user opens their MetaMask wallet, clicks on "Deposit" and then selects "Continue to Wyre". Since MetaMask knows the address dest
they use they use a parameter to pass that information in on behalf of the user. When the user arrives at the Wyre widget they already have that information prefilled. You can use all or some of the parameters to create a better checkout experience for you user like MetaMask did.
Visiting starts the checkout. To help your users pay quicker, you can pass in some or all of the following query parameters which will auto-fill into the purchase form.
An which is where the funds will be sent after the completes