curl --request GET \
--url https://testnet.rail402.dev/discovery/resourcesimport requests
url = "https://testnet.rail402.dev/discovery/resources"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://testnet.rail402.dev/discovery/resources', 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/resources",
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/resources"
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/resources")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.rail402.dev/discovery/resources")
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{
"x402Version": 2,
"items": [
{
"resource": "<string>",
"type": "http",
"x402Version": 2,
"accepts": [
{
"scheme": "exact",
"network": "stellar:testnet",
"asset": "<string>",
"payTo": "<string>",
"amount": "<string>",
"maxTimeoutSeconds": 123,
"extra": {
"areFeesSponsored": true
}
}
],
"lastUpdated": "2023-11-07T05:31:56Z",
"extensions": {
"bazaar": {}
},
"rail402": {
"trust": "settled",
"settlements": 123,
"listings": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network": "<string>",
"version": 123,
"trust": "settled",
"owner": "<string>",
"settlements": 123,
"firstCataloged": "2023-11-07T05:31:56Z",
"lastSettled": "2023-11-07T05:31:56Z",
"stellar": {
"checkedAt": "2023-11-07T05:31:56Z",
"domain": {
"host": "<string>",
"claimsOwner": true
}
}
}
],
"options": [
{
"listing": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"receivable": true
}
],
"method": "<string>",
"toolName": "<string>"
},
"description": "<string>",
"mimeType": "<string>",
"serviceName": "<string>",
"tags": [
"<string>"
],
"iconUrl": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123,
"asOf": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "discovery_invalid_parameter",
"reason": "Unsupported parameter: foo.",
"retryable": false
}
}{
"error": {
"code": "<string>",
"reason": "<string>",
"retryable": true,
"details": {}
}
}List cataloged resources
Published resources in catalog order (first published first), so offset paging pinned with
asOf is stable. A resource sold on several networks is one item. payTo, scheme and network
must hold for one and the same payment option, and a filtered item shows only the options that
matched. Unsupported or malformed parameters are refused.
curl --request GET \
--url https://testnet.rail402.dev/discovery/resourcesimport requests
url = "https://testnet.rail402.dev/discovery/resources"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://testnet.rail402.dev/discovery/resources', 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/resources",
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/resources"
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/resources")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.rail402.dev/discovery/resources")
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{
"x402Version": 2,
"items": [
{
"resource": "<string>",
"type": "http",
"x402Version": 2,
"accepts": [
{
"scheme": "exact",
"network": "stellar:testnet",
"asset": "<string>",
"payTo": "<string>",
"amount": "<string>",
"maxTimeoutSeconds": 123,
"extra": {
"areFeesSponsored": true
}
}
],
"lastUpdated": "2023-11-07T05:31:56Z",
"extensions": {
"bazaar": {}
},
"rail402": {
"trust": "settled",
"settlements": 123,
"listings": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"network": "<string>",
"version": 123,
"trust": "settled",
"owner": "<string>",
"settlements": 123,
"firstCataloged": "2023-11-07T05:31:56Z",
"lastSettled": "2023-11-07T05:31:56Z",
"stellar": {
"checkedAt": "2023-11-07T05:31:56Z",
"domain": {
"host": "<string>",
"claimsOwner": true
}
}
}
],
"options": [
{
"listing": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"symbol": "<string>",
"name": "<string>",
"decimals": 123,
"receivable": true
}
],
"method": "<string>",
"toolName": "<string>"
},
"description": "<string>",
"mimeType": "<string>",
"serviceName": "<string>",
"tags": [
"<string>"
],
"iconUrl": "<string>"
}
],
"pagination": {
"limit": 123,
"offset": 123,
"total": 123,
"asOf": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "discovery_invalid_parameter",
"reason": "Unsupported parameter: foo.",
"retryable": false
}
}{
"error": {
"code": "<string>",
"reason": "<string>",
"retryable": true,
"details": {}
}
}Query Parameters
Only listings of this resource type. Unknown types match nothing.
^[a-z][a-z0-9_-]{0,31}$"http"
"mcp"
Only payment options paying this address (a G… address also matches muxed addresses on it).
^[A-Z2-7]{56}$|^M[A-Z2-7]{68}$Only payment options in this scheme.
^[a-z][a-z0-9_-]{0,31}$"exact"
Only payment options on this CAIP-2 network.
^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,64}$"stellar:testnet"
Comma-separated extension keys (at most 10) every resource must declare in its 402 response.
^[a-zA-Z0-9_-]{1,64}(,[a-zA-Z0-9_-]{1,64}){0,9}$"bazaar"
Page size, in resources. Values above 100 are clamped to 100.
x >= 1Resources to skip.
0 <= x <= 1000000Only listings first published at or before this time. Pass back pagination.asOf.