Example of a custom UI cashier
When presenting the cashier to end users, you have the option to provide a list of cryptocurrency options directly from within your own UI. Within this document we will provide information on how to get the list of supported currencies, how to submit the user selected currency to BVNK’s endpoints, and displaying the returned address or redirecting to BVNK’s Hosted Payments Page (HPP).
Deposits
Payment Links
Step 1: Get the list of available cryptocurrencies
To get a list of available cryptocurrencies BVNK supports, check this page.
Step 2: Show the cryptocurrency list to the user
Within the cashier, you will need to display each cryptocurrency you would like to offer to the user. You could ask the user to also select the protocol.
Step 3: Initiate the Payments API including the selected currency
The below (Example 1) is if you are collecting currency only from the user. Once the payment is initiated, in the response you will get the redirectUrl which is the link to the BVNK HPP, or the crypto address that matches the input currency. You would need to redirect the user to this URL to complete the payment. If there are multiple currencies, the end user can select the one they want on the BVNK HPP. If you want to return the address to the end user, the alternative protocols are listed under alternatives
Example 1 - Initiating the payment including USDT currency only
REQUEST
{
"merchantId": "86955f40-8f4e-464c-be2b-583635bf1c62",
"type": "IN",
"amount": 50,
"currency": "USD",
"reference": "test_reference_in_InyaIp",
"returnUrl": "https://www.your-url-here.com/status",
"payInDetails": {
"currency": "USDT",
}
}
The below (Example 2) is also an example if you are collecting both currency and protocol. Once the payment is initiated in the response you will get the redirectUrl which is the link to the BVNK HPP. You can redirect the user to complete the payment. Since you have both currency and protocol, you also have the option to create a fully customised payment flow using the returned address, instead of redirecting.
Example 2 - Initiating the payment including USDT currency and ERC20 protocol
REQUEST
{
"merchantId": "86955f40-8f4e-464c-be2b-583635bf1c62",
"type": "IN",
"amount": 50,
"currency": "USD",
"reference": "test_reference_in_InyaIp",
"returnUrl": "https://www.your-url-here.com/status",
"payInDetails": {
"currency": "USDT",
"protocol": "ERC20"
}
}
Payment Channels
Step 1: Get the list of available cryptocurrencies
To get a list of available cryptocurrencies BVNK supports, check this page.
Step 2: Initiate the create channel API and specify the currency
When a permanent payment channel is created, by default if a cryptocurrency has multiple protocols, BVNK will respond back with a wallet address for each. You will need to display the correct address according to the end user’s choice. Below (Example 3) is an example with a cryptocurrency that supports multiple protocols.
Example 3 - Initiating channel including USDC currency and getting multi-protocol addresses in the response
REQUEST
{
"merchantId": "7fa95319-b854-402c-bbfb-5d9dfe9122b4",
"payCurrency": "USDC",
"displayCurrency": "EUR",
"reference": "PayRef-User1234-USDC"
}
RESPONSE
{
"id": 51376,
"dateCreated": 1720458182110,
"lastUpdated": 1720458182110,
"merchantId": "7fa95319-b854-402c-bbfb-5d9dfe9122b4",
"walletCurrency": "USDT",
"displayCurrency": "EUR",
"payCurrency": "USDC",
"address": "0xfe7D11AaF7d73Bf3052f4Eb2Ac0BE863fb90C488",
"tag": null,
"protocol": "POLYGON",
"reference": "PayRef-User1234-USDC",
"status": "OPEN",
"uuid": "802cf09f-3321-4483-ad90-640ffd5645a2",
"redirectUrl": "https://pay.sandbox.bvnk.com/channel?uuid=802cf09f-3321-4483-ad90-640ffd5645a2",
"uri": "0xfe7D11AaF7d73Bf3052f4Eb2Ac0BE863fb90C488",
"alternatives": [
{
"protocol": "BEP20",
"address": "0x13736c5ecad88c57e7aab5dacc75ab4136f08d87",
"tag": null,
"uri": "0x13736c5ecad88c57e7aab5dacc75ab4136f08d87"
}
]
}
So if the user selected to make a payment with USDC using BEP20 protocol, then you would need to either redirect them to the BVNK HPP or just show them the correct wallet address from the alternatives field within your custom payment screens.
Payouts
If you are giving the option for users to collect the cryptocurrency from your own cashier, then when you need to move funds and payout the user you should initiate the payment including the amount, wallet, currency, protocol and/or tag (where applicable).
Step 1: Get the list of available cryptocurrencies
To get a list of available cryptocurrencies BVNK supports, check this page.
Step 2: Initiate the payout including the currency, protocol and matching address
In the below example (Example 4), the payout is initiated by giving the cryptocurrency used, the supported protocol for that address, and the matching address for that blockchain. Once this is submitted and passes validation. The payout is complete and no further redirection needs to take place.
Example 4 - Initiating the payout with USDC currency, BEP20 protocol, and BSC address
REQUEST
{
"merchantId": "86955f40-8f4e-464c-be2b-583635bf1c62",
"type": "OUT",
"amount": 100,
"currency": "USD",
"reference": "test_reference_out_L96kcY",
"returnUrl": "https://www.your-url-here.com/status",
"payOutDetails": {
"code": "crypto",
"currency": "USDC",
"protocol": BEP20,
"address": "0x13736c5ecad88c57e7aab5dacc75ab4136f08d87",
"tag": null
}
}