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
| Parameter | Type | Description |
|---|---|---|
blockchain | string | Filter by blockchain |
status | string | Filter by status (pending, confirmed, failed) |
page | integer | Page number |
page_size | integer | Items 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:
| Status | Description |
|---|---|
pending | Transaction submitted to blockchain |
confirmed | Transaction confirmed with required confirmations |
failed | Transaction 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'
}
});