Create a Payout with Payment Out Details
To initiate a payment out, utilize the Create Payment endpoint with type of OUT
and the addition of payOutDetails
.
When using payOutDetails, the address is validated, ensuring the payment would not be created with an invalid address.
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 | The field for the crypto address that funds will be sent to. |
payoutDetails.currency | string | No | The field for specifying the payout currency. |
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 XRP 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",
"payOutDetails": {
"code": "crypto",
"currency": "USDT",
"protocol": "ERC20",
"address": "0x84A4a239805d06c685219801B82BEA7c76702214",
"tag": ""
}
}'
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": "USDT",
"amount": 50,
"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.
The uuid
provided can be used at any point to query the status of the payment. A series of webhook notifications will be dispatched to allow you to update your system accordingly.
Updated 3 months ago