{"openapi":"3.1.0","info":{"title":"Package Serial Containment","version":"1.0.0","description":"Expand a pallet or carton hierarchy into item serials, then flag duplicate containers, duplicated serials, unmanifested scans and missing items.","contact":{"email":"jeremy@jeremycarter.ca"}},"servers":[{"url":"https://gptenv-x402-catalog.defcronyke.workers.dev"}],"paths":{"/package-serial-containment/v1/check":{"post":{"operationId":"package_serial_containment","summary":"Expand a pallet or carton hierarchy into item serials, then flag duplicate containers, duplicated serials, unmanifested scans and missing items.","x-payment-info":{"protocols":[{"x402":{}}],"price":{"mode":"fixed","currency":"USD","amount":"0.04"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"root":{"type":"string","minLength":1,"maxLength":80},"packages":{"minItems":1,"maxItems":150,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"children":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}},"serials":{"maxItems":100,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["id","children","serials"],"additionalProperties":false}},"scans":{"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":80}}},"required":["root","packages","scans"],"additionalProperties":false},"example":{"root":"pallet","packages":[{"id":"pallet","children":["outer","extra"],"serials":[]},{"id":"outer","children":["inner"],"serials":["b"]},{"id":"inner","children":[],"serials":["a"]},{"id":"extra","children":["inner"],"serials":["b","c"]}],"scans":["a","a","x","b"]}}}},"responses":{"200":{"description":"Service result","content":{"application/json":{"schema":{"type":"object"},"example":{"manifest_serials":3,"matched_serials":2,"missing_serials":["c"],"unmanifested_scans":["x"],"duplicate_scans":["a"],"duplicate_serials":["b"],"repeated_packages":["inner"]}}}},"400":{"description":"Invalid request"},"402":{"description":"x402 exact payment required on Base"},"503":{"description":"Payment unavailable"}}}}}}