{
// Required params
client_key: string;
customer_external_id: string;
signature: string;
timestamp: number;
// Optional params
external_id: string;
external_data: Record<string, string>;
// See full list of currencies here:
// https://developers.munzen.io/api-overview/currencies-confirmations-and-limits#sandbox-limitations
pay_currency: 'BTC' | 'ETH' | 'BCH' | 'USDTERC20' | 'USDTTRC20' | 'LTC';
price_currency: 'EUR' | 'UAH' | 'USD';
// String representing float number, for example: 1000.5
price_amount: string;
// Theme is purely presentational parameter no used in signature generation
// It has 2 options, "dark" or "light" -
// choose what better suits for your application look & feel
theme: 'dark' | 'light';
};
const API_KEY = 'j6OOj3EPVLQh18IjxWZ1XhohgXx7TuM1eufrQ3lv';
const params = {
client_key: API_KEY,
customer_external_id: '[email protected]',
signature: 'a123b0f6728cca721a9db6a994a39ff19387c104f8c9a2b95beb1576e1fd8079',
timestamp: 1687778100,
// User will be asked to pay 100.5 EUR via ETH transfer
pay_currency: 'ETH',
price_currency: 'EUR',
price_amount: '100.5',
}
// Generating URL params
const widgetUrlParams = new URLSearchParams(params);
const queryString = widgetUrlParams.toString();
// Example usage with URL
const url = new URL('https://sandbox-payment-widget.munzen.io/channel');
url.search = queryString;
console.log(url.toString());
https://sandbox-payment-widget.munzen.io/channel?client_key=j6OOj3EPVLQh18IjxWZ1XhohgXx7TuM1eufrQ3lv&customer_external_id=johnny%40email.com&signature=a123b0f6728cca721a9db6a994a39ff19387c104f8c9a2b95beb1576e1fd8079×tamp=1687778100&pay_currency=ETH&price_currency=EUR&price_amount=100.5