{"uid":"cap_AnXGkow8Lf4C1danIGQkH","slug":"halowerk-x402werk-erc-20-transfer-reconciliation-b93433ba","name":"HALOWERK x402werk ERC-20 Transfer Reconciliation","description":"Reads all incoming ERC-20 transfers of one token to one address within a block or time window and matches them against the receipts you supply. Matching runs first over the transaction hash, which is the strongest link, and otherwise over amount plus payer plus a stated time tolerance; the method used is named for every single match, so a weak match is never mistaken for a strong one. The answer lists matched pairs, receipts without a payment, payments without a receipt, amount mismatches with e","url":"https://x402.halowerk.com/reconcile","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"asset":{"type":"string","description":"Token contract address to reconcile. Defaults to the canonical USDC of that chain."},"chain":{"enum":["arb","arbitrum","arbitrum-one","avalanche","avax","base","base-mainnet","base-sepolia","basesepolia","eip155:1","eip155:10","eip155:137","eip155:42161","eip155:43114","eip155:8453","eip155:84532","eth","ethereum","ethereum-mainnet","mainnet","matic","op","op-mainnet","optimism","polygon"],"type":"string","description":"Chain as CAIP-2, short name or chain id."},"window":{"type":"object","properties":{"to":{"type":"integer","description":"End of the window as unix seconds."},"from":{"type":"integer","description":"Start of the window as unix seconds. Resolved to a block by reading real blocks."},"to_block":{"type":"integer","minimum":0,"description":"End block. Takes precedence over to."},"from_block":{"type":"integer","minimum":0,"description":"Start block. Takes precedence over from."}},"additionalProperties":false},"address":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Your receiving address whose incoming transfers should be read."},"receipts":{"type":"array","items":{"type":"object","required":["amount_units"],"properties":{"ts":{"type":"integer","description":"Unix seconds when the receipt was issued. Needed for the amount-and-time fallback match."},"payer":{"type":"string","pattern":"^0x[0-9a-fA-F]{40}$","description":"Address you believe paid."},"tx_hash":{"type":"string","pattern":"^0x[0-9a-fA-F]{64}$","description":"Settlement transaction hash, if you recorded one."},"payment_id":{"type":"string","maxLength":200,"description":"Payment identifier, used to detect duplicate receipts."},"receipt_id":{"type":"string","maxLength":200,"description":"Your own identifier for this receipt. Echoed back in every result."},"amount_units":{"type":"string","pattern":"^[0-9]{1,78}$","description":"Amount as an integer in the smallest unit of the token."}},"additionalProperties":false},"maxItems":500,"minItems":1,"description":"Your receipts. Each needs at least amount_units; tx_hash makes the match strong, payer and ts make the fallback match possible."},"time_tolerance_seconds":{"type":"integer","default":300,"maximum":86400,"minimum":0,"description":"How far a receipt timestamp may sit from the block time of a payment and still match. Receipt and chain rarely carry the same second."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.008","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.008/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.008","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_GUQv7SZBkuDHF5aRgQxUI","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.008","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Reconciles a list of expected payment receipts against actual on-chain ERC-20 transfers received at a given address within a specified block or time window, using tx hash or amount+payer+time matching.","exampleAgentPrompt":"Reconcile my payment receipts against actual USDC transfers received at 0xAbCd...1234 on Base between unix timestamps 1717200000 and 1717286400 — here are the receipts I issued, each with a tx_hash or payer address and amount in smallest units.","exampleUseCases":[{"title":"Weekly x402 revenue audit","prompt":"Check which of my x402 payment receipts from the past 7 days actually have matching USDC transfers on Base to my address 0xAbCd...1234 — use unix timestamps 1716595200 to 1717200000 and here are the 40 receipts I issued with their tx hashes and amounts."},{"title":"Dispute resolution for missing payment","prompt":"A customer says they paid me but I see no receipt match — can you reconcile their claimed payment of 8000 USDC units from address 0xPayer...5678 to my wallet 0xAbCd...1234 on Arbitrum between blocks 200000000 and 200001000?"},{"title":"Detecting duplicate or phantom receipts","prompt":"I think I may have issued some receipts that were never actually paid — reconcile these 20 receipts against all incoming USDC transfers on Optimism to 0xAbCd...1234 for unix time window 1717000000 to 1717086400 and show me which receipts have no matching on-chain payment."}],"resultDescription":"Returns a structured list of matched pairs (with the match method used — tx_hash or amount+payer+time), receipts with no corresponding on-chain payment, on-chain payments with no corresponding receipt, and amount mismatches with details. Each result echoes back the caller's receipt_id for easy correlation.","failureModes":["Invalid or non-checksummed Ethereum address returns a 400 validation error","Unsupported chain identifier returns an enum validation error","Block range or time window resolving to no transfers returns empty match lists","Receipt amount_units pattern mismatch (non-integer string) causes schema rejection","Very wide time windows may time out if the block range spans millions of blocks","Weak amount+payer+time matches may not resolve if timestamp tolerance is insufficient"],"whenToPreferThis":"Use this endpoint when you need to reconcile ERC-20 payment receipts (especially x402 USDC payments) against actual on-chain transfers, particularly when you have a mix of receipts with and without tx hashes. It is superior to manually querying block explorers because it applies a tiered matching strategy, clearly distinguishes strong (tx_hash) from weak (amount+payer+time) matches, and returns structured gap analysis showing unmatched payments or receipts. Prefer it over generic blockchain APIs when you need accounting-grade reconciliation with per-match method attribution.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T12:32:03.726Z","isFirstParty":false}