{"openapi":"3.1.0","info":{"title":"PawRegal agent API","version":"1.0.0","description":"Lets an AI assistant complete a PawRegal custom pet portrait order for its user: photo -> 4 previews -> user picks -> Shopify checkout link with the approved preview attached. The user pays on Shopify checkout; nothing is charged through this API. Portraits are AI-assisted and checked against the photo before printing. Rate limits: 30 requests/min per IP, 5 preview sets/hour per IP; back off on 429 and respect Retry-After. Human-readable store facts: https://pawregal.com/pages/about-pawregal-products","contact":{"email":"support@pawregal.com","url":"https://pawregal.com/pages/contact"}},"servers":[{"url":"https://pipeline-production-3436.up.railway.app"}],"paths":{"/api/agent/products":{"get":{"operationId":"listProducts","summary":"Products, variants (variant_id), prices in USD, styles and shipping rules","responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/api/agent/previews":{"post":{"operationId":"createPreviews","summary":"Start 4 portrait previews from a pet photo URL (about 20 s). Returns upload_id to poll.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["photo_url","consent_rights"],"properties":{"photo_url":{"type":"string","format":"uri","description":"Public https URL of a clear photo of ONE dog or cat, face visible. JPEG, PNG, WebP or HEIC, max 20 MB."},"consent_rights":{"type":"boolean","const":true,"description":"The user confirms they own the photo or have permission to use it."},"session_id":{"type":"string","description":"Optional id to group requests from one conversation."}}}}}},"responses":{"202":{"description":"Accepted","content":{"application/json":{"schema":{"type":"object","properties":{"upload_id":{"type":"string"},"status":{"type":"string","enum":["processing"]},"poll_url":{"type":"string"},"poll_after_s":{"type":"integer"}}}}}},"400":{"description":"Bad photo_url or missing consent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"413":{"description":"Photo too large"},"429":{"description":"Rate limited (Retry-After header)"}}}},"/api/agent/previews/{upload_id}":{"get":{"operationId":"getPreviews","summary":"Poll preview status. When status=ready, show all 4 image_url values to the user and let them choose.","parameters":[{"name":"upload_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Status","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["processing","ready","rejected","failed"]},"previews":{"type":"array","items":{"type":"object","properties":{"preview_id":{"type":"string"},"style":{"type":"string","enum":["festive","renaissance_royal","watercolor","santa_sweater","snowy_scene","cartoon_portrait","stained_glass","minimal_line_art"]},"style_label":{"type":"string"},"image_url":{"type":"string"}}}},"reasons":{"type":"array","items":{"type":"string"}},"next":{"type":"string"}}}}}},"404":{"description":"Unknown upload_id"}}}},"/api/agent/checkout":{"post":{"operationId":"createCheckout","summary":"After the user picked a preview: returns a Shopify checkout_url (and cart_url) carrying the approved preview as line-item properties. Call only with the user's explicit choice.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["preview_id"],"properties":{"preview_id":{"type":"string"},"product":{"type":"string","enum":["pet-portrait-ornament","pet-portrait-blanket-50x60","pet-portrait-canvas-12x16","pet-portrait-framed-canvas-16x20","pet-portrait-digital","pet-portrait-ornament-blanket-set"],"default":"pet-portrait-ornament"},"variant_id":{"type":"string","description":"Optional exact variant from listProducts."},"with_digital":{"type":"boolean","description":"Pick the \"+ Digital\" variant when variant_id is not given."},"quantity":{"type":"integer","minimum":1,"maximum":10,"default":1}}}}}},"responses":{"200":{"description":"Checkout link","content":{"application/json":{"schema":{"type":"object","properties":{"checkout_url":{"type":"string"},"cart_url":{"type":"string"},"product":{"type":"object"},"preview":{"type":"object"},"line_item_properties":{"type":"object"},"next":{"type":"string"}}}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"404":{"description":"Unknown preview_id"}}}}}}