Get agent
curl --request GET \
--url https://api-sandbox.sohopay.xyz/v1/agents/{agent_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-sandbox.sohopay.xyz/v1/agents/{agent_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/agents/{agent_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/agents/{agent_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/agents/{agent_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/agents/{agent_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.sohopay.xyz/v1/agents/{agent_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{
"agent_id": "agt_7d1e5b2f",
"merchant_id": "mch_3f2a1b0c",
"name": "research-agent-01",
"wallet_address": "0x8ba1f109551bd432803012645ac136ddd64dba72",
"status": "active",
"credit_limit": "250.00",
"daily_limit": "50.00",
"outstanding_balance": "0.00",
"available_credit": "250.00",
"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"
}
}Agents
Get agent
GET
/
agents
/
{agent_id}
Get agent
curl --request GET \
--url https://api-sandbox.sohopay.xyz/v1/agents/{agent_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api-sandbox.sohopay.xyz/v1/agents/{agent_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/agents/{agent_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/agents/{agent_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/agents/{agent_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/agents/{agent_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.sohopay.xyz/v1/agents/{agent_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{
"agent_id": "agt_7d1e5b2f",
"merchant_id": "mch_3f2a1b0c",
"name": "research-agent-01",
"wallet_address": "0x8ba1f109551bd432803012645ac136ddd64dba72",
"status": "active",
"credit_limit": "250.00",
"daily_limit": "50.00",
"outstanding_balance": "0.00",
"available_credit": "250.00",
"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
Agent details
Example:
"agt_7d1e5b2f"
Example:
"mch_3f2a1b0c"
Example:
"research-agent-01"
Example:
"0x8ba1f109551bd432803012645ac136ddd64dba72"
Available options:
active, paused, revoked Example:
"active"
Example:
"250.00"
Example:
"50.00"
Example:
"0.00"
Example:
"250.00"
⌘I

