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-transaction

Authentication

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

ParameterTypeRequiredDescription
txHashstringYesTransaction hash (0x + 64 hex chars)
programCodestringYesProgram slug to attribute to
chainIdnumberNoChain ID (default: 50312)
dryRunbooleanNoIf 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

StatusDescription
400Invalid request (missing params, invalid format, builder not enrolled)
401Missing or invalid Authorization header
404Transaction not found on chain
500Internal 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.