Skip to main content

Transactions API

The Transactions API allows you to view blockchain transaction details and confirmations for your payments.

Get Transaction

Retrieve details of a specific transaction by hash.

GET /api/transactions/{transaction_hash}/

Response

{
"success": true,
"data": {
"transaction_hash": "0xabcdef1234567890...",
"payment_order": {
"id": 123,
"order_id": "ORD-abc123def456",
"amount": "100.00",
"currency": "USDC"
},
"blockchain": "base",
"block_number": 12345678,
"block_timestamp": "2024-01-01T10:15:00Z",
"confirmations": 15,
"status": "confirmed",
"from_address": "0x9876543210987654321098765432109876543210",
"to_address": "0x1234567890123456789012345678901234567890",
"gas_used": 21000,
"gas_price": "1000000000",
"transaction_fee": "0.000021"
}
}

List Transactions

Get a paginated list of transactions.

GET /api/transactions/

Query Parameters

ParameterTypeDescription
blockchainstringFilter by blockchain
statusstringFilter by status (pending, confirmed, failed)
pageintegerPage number
page_sizeintegerItems per page

Response

{
"count": 150,
"next": "/api/transactions/?page=2",
"previous": null,
"results": [
{
"transaction_hash": "0xabcdef...",
"blockchain": "base",
"status": "confirmed",
"amount": "100.00",
"currency": "USDC",
"created_at": "2024-01-01T10:00:00Z"
}
]
}

Transaction Status

Transactions can have the following statuses:

StatusDescription
pendingTransaction submitted to blockchain
confirmedTransaction confirmed with required confirmations
failedTransaction failed or was rejected

Example Usage

// Get specific transaction
const transaction = await fetch('/api/transactions/0xabcdef.../', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});

// List recent transactions
const transactions = await fetch('/api/transactions/?page_size=10', {
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
});