Create Swap

In order to initiate the process of bridging assets across blockchains, CEXes, and fiat, a Swap should be created. Swap has all the necessary information required to be able to process transfers from the source to the destination.

POST https://api.layerswap.io/api/swaps

Create swap

Headers

Name
Type
Description

X-LS-APIKEY*

String

API Key retrieved from Partner Setup

Content-Type*

application/json

Request Body

Name
Type
Description

destination*

String

The supported blockchain network name, where the funds should be sent by the user. See available values.

source*

String

The supported blockchain network name, where the funds should be sent by the user. See available values.

amount*

Number

The predefined amount. Note that this is NOT the final amount sent by the user since the user can specify another amount while transferring.

source_asset*

String

The swap currency name. See available assets.

destination_address*

String

The destination network address, where the user will receive the funds.

refuel*

Bool

If set to true, the user will receive an additional refuel transaction in the native currency to the specified destination_address.

reference_id

String

Partner specified ID that could be used for the future reference to retrieve the swap.

destination_asset

String

The swap currency name. See available assets.

{
  "data": {
    "swap_id": "28996c7d-ee95-4727-8efe-ba0006aa16d4"
    }
  "error": null
}

Raw request

Raw response

Last updated

Was this helpful?