(Optional) Creating a payment with pay-in currency already known
To streamline the process of redirecting end users directly to the payment address page for cryptocurrency transactions, utilize the Create Payment endpoint, incorporating payInDetails
.
Executing API calls on behalf of your Merchant
Always include your EPM's x-account-reference in the API call headers to ensure transactions are attributed to the correct merchant account, avoiding transactions on the EP account by mistake.
Below are the details required for the create payment request:
Parameter | Type | Required | Description |
---|---|---|---|
merchantId | string | Yes | Identifies the Merchant ID, indicating which wallet the payment should settle in. Found on the Merchant Details page. |
amount | long | Yes | The total amount needed to complete the payment. |
expiryMinutes | integer | No | Defines the time frame for the end-user to complete the payment. Defaults to 1440 minutes if not specified. |
currency | string | Yes | The currency code to present the price in to the end-user. |
returnUrl | string | No | The URL for redirecting the user back to the merchant's site from the payment flow. |
reference | string | Yes | A unique reference for the payment, visible to both you and your customer. |
type | string | Yes | Specifies the transaction type, using IN for incoming payments. |
payInDetails.currency | string | No | Optional to specify if you know the cryptocurrency the end-user will use, skipping the selection screen. Leave this out to offer currency choice. |
payInDetails.protocol | string | No | Required when payInDetails.currency is set and the currency supports multiple protocols, to specify the exact protocol. |
Example Request
Here is how an example request might look:
{
"merchantId": "00a4af9d-ad4b-42d5-bec4-b7a8c90161fe",
"amount": "100",
"expiryMinutes": "60",
"currency": "USD",
"returnUrl": "https://yourwebsitename.com",
"reference": "6a4013c2-5fa9-4e2f-bef7-88c5570b6501",
"type": "IN",
"payInDetails": {
"currency": "USDT",
"protocol": "TRC20"
},
}'
Example Response
Upon successfully submitting the request, you'll receive a response like the following:
{
"uuid": "fef4e99d-b41d-4efe-89fd-4fdf41f3f33f",
"merchantDisplayName": "Metallica Inc",
"merchantId": "00a4af9d-ad4b-42d5-bec4-b7a8c90161fe",
"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 uuid
for payment queries and the redirectURL
for directing the end-user to BVNK's Hosted Payments Page, bypassing the cryptocurrency selection screen if payInDetails.currency
is provided.
This setup ensures a tailored payment experience, directly linking to the specified payment address.
Updated 8 months ago