Skip to main content
Transactions represent completed or in-progress payments through your payment links and checkout sessions. The transactions API is read-only — transactions are created automatically when customers pay through your checkout flow.
Transaction amounts are stored in the token’s smallest unit (e.g., 6 decimals for USDC). The amount_usd field provides the USD equivalent at the time of the transaction.

The Transaction object

id
string
Unique identifier for the transaction (e.g., tx_abc123).
status
string
Current status of the transaction. One of: pending, confirming, completed, failed.
amount
string
Transaction amount in the token’s smallest unit.
amount_usd
string
USD equivalent of the transaction amount at the time of payment.
token_address
string
Contract address of the received token.
chain_id
number
Chain ID where the payment was received.
tx_hash
string | null
On-chain transaction hash. Null while pending.
payer_address
string
Wallet address of the payer.
recipient_address
string
Wallet address that received the payment.
customer_id
string | null
Associated customer ID, if the payer is a known customer.
Payment link that originated this transaction.
session_id
string | null
Checkout session that originated this transaction.
source_chain_id
number | null
If the payer paid from a different chain, this is the chain they paid from.
source_token_address
string | null
If the payer paid with a different token, this is the token they paid with.
source_amount
string | null
The amount the payer sent (before swap/bridge), in the source token’s smallest unit.
fee_amount
string | null
Platform fee amount in the received token’s smallest unit.
form_data
object | null
Custom form data submitted by the customer during checkout.
shipping_address
object | null
Shipping address provided by the customer.
shipping_option
object | null
Selected shipping option.
metadata
object | null
Metadata from the checkout session.
created_at
string
ISO 8601 timestamp when the transaction was initiated.
confirmed_at
string | null
ISO 8601 timestamp when the transaction reached confirming status.
completed_at
string | null
ISO 8601 timestamp when the transaction reached completed status.

Transaction statuses

StatusDescription
pendingTransaction initiated, waiting for on-chain submission.
confirmingTransaction submitted on-chain, waiting for block confirmations.
completedTransaction confirmed and payment received by the recipient.
failedTransaction failed due to revert, timeout, or insufficient funds.

List transactions

Retrieve a paginated list of transactions with optional filters.
status
string
Filter by status: pending, confirming, completed, failed.
customer_id
string
Filter by customer ID.
Filter by payment link ID.
from
string
Filter transactions created on or after this ISO 8601 date (e.g., 2026-01-01).
to
string
Filter transactions created on or before this ISO 8601 date (e.g., 2026-02-28).
page
number
default:1
Page number for pagination.
limit
number
default:20
Number of results per page (max 100).
curl -X GET "https://platform-api.anyspend.com/api/v1/transactions?status=completed&from=2026-02-01&to=2026-02-28&page=1&limit=20" \
  -H "Authorization: Bearer asp_xxx"
{
  "data": [
    {
      "id": "tx_abc123",
      "status": "completed",
      "amount": "50000000",
      "amount_usd": "50.00",
      "token_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
      "chain_id": 1,
      "tx_hash": "0x9f8e7d6c5b4a3f2e1d0c9b8a7f6e5d4c3b2a1f0e",
      "payer_address": "0xaabb1234ccdd5678eeff9900aabb1234ccdd5678",
      "recipient_address": "0x1234567890abcdef1234567890abcdef12345678",
      "customer_id": "cust_abc123",
      "payment_link_id": "pl_abc123",
      "session_id": "cs_sess001",
      "source_chain_id": 8453,
      "source_token_address": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
      "source_amount": "50000000",
      "fee_amount": "500000",
      "form_data": {
        "company_name": "Acme Inc."
      },
      "shipping_address": null,
      "shipping_option": null,
      "metadata": null,
      "created_at": "2026-02-25T08:15:00Z",
      "confirmed_at": "2026-02-25T08:15:45Z",
      "completed_at": "2026-02-25T08:16:30Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 20,
    "total": 156,
    "total_pages": 8,
    "has_more": true
  }
}

Retrieve a transaction

id
string
required
The transaction ID (e.g., tx_abc123).
curl -X GET "https://platform-api.anyspend.com/api/v1/transactions/tx_abc123" \
  -H "Authorization: Bearer asp_xxx"
Returns the full Transaction object.

Get transaction stats

Retrieve aggregate statistics across all your transactions.
curl -X GET "https://platform-api.anyspend.com/api/v1/transactions/stats" \
  -H "Authorization: Bearer asp_xxx"
{
  "total_transactions": 1250,
  "completed_transactions": 1180,
  "failed_transactions": 45,
  "pending_transactions": 25,
  "total_volume_usd": "58750.00",
  "last_24h": {
    "transactions": 18,
    "completed": 17,
    "volume_usd": "920.00"
  },
  "status_breakdown": {
    "pending": 15,
    "confirming": 10,
    "completed": 1180,
    "failed": 45
  }
}

Export transactions

Export transaction data in CSV or JSON format. The response is streamed as a file download.
format
string
required
Export format. One of: csv, json.
status
string
Filter by status: pending, confirming, completed, failed.
from
string
Filter transactions created on or after this ISO 8601 date.
to
string
Filter transactions created on or before this ISO 8601 date.
Exports are limited to 50,000 records. For larger datasets, use date range filters to break exports into smaller chunks.
# Export completed transactions for February 2026 as CSV
curl -X GET "https://platform-api.anyspend.com/api/v1/transactions/export?format=csv&status=completed&from=2026-02-01&to=2026-02-28" \
  -H "Authorization: Bearer asp_xxx" \
  -o transactions.csv

# Export as JSON
curl -X GET "https://platform-api.anyspend.com/api/v1/transactions/export?format=json&status=completed" \
  -H "Authorization: Bearer asp_xxx" \
  -o transactions.json
id,status,amount,amount_usd,token_address,chain_id,tx_hash,payer_address,recipient_address,customer_id,payment_link_id,created_at,completed_at
tx_abc123,completed,50000000,50.00,0xA0b8...eB48,1,0x9f8e...1f0e,0xaabb...5678,0x1234...5678,cust_abc123,pl_abc123,2026-02-25T08:15:00Z,2026-02-25T08:16:30Z
tx_def456,completed,25000000,25.00,0xA0b8...eB48,1,0x1a2b...3c4d,0xccdd...9012,0x1234...5678,cust_def456,pl_abc123,2026-02-24T12:00:00Z,2026-02-24T12:01:15Z