Create swap
curl --request POST \
--url https://lightswap.me/api/partner/v1/swap \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quoteId": "pq_aaaaaaaaaaaaaaaaaaaaaaaa",
"destination": {
"address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
"memo": null
},
"notificationEmail": "optional@example.com"
}
'import requests
url = "https://lightswap.me/api/partner/v1/swap"
payload = {
"quoteId": "pq_aaaaaaaaaaaaaaaaaaaaaaaa",
"destination": {
"address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
"memo": None
},
"notificationEmail": "optional@example.com"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteId: 'pq_aaaaaaaaaaaaaaaaaaaaaaaa',
destination: {address: 'TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r', memo: null},
notificationEmail: 'optional@example.com'
})
};
fetch('https://lightswap.me/api/partner/v1/swap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://lightswap.me/api/partner/v1/swap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => 'pq_aaaaaaaaaaaaaaaaaaaaaaaa',
'destination' => [
'address' => 'TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r',
'memo' => null
],
'notificationEmail' => 'optional@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lightswap.me/api/partner/v1/swap"
payload := strings.NewReader("{\n \"quoteId\": \"pq_aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"destination\": {\n \"address\": \"TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r\",\n \"memo\": null\n },\n \"notificationEmail\": \"optional@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lightswap.me/api/partner/v1/swap")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"pq_aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"destination\": {\n \"address\": \"TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r\",\n \"memo\": null\n },\n \"notificationEmail\": \"optional@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lightswap.me/api/partner/v1/swap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"pq_aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"destination\": {\n \"address\": \"TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r\",\n \"memo\": null\n },\n \"notificationEmail\": \"optional@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "AB12CD34EF56",
"externalId": "order-123",
"status": "waiting_deposit",
"errorMessage": null,
"from": {
"decimals": 8,
"network": "bitcoin",
"token": "BTC",
"amount": "0.01"
},
"to": {
"decimals": 6,
"network": "tron",
"token": "USDT",
"estimatedAmount": "100"
},
"deposit": {
"address": "bc1qdeposit",
"memo": null,
"amount": "0.01",
"network": "bitcoin",
"token": "BTC",
"deadline": "2026-04-19T10:03:30.000Z"
},
"payout": {
"address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
"memo": null,
"network": "tron",
"token": "USDT",
"estimatedAmount": "100"
},
"quote": {
"id": "pq_aaaaaaaaaaaaaaaaaaaaaaaa",
"rate": "10000",
"estimatedTimeSeconds": 900
},
"createdAt": "2026-04-19T10:00:30.000Z",
"updatedAt": "2026-04-19T10:00:30.000Z",
"customerId": "u_123"
}{
"error": {
"code": "validation_error",
"message": "quoteId is invalid.",
"details": {}
},
"requestId": "req_123"
}{
"error": {
"code": "rate_limited",
"message": "Too many API requests. Please wait a moment and try again.",
"details": {}
},
"requestId": "req_123"
}API Reference
Swap
Create a swap from an accepted quote and return the deposit address, amount, status, and tracking identifiers.
POST
/
swap
Create swap
curl --request POST \
--url https://lightswap.me/api/partner/v1/swap \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"quoteId": "pq_aaaaaaaaaaaaaaaaaaaaaaaa",
"destination": {
"address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
"memo": null
},
"notificationEmail": "optional@example.com"
}
'import requests
url = "https://lightswap.me/api/partner/v1/swap"
payload = {
"quoteId": "pq_aaaaaaaaaaaaaaaaaaaaaaaa",
"destination": {
"address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
"memo": None
},
"notificationEmail": "optional@example.com"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
quoteId: 'pq_aaaaaaaaaaaaaaaaaaaaaaaa',
destination: {address: 'TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r', memo: null},
notificationEmail: 'optional@example.com'
})
};
fetch('https://lightswap.me/api/partner/v1/swap', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://lightswap.me/api/partner/v1/swap",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'quoteId' => 'pq_aaaaaaaaaaaaaaaaaaaaaaaa',
'destination' => [
'address' => 'TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r',
'memo' => null
],
'notificationEmail' => 'optional@example.com'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://lightswap.me/api/partner/v1/swap"
payload := strings.NewReader("{\n \"quoteId\": \"pq_aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"destination\": {\n \"address\": \"TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r\",\n \"memo\": null\n },\n \"notificationEmail\": \"optional@example.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://lightswap.me/api/partner/v1/swap")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"quoteId\": \"pq_aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"destination\": {\n \"address\": \"TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r\",\n \"memo\": null\n },\n \"notificationEmail\": \"optional@example.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://lightswap.me/api/partner/v1/swap")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"quoteId\": \"pq_aaaaaaaaaaaaaaaaaaaaaaaa\",\n \"destination\": {\n \"address\": \"TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r\",\n \"memo\": null\n },\n \"notificationEmail\": \"optional@example.com\"\n}"
response = http.request(request)
puts response.read_body{
"id": "AB12CD34EF56",
"externalId": "order-123",
"status": "waiting_deposit",
"errorMessage": null,
"from": {
"decimals": 8,
"network": "bitcoin",
"token": "BTC",
"amount": "0.01"
},
"to": {
"decimals": 6,
"network": "tron",
"token": "USDT",
"estimatedAmount": "100"
},
"deposit": {
"address": "bc1qdeposit",
"memo": null,
"amount": "0.01",
"network": "bitcoin",
"token": "BTC",
"deadline": "2026-04-19T10:03:30.000Z"
},
"payout": {
"address": "TNDzfERDpxLDS2w1q6yaFC7pzqaSQ3Bg3r",
"memo": null,
"network": "tron",
"token": "USDT",
"estimatedAmount": "100"
},
"quote": {
"id": "pq_aaaaaaaaaaaaaaaaaaaaaaaa",
"rate": "10000",
"estimatedTimeSeconds": 900
},
"createdAt": "2026-04-19T10:00:30.000Z",
"updatedAt": "2026-04-19T10:00:30.000Z",
"customerId": "u_123"
}{
"error": {
"code": "validation_error",
"message": "quoteId is invalid.",
"details": {}
},
"requestId": "req_123"
}{
"error": {
"code": "rate_limited",
"message": "Too many API requests. Please wait a moment and try again.",
"details": {}
},
"requestId": "req_123"
}Authorizations
API key. Keep this key on your backend.
Body
application/json
Response
Created swap.
Pattern:
^[A-Z0-9]{12}$Example:
"AB12CD34EF56"
Example:
"order-123"
Available options:
waiting_deposit, deposit_detected, underpaid, processing, completed, refunded, failed, expired Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
"u_123"
⌘I

