{"openapi":"3.1.0","info":{"title":"Purchase Order Revision Diff","version":"1.0.0","description":"Compare purchase-order revisions by stable line ID and show additions, removals, field changes and exact order-value deltas.","contact":{"email":"jeremy@jeremycarter.ca"}},"servers":[{"url":"https://gptenv-x402-catalog.defcronyke.workers.dev"}],"paths":{"/purchase-order-revision-diff/v1/check":{"post":{"operationId":"purchase_order_revision_diff","summary":"Compare purchase-order revisions by stable line ID and show additions, removals, field changes and exact order-value deltas.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.04"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"previous":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"sku":{"type":"string","minLength":1,"maxLength":80},"units":{"type":"integer","minimum":1,"maximum":1000000},"unit_cents":{"type":"integer","minimum":0,"maximum":10000000},"due_day":{"type":"integer","minimum":0,"maximum":100000}},"required":["id","sku","units","unit_cents","due_day"],"additionalProperties":false}},"current":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"sku":{"type":"string","minLength":1,"maxLength":80},"units":{"type":"integer","minimum":1,"maximum":1000000},"unit_cents":{"type":"integer","minimum":0,"maximum":10000000},"due_day":{"type":"integer","minimum":0,"maximum":100000}},"required":["id","sku","units","unit_cents","due_day"],"additionalProperties":false}}},"required":["previous","current"],"additionalProperties":false},"example":{"previous":[{"id":"1","sku":"A","units":5,"unit_cents":200,"due_day":3},{"id":"2","sku":"B","units":1,"unit_cents":50,"due_day":4}],"current":[{"id":"1","sku":"A","units":4,"unit_cents":200,"due_day":5},{"id":"3","sku":"C","units":3,"unit_cents":80,"due_day":4}]}}}},"responses":{"200":{"description":"Service result","content":{"application/json":{"schema":{"type":"object"},"example":{"added":["3"],"removed":["2"],"changed":[{"id":"1","fields":[{"field":"units","before":5,"after":4},{"field":"due_day","before":3,"after":5}],"value_delta_cents":-200}],"previous_total_cents":1050,"current_total_cents":1040,"order_delta_cents":-10}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 exact payment required on Base"},"503":{"description":"Payment unavailable"}}}}}}