{"openapi":"3.1.0","info":{"title":"StablePrint","description":"Server-priced Prodigi print-on-demand catalog, preview, quote, and order API.","version":"1.0.0","x-guidance":"# StablePrint\n\nStablePrint is a server-priced Prodigi print API. Use it to browse products, quote all-in USD checkout totals, create crop previews, then pay with x402/MPP to submit orders.\n\nHappy path:\n1. Search GET /api/catalog/products. Defaults are product ranges with SKU candidates. Use include_browse_only=true only for broader visual browsing.\n2. Show product_photos before asking the user to choose. For one product show 3-5 photos with captions and product_page_url.\n3. Get detail with GET /api/catalog/products/by-id/{productId}. Do not rely on slug uniqueness. If browse_only=true or has_sku_candidates=false, treat it as visual-only until you verify an SKU.\n4. Resolve SKU with GET /api/products/{sku}. required_for_quote attributes need exact allowed_values; recommended_attributes are safe defaults.\n5. Browse price with POST /api/quotes. Use total as the checkout price. If sellable=false or blocking_quote_issues is non-empty, choose another product/destination/shipping setup.\n6. Upload local artwork with StableUpload first. Draft asset URLs must be public direct PNG/JPEG/PDF URLs and must not cross-host redirect.\n7. Create POST /api/drafts with SIWX. Show previews before buying; verify sku, attributes, sizing, copies, ship country, total, pricing_policy, source_sha256_hash, preview_url_is_volatile, and preview_hashes.\n8. Create POST /api/order-intents with SIWX using draft_id, expected_total/currency, a fresh client_request_id, and every confirmed_preview_hash.\n9. Buy with POST /api/orders using only order_intent_id and order_intent_token. Poll/list via GET /api/orders.\n\nKey rules:\n- Product photos show the physical item; draft previews show the user's crop/placement. Show both before purchase.\n- preview_url is a volatile display aid; preview_hash and source_sha256_hash are the durable confirmation fields.\n- POST /api/quotes and POST /api/drafts return structured errors such as missing_required_attribute, invalid_attribute_value, missing_required_print_area, invalid_asset_url, and unsupported_quote_issues. Retry only when listed fields can be changed.\n- unsupported_quote_issues is a sellability block before payment/order submission, not a billing-card problem. Do not claim support unless POST /api/quotes returns sellable=true for that exact combination.\n- destinationCountryCode.UsSalesTaxWarning is non-blocking when sellable=true. Charge the returned total; do not add tax estimates.\n- For US destinations, total may include reserve_cost under pricing_policy. reserve_cost is not separately stated sales tax. Do not alter, waive, estimate, or explain it as tax.\n- Catalog example_skus are candidates from imported Prodigi pages. Always verify with GET /api/products/{sku}; if 404 or not quoteable, treat as browse-only and try another SKU.\n- Use fillPrintArea for normal cropping, fitPrintArea when no cropping is acceptable, stretchToPrintArea only when the user explicitly wants distortion.\n- StablePrint charges USD only. Drafts expire; recreate if destination, asset, SKU, copies, sizing, attributes, or quote changes.\n","guidance":"# StablePrint\n\nStablePrint is a server-priced Prodigi print API. Use it to browse products, quote all-in USD checkout totals, create crop previews, then pay with x402/MPP to submit orders.\n\nHappy path:\n1. Search GET /api/catalog/products. Defaults are product ranges with SKU candidates. Use include_browse_only=true only for broader visual browsing.\n2. Show product_photos before asking the user to choose. For one product show 3-5 photos with captions and product_page_url.\n3. Get detail with GET /api/catalog/products/by-id/{productId}. Do not rely on slug uniqueness. If browse_only=true or has_sku_candidates=false, treat it as visual-only until you verify an SKU.\n4. Resolve SKU with GET /api/products/{sku}. required_for_quote attributes need exact allowed_values; recommended_attributes are safe defaults.\n5. Browse price with POST /api/quotes. Use total as the checkout price. If sellable=false or blocking_quote_issues is non-empty, choose another product/destination/shipping setup.\n6. Upload local artwork with StableUpload first. Draft asset URLs must be public direct PNG/JPEG/PDF URLs and must not cross-host redirect.\n7. Create POST /api/drafts with SIWX. Show previews before buying; verify sku, attributes, sizing, copies, ship country, total, pricing_policy, source_sha256_hash, preview_url_is_volatile, and preview_hashes.\n8. Create POST /api/order-intents with SIWX using draft_id, expected_total/currency, a fresh client_request_id, and every confirmed_preview_hash.\n9. Buy with POST /api/orders using only order_intent_id and order_intent_token. Poll/list via GET /api/orders.\n\nKey rules:\n- Product photos show the physical item; draft previews show the user's crop/placement. Show both before purchase.\n- preview_url is a volatile display aid; preview_hash and source_sha256_hash are the durable confirmation fields.\n- POST /api/quotes and POST /api/drafts return structured errors such as missing_required_attribute, invalid_attribute_value, missing_required_print_area, invalid_asset_url, and unsupported_quote_issues. Retry only when listed fields can be changed.\n- unsupported_quote_issues is a sellability block before payment/order submission, not a billing-card problem. Do not claim support unless POST /api/quotes returns sellable=true for that exact combination.\n- destinationCountryCode.UsSalesTaxWarning is non-blocking when sellable=true. Charge the returned total; do not add tax estimates.\n- For US destinations, total may include reserve_cost under pricing_policy. reserve_cost is not separately stated sales tax. Do not alter, waive, estimate, or explain it as tax.\n- Catalog example_skus are candidates from imported Prodigi pages. Always verify with GET /api/products/{sku}; if 404 or not quoteable, treat as browse-only and try another SKU.\n- Use fillPrintArea for normal cropping, fitPrintArea when no cropping is acceptable, stretchToPrintArea only when the user explicitly wants distortion.\n- StablePrint charges USD only. Drafts expire; recreate if destination, asset, SKU, copies, sizing, attributes, or quote changes.\n","contact":{"name":"Merit Systems","url":"https://stableprint.dev"}},"servers":[{"url":"https://stableprint.dev"}],"tags":[{"name":"Catalog"},{"name":"Drafts"},{"name":"Order Intents"},{"name":"Orders"},{"name":"Products"},{"name":"Quotes"}],"paths":{"/api/catalog/categories":{"get":{"operationId":"catalog_categories","summary":"List product categories discovered from Prodigi public product pages.","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"category":{"type":"string"},"product_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["category","product_count"],"additionalProperties":false}}},"required":["categories"],"additionalProperties":false}}}}}}},"/api/catalog/products":{"get":{"operationId":"catalog_products_list","summary":"Search or paginate imported Prodigi catalog entries. Defaults to product-range entries with SKU candidates; pass include_browse_only=true to include category, region, unknown, and SKU-less browse pages. Results include stable id, canonical_path, browse_only flags, and compact product_photos/images. Use GET /api/catalog/products/by-id/{productId} for detail.","tags":["Catalog"],"security":[],"parameters":[{"in":"query","name":"q","schema":{"type":"string","minLength":1,"maxLength":120}},{"in":"query","name":"category","schema":{"type":"string","minLength":1,"maxLength":120}},{"in":"query","name":"kind","schema":{"type":"string","enum":["product_range","category","region","landing","unknown"]}},{"in":"query","name":"include_browse_only","schema":{"type":"boolean"}},{"in":"query","name":"page","schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"in":"query","name":"per_page","schema":{"default":20,"type":"integer","minimum":1,"maximum":50}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"canonical_path":{"type":"string"},"kind":{"type":"string"},"browse_only":{"type":"boolean"},"has_sku_candidates":{"type":"boolean"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"product_page_url":{"type":"string","format":"uri"},"image_url":{"type":"string","format":"uri"},"images":{"default":[],"type":"array","items":{"type":"string","format":"uri"}},"product_photos":{"default":[],"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"label":{"type":"string"},"thumbnail_url":{"type":"string","format":"uri"},"source":{"type":"string","enum":["hero","gallery","product_photography"]}},"required":["url","source"],"additionalProperties":false}},"sku_prefix":{"type":"string"},"example_skus":{"default":[],"type":"array","items":{"type":"string"}}},"required":["id","slug","canonical_path","kind","browse_only","has_sku_candidates","title","product_page_url","images","product_photos","example_skus"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"per_page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","per_page","total","total_pages"],"additionalProperties":false}},"required":["products","pagination"],"additionalProperties":false}}}}}}},"/api/catalog/products/by-id/{productId}":{"get":{"operationId":"catalog_products_get-by-id","summary":"Get one imported Prodigi catalog entry by stable catalog id. Prefer this over slug lookup because public Prodigi slugs are not globally unique. Returns the complete product_photos/images gallery, SKU candidates when known, setup downloads, browse_only/orderability flags, and full Prodigi page URL.","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"canonical_path":{"type":"string"},"kind":{"type":"string"},"browse_only":{"type":"boolean"},"has_sku_candidates":{"type":"boolean"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"product_page_url":{"type":"string","format":"uri"},"image_url":{"type":"string","format":"uri"},"images":{"default":[],"type":"array","items":{"type":"string","format":"uri"}},"product_photos":{"default":[],"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"label":{"type":"string"},"thumbnail_url":{"type":"string","format":"uri"},"source":{"type":"string","enum":["hero","gallery","product_photography"]}},"required":["url","source"],"additionalProperties":false}},"sku_prefix":{"type":"string"},"example_skus":{"default":[],"type":"array","items":{"type":"string"}},"downloads":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}},"notes":{"default":[],"type":"array","items":{"type":"string"}}},"required":["id","slug","canonical_path","kind","browse_only","has_sku_candidates","title","product_page_url","images","product_photos","example_skus","downloads","notes"],"additionalProperties":false}}}}}}},"/api/catalog/products/{slug}":{"get":{"operationId":"catalog_products_get","summary":"Legacy lookup for an imported Prodigi catalog entry by slug. Slugs are not globally unique; prefer GET /api/catalog/products/by-id/{productId} using id from search results. Ambiguous slugs return 409.","tags":["Catalog"],"security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"canonical_path":{"type":"string"},"kind":{"type":"string"},"browse_only":{"type":"boolean"},"has_sku_candidates":{"type":"boolean"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string"},"product_page_url":{"type":"string","format":"uri"},"image_url":{"type":"string","format":"uri"},"images":{"default":[],"type":"array","items":{"type":"string","format":"uri"}},"product_photos":{"default":[],"type":"array","items":{"type":"object","properties":{"url":{"type":"string","format":"uri"},"label":{"type":"string"},"thumbnail_url":{"type":"string","format":"uri"},"source":{"type":"string","enum":["hero","gallery","product_photography"]}},"required":["url","source"],"additionalProperties":false}},"sku_prefix":{"type":"string"},"example_skus":{"default":[],"type":"array","items":{"type":"string"}},"downloads":{"default":[],"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["url"],"additionalProperties":false}},"notes":{"default":[],"type":"array","items":{"type":"string"}}},"required":["id","slug","canonical_path","kind","browse_only","has_sku_candidates","title","product_page_url","images","product_photos","example_skus","downloads","notes"],"additionalProperties":false}}}}}}},"/api/products/{sku}":{"get":{"operationId":"products_get","summary":"Get authoritative Prodigi Product Details for one SKU, including print areas, normalized attributes with required_for_quote and allowed_values, recommended_attributes, attribute combinations, destination support, and raw Prodigi data.","tags":["Products"],"security":[],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"product_page_url":{"type":"string","format":"uri"},"print_areas":{"default":[],"type":"array","items":{"type":"object","properties":{"print_area":{"type":"string"},"width_mm":{"type":"number","exclusiveMinimum":0},"height_mm":{"type":"number","exclusiveMinimum":0},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"source":{"type":"string"}},"required":["print_area"],"additionalProperties":false}},"attributes":{"default":[],"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"required_for_quote":{"type":"boolean"},"allowed_values":{"default":[],"type":"array","items":{"type":"string"}},"default_value":{"type":"string"}},"required":["key","required_for_quote","allowed_values"],"additionalProperties":false}},"recommended_attributes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"attribute_combinations":{"default":[],"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"raw":{"type":"object","properties":{},"additionalProperties":{}},"fetched_at":{"type":"string"}},"required":["sku","print_areas","attributes","recommended_attributes","attribute_combinations","raw","fetched_at"],"additionalProperties":false}}}}}}},"/api/quotes":{"post":{"operationId":"quotes_create","summary":"Get StablePrint all-in checkout quote options for SKU/attributes/destination without requiring asset URLs or SIWX. Use this for browsing and price comparison before creating a draft with artwork previews. For US destinations, total may include reserve_cost under pricing_policy. If sellable=false or blocking_quote_issues is non-empty, StablePrint cannot sell that combination. Missing/invalid attributes return structured JSON with allowed values.","tags":["Quotes"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"destination_country_code":{"type":"string","minLength":2,"maxLength":2},"currency_code":{"default":"USD","type":"string","const":"USD"},"shipping_method":{"type":"string","enum":["budget","standard","standardplus","express","overnight"]},"items":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","minLength":1,"maxLength":120},"copies":{"default":1,"type":"integer","minimum":1,"maximum":100},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"print_areas":{"default":["default"],"minItems":1,"maxItems":25,"type":"array","items":{"type":"string","minLength":1}},"page_count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["sku"]}}},"required":["destination_country_code","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"sellable":{"type":"boolean"},"selected_shipping_method":{"type":"string"},"currency":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"total":{"type":"number","minimum":0},"quotes":{"type":"array","items":{"type":"object","properties":{"shipping_method":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"total":{"type":"number","minimum":0},"currency":{"type":"string"},"issues":{"default":[],"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}}},"required":["shipping_method","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","total","currency","issues"],"additionalProperties":false}},"quote_issues":{"default":[],"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"blocking":{"type":"boolean"},"raw":{}},"required":["code","blocking","raw"],"additionalProperties":false}},"blocking_quote_issues":{"default":[],"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"blocking":{"type":"boolean"},"raw":{}},"required":["code","blocking","raw"],"additionalProperties":false}},"defaulted_attributes":{"default":[],"type":"array","items":{"type":"object","properties":{"item_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sku":{"type":"string"},"key":{"type":"string"},"value":{"type":"string"},"reason":{"type":"string"}},"required":["item_index","sku","key","value","reason"],"additionalProperties":false}},"quote_request":{"type":"object","properties":{},"additionalProperties":{}}},"required":["sellable","currency","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","total","quotes","quote_issues","blocking_quote_issues","defaulted_attributes","quote_request"],"additionalProperties":false}}}}}}},"/api/drafts":{"post":{"operationId":"drafts_create","summary":"Create an SIWX-owned print draft only for combinations StablePrint can sell. Returns all-in checkout quote options, selected total, pricing_policy, asset digests, and preview hashes. Show previews before buying. Unsupported quote issues return structured unsupported_quote_issues instead of a dead-end draft.","tags":["Drafts"],"security":[{"siwx":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_request_id":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[a-zA-Z0-9._:-]+$"},"destination_country_code":{"type":"string","minLength":2,"maxLength":2},"currency_code":{"default":"USD","type":"string","const":"USD"},"shipping_method":{"type":"string","enum":["budget","standard","standardplus","express","overnight"]},"recipient":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"email":{"type":"string","maxLength":120,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone_number":{"type":"string","minLength":7,"maxLength":40},"address":{"type":"object","properties":{"line1":{"type":"string","minLength":1,"maxLength":100},"line2":{"type":"string","maxLength":100},"postal_or_zip_code":{"type":"string","minLength":1,"maxLength":24},"country_code":{"type":"string","minLength":2,"maxLength":2},"town_or_city":{"type":"string","minLength":1,"maxLength":100},"state_or_county":{"type":"string","maxLength":100}},"required":["line1","postal_or_zip_code","country_code","town_or_city"]}},"required":["name","address"]},"items":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"sku":{"type":"string","minLength":1,"maxLength":120},"copies":{"default":1,"type":"integer","minimum":1,"maximum":100},"sizing":{"default":"fillPrintArea","type":"string","enum":["fillPrintArea","fitPrintArea","stretchToPrintArea"]},"attributes":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"assets":{"minItems":1,"maxItems":25,"type":"array","items":{"type":"object","properties":{"print_area":{"default":"default","type":"string","minLength":1},"url":{"type":"string","format":"uri"},"md5_hash":{"type":"string","minLength":16,"maxLength":64}},"required":["url"]}},"page_count":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"merchant_reference":{"type":"string","maxLength":128}},"required":["sku","assets"]}},"metadata":{"type":"string","maxLength":500}},"required":["client_request_id","destination_country_code","items"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"draft_id":{"type":"string"},"status":{"type":"string"},"buyable":{"type":"boolean"},"client_request_id":{"type":"string"},"destination_country_code":{"type":"string"},"selected_shipping_method":{"type":"string"},"currency":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"total":{"type":"number","minimum":0},"quotes":{"type":"array","items":{"type":"object","properties":{"shipping_method":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"total":{"type":"number","minimum":0},"currency":{"type":"string"},"issues":{"default":[],"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}}},"required":["shipping_method","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","total","currency","issues"],"additionalProperties":false}},"quote_issues":{"default":[],"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"blocking":{"type":"boolean"},"raw":{}},"required":["code","blocking","raw"],"additionalProperties":false}},"blocking_quote_issues":{"default":[],"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"blocking":{"type":"boolean"},"raw":{}},"required":["code","blocking","raw"],"additionalProperties":false}},"previews":{"type":"array","items":{"type":"object","properties":{"item_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"asset_index":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sku":{"type":"string"},"print_area":{"type":"string"},"sizing":{"type":"string"},"attributes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"preview_url":{"type":"string"},"preview_url_is_volatile":{"type":"boolean"},"preview_url_note":{"type":"string"},"preview_hash":{"type":"string"},"source_url":{"type":"string","format":"uri"},"resolved_source_url":{"type":"string","format":"uri"},"source_sha256_hash":{"type":"string"},"source_md5_hash":{"type":"string"},"source_content_type":{"type":"string"},"source_byte_length":{"type":"integer","minimum":0,"maximum":9007199254740991},"source_fetched_at":{"type":"string"},"renderer_version":{"type":"string"},"placement":{"type":"object","properties":{"source_width":{"type":"number","exclusiveMinimum":0},"source_height":{"type":"number","exclusiveMinimum":0},"oriented_source_width":{"type":"number","exclusiveMinimum":0},"oriented_source_height":{"type":"number","exclusiveMinimum":0},"print_area_width":{"type":"number","exclusiveMinimum":0},"print_area_height":{"type":"number","exclusiveMinimum":0},"sizing":{"type":"string"},"rotation_degrees":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"crop_left_percent":{"type":"number"},"crop_top_percent":{"type":"number"},"crop_right_percent":{"type":"number"},"crop_bottom_percent":{"type":"number"}},"required":["sizing","rotation_degrees","crop_left_percent","crop_top_percent","crop_right_percent","crop_bottom_percent"],"additionalProperties":false},"notes":{"default":[],"type":"array","items":{"type":"string"}}},"required":["item_index","asset_index","sku","print_area","sizing","attributes","preview_url","preview_url_is_volatile","preview_url_note","preview_hash","source_url","resolved_source_url","source_sha256_hash","source_md5_hash","source_content_type","source_byte_length","source_fetched_at","renderer_version","placement","notes"],"additionalProperties":false}},"expires_at":{"type":"string"},"created_at":{"type":"string"}},"required":["draft_id","status","buyable","client_request_id","destination_country_code","currency","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","total","quotes","quote_issues","blocking_quote_issues","previews","expires_at","created_at"],"additionalProperties":false}}}},"402":{"description":"Authentication Required"}}}},"/api/drafts/{draftId}":{"get":{"operationId":"drafts_get","summary":"Retrieve an SIWX-owned print draft and its preview artifacts before purchase.","tags":["Drafts"],"security":[{"siwx":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"draft_id":{"type":"string"},"status":{"type":"string"},"buyable":{"type":"boolean"},"client_request_id":{"type":"string"},"destination_country_code":{"type":"string"},"selected_shipping_method":{"type":"string"},"currency":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"total":{"type":"number","minimum":0},"quotes":{"type":"array","items":{"type":"object","properties":{"shipping_method":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"total":{"type":"number","minimum":0},"currency":{"type":"string"},"issues":{"default":[],"type":"array","items":{"type":"object","properties":{},"additionalProperties":{}}}},"required":["shipping_method","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","total","currency","issues"],"additionalProperties":false}},"quote_issues":{"default":[],"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"blocking":{"type":"boolean"},"raw":{}},"required":["code","blocking","raw"],"additionalProperties":false}},"blocking_quote_issues":{"default":[],"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"blocking":{"type":"boolean"},"raw":{}},"required":["code","blocking","raw"],"additionalProperties":false}},"previews":{"type":"array","items":{"type":"object","properties":{"item_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"asset_index":{"default":0,"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"sku":{"type":"string"},"print_area":{"type":"string"},"sizing":{"type":"string"},"attributes":{"default":{},"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"preview_url":{"type":"string"},"preview_url_is_volatile":{"type":"boolean"},"preview_url_note":{"type":"string"},"preview_hash":{"type":"string"},"source_url":{"type":"string","format":"uri"},"resolved_source_url":{"type":"string","format":"uri"},"source_sha256_hash":{"type":"string"},"source_md5_hash":{"type":"string"},"source_content_type":{"type":"string"},"source_byte_length":{"type":"integer","minimum":0,"maximum":9007199254740991},"source_fetched_at":{"type":"string"},"renderer_version":{"type":"string"},"placement":{"type":"object","properties":{"source_width":{"type":"number","exclusiveMinimum":0},"source_height":{"type":"number","exclusiveMinimum":0},"oriented_source_width":{"type":"number","exclusiveMinimum":0},"oriented_source_height":{"type":"number","exclusiveMinimum":0},"print_area_width":{"type":"number","exclusiveMinimum":0},"print_area_height":{"type":"number","exclusiveMinimum":0},"sizing":{"type":"string"},"rotation_degrees":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"crop_left_percent":{"type":"number"},"crop_top_percent":{"type":"number"},"crop_right_percent":{"type":"number"},"crop_bottom_percent":{"type":"number"}},"required":["sizing","rotation_degrees","crop_left_percent","crop_top_percent","crop_right_percent","crop_bottom_percent"],"additionalProperties":false},"notes":{"default":[],"type":"array","items":{"type":"string"}}},"required":["item_index","asset_index","sku","print_area","sizing","attributes","preview_url","preview_url_is_volatile","preview_url_note","preview_hash","source_url","resolved_source_url","source_sha256_hash","source_md5_hash","source_content_type","source_byte_length","source_fetched_at","renderer_version","placement","notes"],"additionalProperties":false}},"expires_at":{"type":"string"},"created_at":{"type":"string"}},"required":["draft_id","status","buyable","client_request_id","destination_country_code","currency","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","total","quotes","quote_issues","blocking_quote_issues","previews","expires_at","created_at"],"additionalProperties":false}}}},"402":{"description":"Authentication Required"}}}},"/api/order-intents":{"post":{"operationId":"order-intents_create","summary":"Create a SIWX-owned paid order intent from a buyable draft after the buyer confirms every preview_hash. Revalidates the all-in checkout total and immutable asset digests before returning an order_intent_token for POST /api/orders. Blocking quote issues return unsupported_quote_issues.","tags":["Order Intents"],"security":[{"siwx":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"draft_id":{"type":"string","minLength":1},"client_request_id":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[a-zA-Z0-9._:-]+$"},"expected_total":{"type":"number","minimum":0},"expected_currency":{"default":"USD","type":"string","const":"USD"},"confirmed_preview_hashes":{"minItems":1,"type":"array","items":{"type":"string","minLength":16}}},"required":["draft_id","client_request_id","expected_total","confirmed_preview_hashes"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"order_intent_id":{"type":"string"},"order_intent_token":{"type":"string"},"draft_id":{"type":"string"},"status":{"type":"string"},"client_request_id":{"type":"string"},"selected_shipping_method":{"type":"string"},"currency":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"total":{"type":"number","minimum":0},"expires_at":{"type":"string"},"created_at":{"type":"string"}},"required":["order_intent_id","draft_id","status","client_request_id","currency","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","total","expires_at","created_at"],"additionalProperties":false}}}},"402":{"description":"Authentication Required"}}}},"/api/orders":{"post":{"operationId":"orders_create","summary":"Pay the exact revalidated StablePrint all-in checkout total from POST /api/order-intents and submit one order. Body must include order_intent_id and order_intent_token.","tags":["Orders"],"x-payment-info":{"price":{"mode":"dynamic","currency":"USD","min":"0.01","max":"500.00"},"protocols":[{"x402":{}},{"mpp":{"method":"tempo","intent":"charge","currency":"0x20c000000000000000000000b9537d11c60e8b50"}}]},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"order_intent_id":{"type":"string","minLength":1},"order_intent_token":{"type":"string","minLength":32,"maxLength":160}},"required":["order_intent_id","order_intent_token"],"additionalProperties":false}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"status":{"type":"string"},"prodigi_order_id":{"type":"string"},"draft_id":{"type":"string"},"client_request_id":{"type":"string"},"shipping_method":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"charged_total":{"type":"number","minimum":0},"currency":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["order_id","status","client_request_id","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","charged_total","currency","created_at","updated_at"],"additionalProperties":false}}}},"402":{"description":"Payment Required"}}},"get":{"operationId":"orders_list","summary":"List StablePrint orders purchased by the signing wallet.","tags":["Orders"],"security":[{"siwx":[]}],"parameters":[{"in":"query","name":"page","schema":{"default":1,"type":"integer","minimum":1,"maximum":9007199254740991}},{"in":"query","name":"per_page","schema":{"default":20,"type":"integer","minimum":1,"maximum":50}},{"in":"query","name":"status","schema":{"type":"string","minLength":1,"maxLength":40}}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"orders":{"type":"array","items":{"type":"object","properties":{"order_id":{"type":"string"},"status":{"type":"string"},"prodigi_order_id":{"type":"string"},"draft_id":{"type":"string"},"client_request_id":{"type":"string"},"shipping_method":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"charged_total":{"type":"number","minimum":0},"currency":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["order_id","status","client_request_id","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","charged_total","currency","created_at","updated_at"],"additionalProperties":false}},"pagination":{"type":"object","properties":{"page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"per_page":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_pages":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["page","per_page","total","total_pages"],"additionalProperties":false}},"required":["orders","pagination"],"additionalProperties":false}}}},"402":{"description":"Authentication Required"}}}},"/api/orders/{orderId}":{"get":{"operationId":"orders_get","summary":"Retrieve a StablePrint order by local order ID or Prodigi order ID. Requires the wallet that bought it.","tags":["Orders"],"security":[{"siwx":[]}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"string"},"status":{"type":"string"},"prodigi_order_id":{"type":"string"},"draft_id":{"type":"string"},"client_request_id":{"type":"string"},"shipping_method":{"type":"string"},"item_cost":{"type":"number","minimum":0},"shipping_cost":{"type":"number","minimum":0},"branding_cost":{"type":"number","minimum":0},"tax_cost":{"type":"number","minimum":0},"reserve_cost":{"type":"number","minimum":0},"pricing_policy":{"type":"string"},"charged_total":{"type":"number","minimum":0},"currency":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["order_id","status","client_request_id","item_cost","shipping_cost","branding_cost","tax_cost","reserve_cost","pricing_policy","charged_total","currency","created_at","updated_at"],"additionalProperties":false}}}},"402":{"description":"Authentication Required"}}}}},"components":{"securitySchemes":{"siwx":{"type":"apiKey","in":"header","name":"SIGN-IN-WITH-X"}}}}