Get settlement
curl --request GET \
--url https://api-sandbox.sohopay.xyz/v1/settlements/{settlement_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-sandbox.sohopay.xyz/v1/settlements/{settlement_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-sandbox.sohopay.xyz/v1/settlements/{settlement_id}', 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-sandbox.sohopay.xyz/v1/settlements/{settlement_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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-sandbox.sohopay.xyz/v1/settlements/{settlement_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.sohopay.xyz/v1/settlements/{settlement_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.sohopay.xyz/v1/settlements/{settlement_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"settlement_id": "stl_1a2b3c4d",
"payment_id": "pay_5c4b3a29",
"merchant_id": "mch_3f2a1b0c",
"agent_id": "agt_7d1e5b2f",
"gross_amount": "25.00",
"operator_fee": "1.25",
"fee_breakdown": {
"lp_yield": "0.75",
"protocol": "0.50"
},
"status": "completed",
"tx_hash": "0x4d5e...9a0b",
"block_number": 18234567,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}Settlements
Get settlement
GET
/
settlements
/
{settlement_id}
Get settlement
curl --request GET \
--url https://api-sandbox.sohopay.xyz/v1/settlements/{settlement_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-sandbox.sohopay.xyz/v1/settlements/{settlement_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api-sandbox.sohopay.xyz/v1/settlements/{settlement_id}', 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-sandbox.sohopay.xyz/v1/settlements/{settlement_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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-sandbox.sohopay.xyz/v1/settlements/{settlement_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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-sandbox.sohopay.xyz/v1/settlements/{settlement_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.sohopay.xyz/v1/settlements/{settlement_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"settlement_id": "stl_1a2b3c4d",
"payment_id": "pay_5c4b3a29",
"merchant_id": "mch_3f2a1b0c",
"agent_id": "agt_7d1e5b2f",
"gross_amount": "25.00",
"operator_fee": "1.25",
"fee_breakdown": {
"lp_yield": "0.75",
"protocol": "0.50"
},
"status": "completed",
"tx_hash": "0x4d5e...9a0b",
"block_number": 18234567,
"created_at": "2023-11-07T05:31:56Z"
}{
"error": {
"code": "INSUFFICIENT_CREDIT",
"message": "Agent agt_7d1e5b2f has 12.50 USDC available; order requires 25.00 USDC.",
"request_id": "req_01j8x9y2z3"
}
}Authorizations
API key as Bearer token. Sandbox keys start with sk_test_, mainnet keys with sk_live_.
Path Parameters
Response
Settlement with fee breakdown
Example:
"stl_1a2b3c4d"
Example:
"pay_5c4b3a29"
Example:
"mch_3f2a1b0c"
Example:
"agt_7d1e5b2f"
Amount the merchant receives (paid in full)
Example:
"25.00"
5% fee charged to the operator's credit line
Example:
"1.25"
Show child attributes
Show child attributes
Available options:
initiated, completed, failed Example:
"completed"
Example:
"0x4d5e...9a0b"
Example:
18234567
⌘I

