💸Crypto Payouts

Send crypto from Lazerpay to an external wallet using our APIs

Introduction

The amount collected in your Lazerpay account from all the incoming transactions can be withdrawn to an external supported crypto wallet. In order to make crypto payouts, you can use our payouts API endpoint or our official Node JS SDK

Crypto Transfer API

POST https://api.lazerpay.engineering/api/v1/crypto/payouts/initiate

Headers

NameTypeDescription

Authorization*

String

Bearer YOUR_SECRET_KEY

Request Body

NameTypeDescription

amount*

String | Number

The amount you want to send out

recipient*

String

Wallet address of the recipient

coin*

String

Crypto you want to transfer

blockchain*

String

The blockchain network you are sending to

metadata

Object

Stringified JSON object of custom data. eg {type: "Crypto transfer"}

reference

String

Unique case sensitive transaction reference. If you do not pass this parameter, Lazerpay will generate a unique reference for you.

{
    "message": "Crypto transfer initiated successfully",
    "status": "success",
    "statusCode": 200
}

// Example Body

{
  "reference": "<string optional>",
  "amount": 100,
  "recipient": "0x2455eC6700092991Ce0782365A89d5Cd89c8Fa22",
  "coin": "USDT",
  "blockchain": "Binance Smart Chain",
  "metadata": "<object optional>"
}

Important things to note

  • The Blockchain field must be "Binance Smart Chain".

  • The coin field must either be "BUSD", "DAI", "USDT", or "USDC".

We only support the Binance Smart Chain for withdrawals at the moment. We will add more networks in the future.

From Official JS SDK

With the JS SDK, you can transfer the crypto in your Lazerpay balance to an external address.

See sample code below:

const Lazerpay = require('lazerpay-node-sdk');

const lazerpay = new Lazerpay(LAZER_PUBLIC_KEY, LAZER_SECRET_KEY);

const crypto_payout_tx = async () => {
  const transaction_payload = {
    amount: 100,
    recipient: '0x0B4d358D349809037003F96A3593ff9015E89efA', // address must be a bep20 address
    coin: 'BUSD',
    blockchain: 'Binance Smart Chain',
  };
  try {
    const response = await lazer.Payout.transferCrypto(transaction_payload);
    console.log(response.error);
  } catch (e) {
    console.log(e);
  }
};

Last updated