API Sandbox
Test the transaction attribution API and explore integration options.
Request Builder
Sent as: Authorization: Bearer <api_key>
Validate without recording to leaderboard
Code Examples
JavaScript
const response = await fetch('https://app.oncore.dev/api/oncore/report-transaction', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your-api-key>'
},
body: JSON.stringify({
txHash: '0x...',
chainId: 50312,
dryRun: true
})
});
const data = await response.json();
console.log(data);Endpoint
POST /api/oncore/report-transactionAuthentication
Pass your API key in the Authorization header:
Authorization: Bearer <your-api-key>Your API key (format: sk_live_...) identifies your builder enrollment. No need to pass programCode - it's derived from your API key.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| txHash | string | Yes | Transaction hash (0x + 64 hex chars) |
| programCode | string | Yes | Program slug to attribute to |
| chainId | number | No | Chain ID (default: 50312) |
| dryRun | boolean | No | If true, validates without persisting |
Response
Success (200)
{
"success": true,
"message": "Transaction recorded successfully",
"transactionId": "uuid"
}Dry Run (200)
{
"success": true,
"dryRun": true,
"message": "Validation passed (dry run - not recorded)",
"validation": {
"txHash": "0x...",
"builderCode": "...",
"blockNumber": 12345
}
}Error Codes
| Status | Description |
|---|---|
| 400 | Invalid request (missing params, invalid format, builder not enrolled) |
| 401 | Missing or invalid Authorization header |
| 404 | Transaction not found on chain |
| 500 | Internal server error |
ERC-8021 Attribution
The transaction must contain an ERC-8021 builder code suffix in its calldata that matches your claimed builder code. See the ERC-8021 spec for details on how to tag transactions.