Buy with my Simpuru wallet
curl --request POST \
--url https://api.simpuru.xyz/me/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"listingId": "<string>"
}
'import requests
url = "https://api.simpuru.xyz/me/buy"
payload = { "listingId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({listingId: '<string>'})
};
fetch('https://api.simpuru.xyz/me/buy', 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/me/buy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'listingId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.simpuru.xyz/me/buy"
payload := strings.NewReader("{\n \"listingId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.simpuru.xyz/me/buy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"listingId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simpuru.xyz/me/buy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"listingId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"purchase": {
"id": "<string>",
"listingId": "<string>",
"mode": "instant",
"buyerAddress": "<string>",
"txHash": "<string>",
"status": "<string>",
"events": [
{
"status": "<string>",
"txHash": "<string>",
"at": "<string>"
}
],
"escrow": {
"address": "<string>",
"inputHash": "<string>",
"resultHash": "<string>",
"identifierFromPurchaser": "<string>",
"deadlines": {
"payBy": "<string>",
"submitResult": "<string>",
"unlock": "<string>",
"externalDisputeUnlock": "<string>"
}
},
"verification": "ok"
},
"content": "<string>",
"alreadyOwned": true
}{
"error": "<string>"
}{
"error": "<string>"
}Account
Buy with my Simpuru wallet
The API pays over x402 from the account’s Simpuru wallet, within its limits, and returns the content. Protected purchases are watched and refunded automatically if delivery fails. Buying something already owned returns it again for free (alreadyOwned). Takes 20–60 s (waits for the chain).
POST
/
me
/
buy
Buy with my Simpuru wallet
curl --request POST \
--url https://api.simpuru.xyz/me/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"listingId": "<string>"
}
'import requests
url = "https://api.simpuru.xyz/me/buy"
payload = { "listingId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({listingId: '<string>'})
};
fetch('https://api.simpuru.xyz/me/buy', 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/me/buy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'listingId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.simpuru.xyz/me/buy"
payload := strings.NewReader("{\n \"listingId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.simpuru.xyz/me/buy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"listingId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.simpuru.xyz/me/buy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"listingId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"purchase": {
"id": "<string>",
"listingId": "<string>",
"mode": "instant",
"buyerAddress": "<string>",
"txHash": "<string>",
"status": "<string>",
"events": [
{
"status": "<string>",
"txHash": "<string>",
"at": "<string>"
}
],
"escrow": {
"address": "<string>",
"inputHash": "<string>",
"resultHash": "<string>",
"identifierFromPurchaser": "<string>",
"deadlines": {
"payBy": "<string>",
"submitResult": "<string>",
"unlock": "<string>",
"externalDisputeUnlock": "<string>"
}
},
"verification": "ok"
},
"content": "<string>",
"alreadyOwned": true
}{
"error": "<string>"
}{
"error": "<string>"
}Authorizations
Session token from POST /auth/verify (7 days).
Body
application/json