Docs/API/Transactions

Transactions

Query and manage your transaction history. Transactions represent completed or attempted onramp sessions.

GET

/v1/transactions

Retrieve a paginated list of transactions for your account.

Query Parameters

pageinteger
Page number for pagination. Default: 1
limitinteger
Results per page (max 100). Default: 20
statusstring
Filter by status: pending, processing, completed, failed
fromstring
Start date filter (ISO 8601 format)
tostring
End date filter (ISO 8601 format)
wallet_addressstring
Filter by destination wallet address
crypto_currencystring
Filter by cryptocurrency (ETH, USDC, etc.)

Example Request

bash
-green-400">curl "https://api.web3pay.io/v1/transactions?page=1&limit=20&status=completed" \
  -H "X-API-Key: wp3_live_sk_your_api_key"

Response

json
{
  "success": true,
  "data": {
    "transactions": [
      {
        "id": "tx_abc123",
        "session_id": "onramp_sess_xyz789",
        "status": "completed",
        "wallet_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f5fB",
        "crypto_currency": "ETH",
        "crypto_amount": "0.0412",
        "fiat_currency": "USD",
        "fiat_amount": 10000,
        "network": "ethereum",
        "tx_hash": "0x1234567890abcdef...",
        "platform_fee": 150,
        "metadata": {
          "order_id": "ord_12345"
        },
        "created_at": "2024-01-15T12:00:00Z",
        "completed_at": "2024-01-15T12:08:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 156,
      "pages": 8
    }
  }
}
GET

/v1/transactions/:id

Retrieve details for a specific transaction by ID.

Path Parameters

idstringrequired
The transaction ID (e.g., tx_abc123)

Example Request

bash
-green-400">curl https://api.web3pay.io/v1/transactions/tx_abc123 \
  -H "X-API-Key: wp3_live_sk_your_api_key"

Response

json
{
  "success": true,
  "data": {
    "id": "tx_abc123",
    "session_id": "onramp_sess_xyz789",
    "status": "completed",
    "wallet_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f5fB",
    "crypto_currency": "ETH",
    "crypto_amount": "0.0412",
    "fiat_currency": "USD",
    "fiat_amount": 10000,
    "network": "ethereum",
    "tx_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
    "fees": {
      "platform_fee": 150,
      "network_fee": 250,
      "processing_fee": 290
    },
    "exchange_rate": 2427.18,
    "metadata": {
      "order_id": "ord_12345",
      "user_id": "usr_67890"
    },
    "customer_email": "user@example.com",
    "created_at": "2024-01-15T12:00:00Z",
    "completed_at": "2024-01-15T12:08:00Z"
  }
}

The Transaction Object

A complete reference of all fields on the transaction object.

idstring
Unique transaction identifier
session_idstring
Associated onramp session ID
statusstring
Current status: pending, processing, completed, failed
wallet_addressstring
Destination wallet for crypto delivery
crypto_currencystring
Cryptocurrency symbol (ETH, USDC, etc.)
crypto_amountstring
Amount of crypto delivered (as string for precision)
fiat_currencystring
Fiat currency code (USD, EUR, GBP)
fiat_amountinteger
Fiat amount in smallest unit (cents)
networkstring
Blockchain network (ethereum, polygon, base)
tx_hashstring
On-chain transaction hash (when completed)
feesobject
Fee breakdown object
exchange_ratenumber
Exchange rate at time of transaction
metadataobject
Custom metadata attached to session
customer_emailstring
Customer email if provided
created_atstring
ISO 8601 creation timestamp
completed_atstring
ISO 8601 completion timestamp (if completed)

SDK Examples

javascript
400">import { Web3Pay } 400">from 400">'@web3pay/sdk';

400">const client = 400">new Web3Pay({
  apiKey: 400">'wp3_live_sk_your_api_key'
});

500">// List transactions with filters
400">const result = 400">await client.getTransactions({
  page: 1,
  limit: 20,
  status: 400">'completed'
});

console.log(result.transactions);
console.log(result.pagination);

500">// Get single transaction
400">const tx = 400">await client.getTransaction(400">'tx_abc123');
console.log(tx.status, tx.tx_hash);

Filtering Examples

Filter by date range

bash
-green-400">curl "https://api.web3pay.io/v1/transactions?from=2024-01-01&to=2024-01-31" \
  -H "X-API-Key: wp3_live_sk_your_api_key"

Filter by wallet and currency

bash
-green-400">curl "https://api.web3pay.io/v1/transactions?wallet_address=0x742d35...&crypto_currency=ETH" \
  -H "X-API-Key: wp3_live_sk_your_api_key"

Get failed transactions

bash
-green-400">curl "https://api.web3pay.io/v1/transactions?status=failed&limit=50" \
  -H "X-API-Key: wp3_live_sk_your_api_key"
Back to home
Was this page helpful?