{"uid":"cap_vD5v-gNM2q3pfCxKDZwUP","slug":"moving-weighted-average-cost-cogs-transcript-verifier-ebbb2afe","name":"Moving Weighted-Average Cost (COGS) Transcript Verifier","description":"An agent that reconciles a perpetual inventory valuation needs its claimed cumulative cost of sold units checked against exact moving weighted-average restocking and sale arithmetic.","url":"https://detect.halowerk.com/v1/commerce/commerce-moving-average-cost-transcript?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"artifact":{"type":"object","required":["events","claimed_cogs_numerator","claimed_cogs_denominator"],"properties":{"events":{"type":"array","items":{"type":"object","required":["kind","units","unit_cost"],"properties":{"kind":{"enum":["buy","sell"],"type":"string","maxLength":64,"minLength":1},"units":{"type":"integer","maximum":1000000,"minimum":1},"unit_cost":{"type":"integer","maximum":1000000,"minimum":0}},"additionalProperties":false},"maxItems":512,"minItems":0},"claimed_cogs_numerator":{"type":"integer","maximum":9007199254740991,"minimum":0},"claimed_cogs_denominator":{"type":"integer","maximum":9007199254740991,"minimum":1}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.002","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.002/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.002","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_ctuJdDyFTSGEoum2yUXIg","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.002","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Verifies a claimed cumulative cost of goods sold against exact moving weighted-average cost arithmetic applied to a sequence of buy and sell inventory events.","exampleAgentPrompt":"I have a perpetual inventory with these events: buy 10 units at 50, buy 5 units at 60, sell 8 units, buy 3 units at 70, sell 6 units — and I'm claiming my total COGS is 143000/2000 as a fraction. Can you verify that against exact moving weighted-average cost arithmetic?","exampleUseCases":[{"title":"Audit perpetual inventory COGS claim","prompt":"We have an inventory ledger with 12 buy and sell events and our accountant claims the cumulative COGS is 875000 divided by 10000 using the moving weighted-average method. Can you run the exact arithmetic and tell me if that fraction is correct?"},{"title":"Validate e-commerce inventory valuation","prompt":"My e-commerce system recorded these stock movements: buy 100 units at $20, sell 40 units, buy 60 units at $25, sell 80 units — and it's reporting total COGS as a fraction 4200/100. Please check whether that moving weighted-average COGS calculation is accurate."},{"title":"Reconcile ERP cost accounting output","prompt":"Our ERP exported a series of inventory transactions and computed a moving average COGS of 562500 over 7500 units sold. I need to verify that the system's arithmetic is correct — here are the raw buy and sell events with quantities and costs."}],"resultDescription":"The endpoint returns a detailed transcript of the moving weighted-average cost computation applied to each buy and sell event in sequence, along with a verdict on whether the claimed COGS fraction (numerator/denominator) matches the exact arithmetic result.","failureModes":["Sell event before sufficient inventory (units sold exceed current stock)","claimed_cogs_denominator of zero (rejected by schema minimum:1)","events array exceeding 512 items","unit_cost or units exceeding maximum bounds","Mismatch between claimed COGS and computed result — returns discrepancy detail"],"whenToPreferThis":"Use this endpoint when you need to independently verify that a perpetual inventory system's moving weighted-average COGS calculation is arithmetically correct, especially when auditing ERP output, reconciling accounting claims, or validating agent-generated cost figures against a trusted computation.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-24T00:44:13.399Z","isFirstParty":false,"canonicalSlug":"moving-weighted-average-cost-cogs-transcript-verifier-ebbb2afe"}