Creating a channel
When creating a channel, you'll be using the Create channel endpoint on the API.
curl --request POST \
--url https://api.sandbox.bvnk.com/api/v2/channel \
--header 'Accept: application/json' \
--header 'Authorization: Hawk id="B9jnE1U8eLblzHtNeJZRxfcq03CQKcmcP9FOrACMzXb1HfrxrePWsTfuP70JNns9", ts="1633010032", nonce="guGXrD", mac="uKeg+w1qXqzaF/8mOQGv8Y9IlRxyxTT+iINLe03EQ60="' \
--header 'Content-Type: application/json' \
--data '
{
"payCurrency": "ETH",
"displayCurrency": "EUR",
"merchantId": "123456789",
"reference": "customer1topup"
}
'
Let's go through the details you'll need to send in the creation request:
Parameter | Type | Description |
---|---|---|
payCurrency | string | The currency code that defines the crypto currency of the wallet. |
displayCurrency | string | The currency code that defines what currency to display pricing in. |
merchantId | string | Your Merchant ID. You can find it on the Merchant Details page in your account. See this guide for creating one |
reference | string | A unique reference you will display to the end-user, and will title the channel. |
After submitting the creation request you'll receive the following response:
{
"id": 65,
"dateCreated": 1631619193321,
"lastUpdated": 1631619193321,
"merchantId": "0a12a214-1619-43fa-9be1-0029f6a440a0",
"walletCurrency": "EUR",
"displayCurrency": "JPY",
"payCurrency": "ETH",
"address": "0xb4e8bb9918248007dc9d0dc12ae1142f0d62ef0e",
"tag": null,
"reference": "c1b933d5-3354-4f83-a05f-0b53f1be85f2",
"status": "OPEN",
"uuid": "9d1f67f2-a647-404b-9b02-247c77be81d0",
"redirectUrl": "https://pay.sandbox.bvnk.com/channel?uuid=9d1f67f2-a647-404b-9b02-247c77be81d0",
"uri": "ethereum:0xb4e8bb9918248007dc9d0dc12ae1142f0d62ef0e",
"alternatives": null
}
This includes an address
variable that you can give to your end-user and a redirectUrl
where you can send the user each time they log on to your platform and request to make a top-up.
It's recommended you always send your user to the
redirectUrl
when they want to top up, rather than just showing them the address to send funds to, as they can then find a simple screen to scan a QR code from within their wallet (ensuring no incorrect addresses are inserted) and they can also see the exchange rate they will get from the transaction.
Updated about 2 years ago