{"uid":"cap_hACBpAYKyLwzu-FCW1rDd","slug":"x402toll-crypto-tax-lot-matching-fifo-lifo-hifo-b520fc0b","name":"x402toll Crypto Tax-Lot Matching (FIFO/LIFO/HIFO)","description":"Match a crypto sale against buy lots (FIFO / LIFO / HIFO), returning realized gain/loss split short- vs long-term (IRS >365-day rule) plus the remaining lots.","url":"https://x402toll.com/v1/crypto/tax-lots","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"lots":{"type":"array","items":{"type":"object","required":["qty","priceUsd","date"],"properties":{"qty":{"type":"number"},"date":{"type":"string"},"priceUsd":{"type":"number"}}},"maxItems":200,"minItems":1},"sale":{"type":"object","required":["qty","priceUsd","date"],"properties":{"qty":{"type":"number"},"date":{"type":"string"},"priceUsd":{"type":"number"}}},"method":{"enum":["fifo","lifo","hifo"],"type":"string","default":"fifo"}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.25","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.25/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.25","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ykrYIhLd-2V82iC_1IOkL","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.25","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Matches a crypto sale against buy lots using FIFO, LIFO, or HIFO, returning realized short-term and long-term gain/loss per IRS rules plus remaining lots.","exampleAgentPrompt":"I sold 1.5 ETH on 2024-11-15 at $3,200 each. My buy lots are: 1 ETH bought on 2023-06-01 at $1,800, and 1 ETH bought on 2024-08-20 at $2,500. Calculate my realized gain/loss using HIFO and tell me how much is short-term vs long-term.","exampleUseCases":null,"resultDescription":"Returns the realized gain/loss broken down into short-term (held ≤365 days) and long-term (held >365 days) portions, the matched buy lots consumed by the sale, and an array of remaining unsold lots with updated quantities — all computed per the chosen FIFO, LIFO, or HIFO method.","failureModes":["Sale quantity exceeds total lot quantity — returns an error indicating insufficient lots to cover the sale","Missing required fields (qty, priceUsd, date) on any lot or sale object — returns a 400 validation error","Invalid date format in lot or sale — returns parsing error","More than 200 lots supplied — rejected due to maxItems constraint","Invalid method enum value — returns validation error, defaults to FIFO if omitted","Payment not included or insufficient — returns 402 Payment Required"],"whenToPreferThis":"Use this endpoint when you need IRS-compliant crypto capital gains calculation with lot-level detail across multiple purchase tranches, especially when the user wants to choose their accounting method (FIFO, LIFO, or HIFO) and needs the short-term vs long-term split for tax reporting. Prefer this over generic financial calculators when the input is a structured list of crypto buy lots and a specific sale event.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-14T18:59:47.165Z","isFirstParty":false}