Concepts

Pagination

The list endpoints under History return a page at a time.

List endpoints take rows, the page size from 1 to 100, and page, starting at 1. Send both or neither: without them you get the first 20 rows. Lists are newest first.

Example

The first 50 of your transactions. Ask for page=2 for the next 50, and stop when a page comes back shorter than rows.

Request
curl https://anonpay.org/api/user/transactions \
  -H "Authorization: Bearer $APA_KEY" \
  -d user_id=4b8e2d0f6a1c3e5b7d9f0a2c4e6b8d0f \
  -d rows=50 \
  -d page=1
import os
import requests

KEY = os.environ["APA_KEY"]

response = requests.post(
    "https://anonpay.org/api/user/transactions",
    headers={"Authorization": f"Bearer {KEY}"},
    data={
        "user_id": "4b8e2d0f6a1c3e5b7d9f0a2c4e6b8d0f",
        "rows": "50",
        "page": "1",
    },
    timeout=30,
)
print(response.json())
const url = "https://anonpay.org/api/user/transactions";

const response = await fetch(url, {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.APA_KEY}` },
  body: new URLSearchParams({
    user_id: "4b8e2d0f6a1c3e5b7d9f0a2c4e6b8d0f",
    rows: "50",
    page: "1",
  }),
});
console.log(await response.json());
$url = 'https://anonpay.org/api/user/transactions';
$key = getenv("APA_KEY");

$ch = curl_init($url);
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => ["Authorization: Bearer $key"],
    CURLOPT_POSTFIELDS => http_build_query([
        "user_id" => '4b8e2d0f6a1c3e5b7d9f0a2c4e6b8d0f',
        "rows" => '50',
        "page" => '1',
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$response = json_decode(curl_exec($ch), true);
Response200 OK
{
  "status": "success",
  "transactions": [
    {
      "uid": "9c1f0b7a4e2d8f6a3b5c7d9e1f0a2b4c",
      "amount_topay": "20",
      "amount_paid": "20",
      "currency": "usd",
      "status": "completed",
      "payment_method": "btc",
      "created": 1753919400,
      "expires": 1754005800,
      "cancelled": null,
      "completed": 1753920000
    }
  ]
}