πŸ”—iFrame Initialization

Required Parameters

  • apiKey: Your publishable API key for customer and transaction assignment (also known as the public key).

  • signature: Your HMAC-SHA256 signature of the full query string, base64-encoded. The signature must be the final parameter in the query string. See Server-Side URL Signature for implementation details.

  • currencyCode: The cryptocurrency code for purchase (e.g., BTC, ETH, BCH). See the documentation for all optionsarrow-up-right. When multiple wallet addresses are provided, this serves as the default cryptocurrency.

  • walletAddress: The destination wallet address for the purchased cryptocurrency.

    • Single address: walletAddress=ltc1q2k0xaafhgt3s8qw03wmajjmlc8gcepdy0un0ah

    • Multiple currencies: To accept multiple cryptocurrencies, use the format SYMBOL:address with comma separation, e.g. walletAddress=BTC:yourBitcoinAddress,LTC:yourLitecoinAddress,DOGE:yourDogecoinAddress

Optional Parameters

  • method: Specifies a payment method on load. Value is the payment_group mentioned herearrow-up-right (e.g., method=creditcard).

  • baseCurrencyCode: The fiat currency code for transactions (e.g., USD, EUR, GBP). Supported currenciesarrow-up-right.

  • lockBaseCurrency: True|False Locks currency selection to the specified baseCurrencyCode. Prevents users from selecting other currencies and removes payment methods that don't support the specified currency.

  • baseCurrencyAmount: The fiat amount to spend. Maximum 2 decimal places and cannot be zero. Requires baseCurrencyCode to be set.

  • quoteCurrencyAmount: The cryptocurrency amount to purchase. Maximum 6 decimal places with a minimum equivalent of 7 EUR or 8 USD.

  • email: Pre-fills the customer's email address on the login page.

  • externalCustomerId: Your unique identifier for the customer.

  • redirectUrl: URL for redirection after purchase completion. Must be URL-encoded.

    • Without variables: redirectUrl=https%3A%2F%2Fwebhook.site%2FSwapped

    • With dynamic variables: redirectUrl=https%3A%2F%2Fwebhook.site%2FSwapped%3ForderId%3D%7BorderId%7D%26orderStatus%3D%7BorderStatus%7D

  • responseUrl: Webhook URL for order notifications. Must be URL-encoded.

  • customerKYC: The customer's Know Your Customer (KYC) verification level:

    • 0: No KYC completed

    • 1: Proof of ID + Liveness Check

    • 2: Proof of ID + Liveness Check + Proof of Address

  • destinationTag: Adds a numeric destination tag or text memo for recipient identification or transaction context.

  • coverFees: True|False Sets processing and handling fees to zero for the customer. Fees are instead included in the spread.

  • minAmount: Minimum order amount in EUR. Cannot be lower than 7 EUR.

  • lockAmount: True|False Locks the fiat and crypto amount fields, preventing user modification.

  • baseCountry: ISO country code for the user's location. Determines available payment methods.

  • markup: Order markup percentage between 0 and 5. A default global markup can be configured herearrow-up-right.

  • submerchant: Submerchant identifier for multi-tenant setups

Server-Side URL Signature

Generate a signature to prevent URL tampering. The signature is created using the query string (including the ?) and your secret key.

Example iFrame URL

Note: this is a test key, your key will be different.

https://widget.swapped.com/?apiKey=pk_live_3e4c36240c0f46880e543b04e721dbee&walletaddress=ltc1q2k0xaafhgt3s8qw03wmajjmlc8gcepdy0un0ah&signature=okYOG6%2FzzQBmkEchBU4XUTYrMWGAPROVC46skuf2hl8%3Darrow-up-right

Example iFrame

The iFrame has been optimized for height: 400; width: 482;.

Last updated