(Optional) Creating a payment with payout address already known
To initiate a payment that automatically approves without requiring the end user to visit the payment page, utilize the Create Payment endpoint with the addition of payOutDetails
.
Executing API calls on behalf of your Merchant
Make sure to apply your EPM's
x-account-reference
in the API call headers. Otherwise, you'll be transacting on the EP account,
Here are the parameters you'll need to provide in the create payment request:
Parameter | Type | Required | Description |
---|---|---|---|
merchantId | string | Yes | Your Merchant ID, which indicates the wallet from which the funds will be drawn. This can be found on the Merchant Details page within your account. |
amount | long | Yes | The total amount to be sent in the payment out. |
expiryMinutes | integer | No | The time frame allowed for the end-user to claim their payout. Defaults to 1440 minutes if unspecified. |
currency | string | Yes | The currency code to be displayed to the end-user. |
returnUrl | string | No | A URL to redirect the user back to the merchant's site during the payment flow. |
reference | string | Yes | A reference for both you and your customer regarding the payment. This can be any identifier you choose. |
type | string | Yes | Specifies the transaction type. Use OUT for creating a Pay OUT. |
payoutDetails.address | string | No | An optional field for collecting the crypto address, eliminating the need for the user to enter it on a hosted page. |
payoutDetails.currency | string | No | An optional field for specifying the payout currency. Leave this out if you prefer the user to select the currency on the hosted page. |
payoutDetails.code | string | No | Set to crypto to indicate a cryptocurrency payout. |
payoutDetails.protocol | string | No | Required for multi-protocol currencies such as USDT, specifying protocols like ERC20 or TRC20 . |
payoutDetails.tag | string | No | Necessary for XRP transactions to ensure proper allocation of funds. Use 0 if the wallet does not have a tag. |
Example Request
Below is an example of how you might structure your request:
{
"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 successful submission, the following response will be received:
{
"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": "OUT",
"subType": "merchantPayOut",
"status": "PROCESSING",
"displayCurrency": {
"currency": "USD",
"amount": 50,
"actual": 0
},
"walletCurrency": {
"currency": "ETH",
"amount": 0.0176227,
"actual": 0.0176227
},
"paidCurrency": {
"currency": "ETH",
"amount": 0.0176227,
"actual": 0
},
"feeCurrency": {
"currency": "ETH",
"amount": 0.00017623,
"actual": 0
},
"displayRate": {
"base": "ETH",
"counter": "USD",
"rate": 2837.24968364666
},
"exchangeRate": {
"base": "ETH",
"counter": "ETH",
"rate": 1
},
"address": {
"address": "0x84A4a239805d06c685219801B82BEA7c76702214",
"tag": "",
"protocol": "ETH",
"uri": "ethereum:0x84A4a239805d06c685219801B82BEA7c76702214?value=1.76227E+16",
"alternatives": []
},
"returnUrl": "www.your-url-here.com",
"redirectUrl": "https://pay.sandbox.bvnk.com/payout?uuid=46a86ebc-c40b-464f-b017-00191be0f20c",
"transactions": [],
"refund": null,
"refunds": []
}
This response indicates that the payment has been automatically approved and is in a PROCESSING
state, thus bypassing the need for the end user to visit the Hosted Payments Page.
The uuid
provided can be used at any point to query the status of the payment. When using payOutDetails, the address is validated, ensuring the payment would not be created with an invalid address.
Updated 8 months ago