Get a seller's usage
curl --request GET \
--url https://testnet.rail402.dev/discovery/sellers/{payTo}/usageimport requests
url = "https://testnet.rail402.dev/discovery/sellers/{payTo}/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://testnet.rail402.dev/discovery/sellers/{payTo}/usage', 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://testnet.rail402.dev/discovery/sellers/{payTo}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://testnet.rail402.dev/discovery/sellers/{payTo}/usage"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://testnet.rail402.dev/discovery/sellers/{payTo}/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.rail402.dev/discovery/sellers/{payTo}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"payTo": "<string>",
"totals": {
"payments": 123,
"payers": 123
},
"listings": [
{
"listing": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "http",
"resource": "<string>",
"payTo": "<string>",
"scheme": "<string>",
"amount": "<string>",
"asset": "<string>",
"network": "<string>",
"lastUpdated": "2023-11-07T05:31:56Z",
"method": "<string>",
"toolName": "<string>",
"description": "<string>",
"serviceName": "<string>"
},
"payments": 123,
"payers": 123,
"lastObservedAt": "2023-11-07T05:31:56Z"
}
],
"truncated": true
}{
"error": {
"code": "discovery_invalid_parameter",
"reason": "Unsupported parameter: foo.",
"retryable": false
}
}{
"error": {
"code": "<string>",
"reason": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "discovery_overloaded",
"reason": "Discovery is at capacity; retry after the Retry-After interval.",
"retryable": true
}
}Discovery
Get a seller's usage
How a seller’s listings published on network were paid for: totals over all of them, and up to
100 listings, most recently paid first. Only settlements that paid the seller count. Listings that
are pending, quarantined or keep their usage private are left out. A seller without listings has
an empty listings.
GET
/
discovery
/
sellers
/
{payTo}
/
usage
Get a seller's usage
curl --request GET \
--url https://testnet.rail402.dev/discovery/sellers/{payTo}/usageimport requests
url = "https://testnet.rail402.dev/discovery/sellers/{payTo}/usage"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://testnet.rail402.dev/discovery/sellers/{payTo}/usage', 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://testnet.rail402.dev/discovery/sellers/{payTo}/usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://testnet.rail402.dev/discovery/sellers/{payTo}/usage"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://testnet.rail402.dev/discovery/sellers/{payTo}/usage")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.rail402.dev/discovery/sellers/{payTo}/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"payTo": "<string>",
"totals": {
"payments": 123,
"payers": 123
},
"listings": [
{
"listing": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "http",
"resource": "<string>",
"payTo": "<string>",
"scheme": "<string>",
"amount": "<string>",
"asset": "<string>",
"network": "<string>",
"lastUpdated": "2023-11-07T05:31:56Z",
"method": "<string>",
"toolName": "<string>",
"description": "<string>",
"serviceName": "<string>"
},
"payments": 123,
"payers": 123,
"lastObservedAt": "2023-11-07T05:31:56Z"
}
],
"truncated": true
}{
"error": {
"code": "discovery_invalid_parameter",
"reason": "Unsupported parameter: foo.",
"retryable": false
}
}{
"error": {
"code": "<string>",
"reason": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "discovery_overloaded",
"reason": "Discovery is at capacity; retry after the Retry-After interval.",
"retryable": true
}
}Path Parameters
The seller's G… or C… address (the listing owner, never a muxed M… address).
Pattern:
^[GC][A-Z2-7]{55}$Query Parameters
The network whose listings and settlements are read.
Available options:
stellar:testnet, stellar:pubnet Response
The seller's usage.