Create pay-in
To initiate a payment process, send the POST /api/v1/pay/summary request with the following body parameters. Remember to add the mandatory payInDetails object to return the cryptocurrency address required for the deposit on the correct blockchain.
{
"merchantId": "01968c39-3a1d-71af-8a8e-9c3ef3db3237",
"amount": 100,
"expiryMinutes": 60,
"currency": "USD",
"returnUrl": "https://yourwebsitename.com",
"reference": "6a4013c2-5fa9-4e2f-bef7-88c5570b6501",
"type": "IN",
"payInDetails": {
"currency": "USDT",
"protocol": "TRC20"
}
}
Find your merchantId in the Merchant's Portal, in the Wallets section. currency can be any supported local currency, not only a cryptocurrency. If you omit expiryMinutes, the payment expires after 1440 minutes. Set payInDetails.protocol when the payInDetails.currency is available on multiple protocols.
Upon successfully submitting the request, you'll receive a response like the following:
Response
{
"uuid": "fef4e99d-b41d-4efe-89fd-4fdf41f3f33f",
"merchantDisplayName": "Metallica Inc",
"merchantId": "01968c39-3a1d-71af-8a8e-9c3ef3db3237",
"dateCreated": 1704807605678,
"expiryDate": 1704808805678,
"quoteExpiryDate": 1704808806000,
"acceptanceExpiryDate": 1704807636000,
"quoteStatus": "ACCEPTED",
"reference": "a003cec4-abf5-42aa-baf0-43a1cc815536",
"type": "IN",
"subType": "merchantPayIn",
"status": "PENDING",
"displayCurrency": {
"currency": "USD",
"amount": 100,
"actual": 0
},
"walletCurrency": {
"currency": "EUR",
"amount": 92.74,
"actual": 0
},
"paidCurrency": {
"currency": "USDT",
"amount": 99.935377,
"actual": 0
},
"feeCurrency": {
"currency": "EUR",
"amount": 0.93,
"actual": 0
},
"displayRate": {
"base": "USDT",
"counter": "USD",
"rate": 0.998867803322
},
"exchangeRate": {
"base": "USDT",
"counter": "EUR",
"rate": 0.92635
},
"address": {
"address": "TTwyxkKzenGBhVX2TsjYLVFfApEQ3hPXGc",
"tag": null,
"protocol": "TRC20",
"uri": "TTwyxkKzenGBhVX2TsjYLVFfApEQ3hPXGc",
"alternatives": []
},
"returnUrl": "https://yourwebsitename.com",
"redirectUrl": "https://pay.sandbox.bvnk.com/payin?uuid=fef4e99d-b41d-4efe-89fd-4fdf41f3f33f",
"transactions": [],
"refund": null,
"refunds": []
}
Key takeaways include the following:
address.addressis the address to be shown to the end user so that they can make a deposit.paidCurrency.amountis the total amount of the relevant currency that needs to be paid by the end user to complete the payment, and should be shown to the end user.uuidis used to query the payment as needed.
This setup ensures a tailored payment experience, directly linking to the specified payment address. All Exchange rates are provided given that the payment currency is known at the time the payment is created.
After creating the payment, your next action is to display these details to your end-user for them to complete their payment. Once shown, wait for the payment to fire off a number of webhooks to let you know it has occurred. See Receive pay-in notifications.