Get the content (x402 paywall)
curl --request GET \
--url https://api.simpuru.xyz/listings/{id}/unlockimport requests
url = "https://api.simpuru.xyz/listings/{id}/unlock"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.simpuru.xyz/listings/{id}/unlock', 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.simpuru.xyz/listings/{id}/unlock",
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://api.simpuru.xyz/listings/{id}/unlock"
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://api.simpuru.xyz/listings/{id}/unlock")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simpuru.xyz/listings/{id}/unlock")
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<string>{
"error": "<string>"
}Paid content
Get the content (x402 paywall)
Unpaid: 402 with a base64 JSON PAYMENT-REQUIRED header listing up to two options:
default(instant): paylisting.sellerAddressdirectly.masumi(protected): lock into our escrow under a seller-signed quote whoseinput_hashcommits to{ listingId, contentHash }. Deadlines: refund ≥ ~16 min, seller paid ≥ ~31 min, arbiter ≥ ~46 min.
Paid retry: send the signed Cardano transaction in PAYMENT-SIGNATURE (an x402 client such as
@x402/fetch + @x402/cardano does this). The in-process facilitator verifies, the content is returned,
then the tx is broadcast; PAYMENT-RESPONSE carries the settlement (tx hash). Takes ~20-60 s.
Returning buyer: send X-Simpuru-Proof instead to get content already paid for, without paying again.
GET
/
listings
/
{id}
/
unlock
Get the content (x402 paywall)
curl --request GET \
--url https://api.simpuru.xyz/listings/{id}/unlockimport requests
url = "https://api.simpuru.xyz/listings/{id}/unlock"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.simpuru.xyz/listings/{id}/unlock', 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.simpuru.xyz/listings/{id}/unlock",
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://api.simpuru.xyz/listings/{id}/unlock"
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://api.simpuru.xyz/listings/{id}/unlock")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simpuru.xyz/listings/{id}/unlock")
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<string>{
"error": "<string>"
}