# WritersLogic Price Change Attribution

> WritersLogic Price Change Attribution is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

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

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/price-change-attribution?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-price-change-attribution-d7055e48
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Y2k8yAwlNF5A9amk_2wsM

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-price-change-attribution-d7055e48 -d '<json body>'
```

Example prompt: 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?

## When to prefer this

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.

## Known failure modes

- 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

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

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.

## Request schema (JSON Schema)

```json
{
 "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:
… (truncated)
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-price-change-attribution-d7055e48/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
