💥Stablecoins Swap

Swap Stablecoins in your lazerpay account using our APIs

Introduction

You can make Stablecoins swaps from one coin to another directly from the Lazerpay dashboard or using our Swaps API endpoint

Crypto Swap API

POST https://api.lazerpay.engineering/api/v1/swap/crypto

Headers

NameTypeDescription

Authorization*

String

Bearer YOUR_SECRET_KEY

Request Body

NameTypeDescription

amount*

String | Number

The amount you want to send out

from_coin*

String

Crypto you want to swap from

blockchain*

String

The blockchain network you are sending to

to_coin*

String

Crypto you want to swap to

metadata

Object

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

reference

String|Num

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

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

Example cURL

curl --location --request POST 'https://api.lazerpay.engineering/api/v1/swap/crypto' \
--header 'Authorization: Bearer sk_test_hxDjjhMiDsVo16hZ0tuIL51PwoB98HGeqAoddUxQ0RaF7Q8kfK' \
--data-raw '{
    "from_coin": "USDT",
    "to_coin": "BUSD",
    "amount": 0.01,
    "blockchain": "Binance Smart Chain"
}'

Important things to note

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

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

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

  • Also to_coin and from_coin cannot be the same

we only support the Binance smart chain for swaps. we will add more networks in the future.

Last updated