Creating a payment out

To initiate a payment out, it is necessary to interact with the Create Payment endpoint.

❗️

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.

Below are the details required for the create payment request:

ParameterTypeRequiredDescription
merchantIdstringYesYour 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.
amountlongYesThe total amount to be sent in the payment out.
expiryMinutesintegerNoThe time frame allowed for the end-user to claim their payout. Defaults to 1440 minutes if unspecified.
currencystringYesThe currency code to be displayed to the end-user.
returnUrlstringNoA URL to redirect the user back to the merchant's site during the payment flow.
referencestringYesA reference for both you and your customer regarding the payment. This can be any identifier you choose.
typestringYesSpecifies the transaction type. Use OUT for creating a Pay OUT.

Example Request

Below is an example of how to 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": "OUT"
}

Example Response

Upon successfully submitting the request, you will receive a response similar to 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": "OUT",
  "subType": "merchantPayOut",
  "status": "PENDING",
  "displayCurrency": {
      "currency": "USD",
      "amount": 100,
      "actual": 0
  },
  "walletCurrency": {
    "currency": "EUR",
    "amount": 96,
    "actual": 0
  },
  "paidCurrency": {
    "currency": null,
    "amount": 0,
    "actual": 0
  },
  "feeCurrency": {
    "currency": "EUR",
    "amount": 1,
    "actual": 0
  },
  "displayRate": null,
  "exchangeRate": null,
  "address": null,
  "returnUrl": "https://yourwebsitename.com",
  "redirectUrl": "https://pay.sandbox.bvnk.com/payout?uuid=c9d5d40c-39f3-4bfc-a668-ca1eacdc7cc9",
  "transactions": [],
  "refund": null,
  "refunds": []
}

At this juncture, the uuid and redirectUrl values are critical.
The uuid is used for querying the payment status, and the redirectUrl is utilized in the subsequent step to guide the end-user to the crypto selection page on the BVNK Hosted Payments Page.

It's important to note that exchange rates and paid currency values will be null at this stage since the payment currency has not been established.