{"uid":"cap_Y2k8yAwlNF5A9amk_2wsM","slug":"writerslogic-price-change-attribution-d7055e48","name":"WritersLogic Price Change Attribution","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/price-change-attribution?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"fx":{"type":"object","required":["before","after"],"properties":{"after":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."},"before":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."}},"description":"Multiplier from line currency to reporting currency, before and after. Default 1 and 1.","additionalProperties":false},"after":{"type":"array","items":{"type":"object","required":["key","quantity","unitPrice"],"properties":{"key":{"type":"string","maxLength":80,"minLength":1},"quantity":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."},"unitPrice":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."}},"additionalProperties":false},"maxItems":300,"minItems":0},"order":{"type":"array","items":{"enum":["quantity","price","fx"],"type":"string"},"maxItems":3,"minItems":1,"description":"Substitution order of the factors; each at most once. Default [quantity, price, fx]."},"before":{"type":"array","items":{"type":"object","required":["key","quantity","unitPrice"],"properties":{"key":{"type":"string","maxLength":80,"minLength":1},"quantity":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."},"unitPrice":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Decimal string such as \"-12.50\" (up to 15 integer and 12 fraction digits). JSON numbers are not accepted: they are binary floats."}},"additionalProperties":false},"maxItems":300,"minItems":0},"currency":{"type":"string","pattern":"^[A-Z]{3}$","description":"ISO 4217 alphabetic code, upper case."},"exponent":{"type":"integer","maximum":8,"minimum":0},"rounding":{"enum":["half-up","half-down","half-even","up","down","ceiling","floor"],"type":"string","description":"Default half-even. half-up: ties away from zero. half-down: ties toward zero. half-even: ties to the even neighbour. up: away from zero. down: toward zero. ceiling: toward +infinity. floor: toward -infinity."},"statedAfterTotal":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Optional stated total of `after` to verify."},"statedBeforeTotal":{"type":"string","pattern":"^-?\\d{1,15}(\\.\\d{1,12})?$","maxLength":30,"description":"Optional stated total of `before` (reporting currency) to verify."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","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.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_UBu5mlvr7Oz2vaSnngcuQ","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Decomposes the total change between two versions of a quote, order, or invoice into quantity, unit price, exchange rate, added-line, and dropped-line effects using sequential substitution","exampleAgentPrompt":"My supplier sent a revised quote — the total went from $12,400 to $14,250 across these 15 line items (before and after, with keys, quantities, and unit prices). Can you break down exactly how much of that $1,850 increase came from quantity changes, unit price changes, and any new or dropped lines, attributing them in quantity-first then price order so the effects add up exactly?","exampleUseCases":[{"title":"Purchase order revision explanation","prompt":"We got a revised PO from our vendor — the original had 8 lines totaling $45,000 and the new one totals $51,200. I'll give you the before and after line items with keys, quantities, and unit prices. Can you tell me exactly how much of the $6,200 increase came from quantity changes versus price changes versus any added or removed lines?"},{"title":"Multi-currency invoice change attribution","prompt":"Our invoice changed from €88,000 to €94,500 between drafts, and the EUR/USD exchange rate also shifted from 1.08 to 1.11. Using quantity-first then price then FX order, break down how much of the total change in USD is due to quantity, unit price, and the FX move separately — I need the effects to sum exactly to the total difference."},{"title":"Quote version comparison for sales audit","prompt":"I need to explain to my manager why our sales quote went from $230,000 down to $198,000 in the latest revision. Here are the before and after line items with their keys, quantities, and prices — two lines were dropped and one was added. Can you attribute the full $32,000 decrease across quantity effects, price effects, added lines, and dropped lines?"}],"resultDescription":"A structured breakdown of the total change between two document versions, with exact attribution to: quantity effects per matched line, unit price effects per matched line, FX rate effects per matched line, full value of added lines, full value of removed lines, and a rounding reconciliation ensuring all effects sum precisely to the rounded total change. If stated totals were provided, a drift report comparing them to recomputed totals is also returned, along with the factor substitution order used.","failureModes":["Line items exceed 300 per version — request rejected","Numeric fields supplied as JSON numbers instead of decimal strings — validation error","Duplicate keys within before or after arrays — ambiguous matching error","Factor order array contains duplicates or unknown factor names — validation error","Stated totals drift significantly from recomputed totals — drift reported but not necessarily an error","Missing required fields (key, quantity, unitPrice) on any line — validation error"],"whenToPreferThis":"Use this endpoint when an AI agent needs to explain exactly why a multi-line document total changed between two versions and must attribute the change to specific factors (quantity, price, FX, added/removed lines) with effects that sum exactly to the total difference. It is superior to manual calculation when rounding reconciliation across many lines is required, when FX attribution is needed alongside quantity and price, or when the agent must present an auditable, factor-ordered explanation to a human. It is not suitable for explaining why a supplier chose to change a price (causal/business reasoning) or for statistical variance analysis.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:38:18.012Z","isFirstParty":false,"canonicalSlug":"writerslogic-price-change-attribution-d7055e48"}