Get swap history for a customer
curl --request GET \
--url https://api.rach.finance/api/v1/swap/customer/{customerID}/history \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.rach.finance/api/v1/swap/customer/{customerID}/history"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.rach.finance/api/v1/swap/customer/{customerID}/history', 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://api.rach.finance/api/v1/swap/customer/{customerID}/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.rach.finance/api/v1/swap/customer/{customerID}/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.rach.finance/api/v1/swap/customer/{customerID}/history")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rach.finance/api/v1/swap/customer/{customerID}/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"limit": 123,
"page": 123,
"swaps": [
{
"amount_in": "1000000",
"amount_out": "997012",
"approve_tx_hash": "0xdef456...",
"confirmed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"customer_id": "user_abc123",
"error_msg": "<string>",
"from_chain": "POL",
"id": 42,
"platform_fee": "3000",
"status": "confirmed",
"swap_tx_hash": "0xabc123...",
"to_chain": "BSC",
"token_in": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
"token_out": "0x55d398326f99059fF775485246999027B3197955",
"type": "dex",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"total": 123
}Swap
Get swap history for a customer
Returns a paginated list of all swaps executed from this customer’s wallet, including status, token pairs, amounts, and transaction hashes.
GET
/
api
/
v1
/
swap
/
customer
/
{customerID}
/
history
Get swap history for a customer
curl --request GET \
--url https://api.rach.finance/api/v1/swap/customer/{customerID}/history \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.rach.finance/api/v1/swap/customer/{customerID}/history"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.rach.finance/api/v1/swap/customer/{customerID}/history', 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://api.rach.finance/api/v1/swap/customer/{customerID}/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.rach.finance/api/v1/swap/customer/{customerID}/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.rach.finance/api/v1/swap/customer/{customerID}/history")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.rach.finance/api/v1/swap/customer/{customerID}/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"limit": 123,
"page": 123,
"swaps": [
{
"amount_in": "1000000",
"amount_out": "997012",
"approve_tx_hash": "0xdef456...",
"confirmed_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"customer_id": "user_abc123",
"error_msg": "<string>",
"from_chain": "POL",
"id": 42,
"platform_fee": "3000",
"status": "confirmed",
"swap_tx_hash": "0xabc123...",
"to_chain": "BSC",
"token_in": "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
"token_out": "0x55d398326f99059fF775485246999027B3197955",
"type": "dex",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"total": 123
}Authorizations
Business API key for server-to-server integrations.
Key prefix determines the environment — no separate flag needed:
test_sk_* = sandbox/testnet, live_sk_* = production/mainnet.
Path Parameters
Your internal customer identifier
⌘I

