Skip to main content

Web integration

Integration provides flexibility to end user at the same time allowing the integration to be customized by merchant.

Base Urlhttps://pay.sandbox.zoksh.com
End point/ramps
Request methodGET

Common Usecases

  1. Mobile/web wallets providing user the facility to buy crypto where address and token to buy is decided by the end user.

Static config

A common JSON configuration showing all possible fiat/crypto/providers combinations is available at Mappings

Request Params

  1. apiKey - Required Merchant code, available in your dashboard, Please use keys as shown in Account setup
  2. cryptos - Optional. Comma separated values of crypto config you want to show to user instead of all possible options.
  3. networks - Optional. Comma separated values of blockchain networks config to show to user.
  4. wallets - Optional. URI encoded JSON object of wallets for different networks
  5. prefill_name - Optional. prefill the form with provided name
  6. prefill_email - Optional. prefill the form with provided email

Example URL generation in Javascript

Ramp url generation with options
const rampUrl = 'https://pay.sandbox.zoksh.com/ramps';
// REQUIRED api key available in your merchant dashboard
const apiKey = '63a003db4b7c475b2fb782e6';

const cryptos = ['ETH','BTC'];
const networks = ['ethereum', 'bitcoin'];
const wallets = {
ethereum: '0xf2ccabfb643a44d9c7b775a60b2c26dce9895fed655f********************',
bitcoin: 'bc1qxy2kgdygjrsqtzq2n0yrf****************'
}
const name = 'Demo user';
const email = 'demo@demo.com';

const urlToOpen = new URL(rampUrl);
const params = new URLSearchParams();
// REQUIRED
params.append('apiKey', apiKey);

// OPTIONAL
params.append('cryptos', encodeURIComponent(cryptos.join(',')));
params.append('networks', encodeURIComponent(networks.join(',')));
params.append('wallets', encodeURIComponent(JSON.stringify(wallets)));
params.append('prefill_name', encodeURIComponent(name));
params.append('prefill_email', encodeURIComponent(email));

const url = `${urlToOpen}?${params.toString()}`;
// REDIRECT user to url
window.location.href = url;

You may choose to open the above generated URL in an iframe as well, but please note if the browser doesn't support third-party cookies, some of the functionality may not be available inside an iframe.