Layerswap API
API Explorer
  • Overview
  • Partner Setup
  • UI Integration
    • Layerswap-hosted page
    • Embedded form
    • Customization
      • Interactive Builder
  • API Integration
    • Quickstart
    • API Reference
    • Swap lifecycle
    • Webhooks
    • DEPRECATED - V1 API Reference
      • Get Available Networks
      • Get Available Routes
      • Get Swap Rate
      • Create Fast Swap
      • Create Swap
      • Prepare Source Transaction
      • Get Swap
  • Mixed Integration
    • Swap Link
  • Data
    • Object types
    • Supported Platforms
      • Supported Networks
      • Supported Fiat Providers
      • Supported CEXes
Powered by GitBook

Layerswap

  • App
  • Explorer
  • Twitter
  • Discord

© 2023 Bransfer, Inc. All rights reserved.

On this page
  • Starter Kit
  • Examples to get started

Was this helpful?

Export as PDF
  1. API Integration

Quickstart

Last updated 1 year ago

Was this helpful?

A simple integration workflow:

  • Get , and

  • using the Layerswap API

  • Layerswap will monitor the source network for a transaction and will try to match it with the corresponding swap

  • Once the transaction is matched and added to the swap, Layerswap will initiate a counterparty transaction to the destination_address

  • (Optionally) Poll via endpoint to see if the matching transaction Input was added to the swap

  • If the , Layerswap will deliver a swap status update notification to the partner-specified URL

Starter Kit

Postman Collection:

End-to-End Backend + Frontend Integration:

Swagger docs:

Examples to get started

Get Available Networks

curl -X 'GET' \
  'https://api.layerswap.io/api/available_networks' \
  -H 'accept: application/json'

Create Swap

curl --location 'https://api.layerswap.io/api/swap' \
--header 'X-LS-APIKEY: {YOUR_APP_APIKEY}' \
--header 'Content-Type: application/json' \
--data '{
    "source": "ETHEREUM_MAINNET",
    "destination": "IMX_MAINNET",
    "amount": 0.001,
    "asset": "ETH",
    "source_address": "0x690B9A9E9aa1C9dB991C7721a92d351Db4FaC990",
    "destination_address": "0xe688b84b23f322a994A53dbF8E15FA82CDB71127",
    "refuel": false,
    "reference_id": "1"
}'
supported sources/networks
available routes
swap fees
Create Swap
Get Swap
webhook is configured
https://github.com/layerswap/layerswap-sdk-starter-kit/blob/main/postman_collection.json
https://github.com/layerswap/layerswap-sdk-starter-kit/
https://api.layerswap.io/swagger
Page cover image