{"openapi":"3.1.0","info":{"title":"nanoSEO Agent API","version":"1.2","description":"Accountless API for purchasing and retrieving nanoSEO site audits. Orders use NanSwap Pay's server API and return machine-readable payment instructions. Error responses use {\"error\": \"message\"} and agent routes include CORS headers.","contact":{"name":"nanoSEO","url":"https://nano-seo.com/contact"},"license":{"name":"Proprietary","url":"https://nano-seo.com/terms"}},"servers":[{"url":"https://nano-seo.com"}],"security":[],"tags":[{"name":"Discovery","description":"Discovery and catalog endpoints."},{"name":"Orders","description":"Create and poll paid audit orders."},{"name":"Reports","description":"Read and export completed reports."}],"paths":{"/api/v1/agent":{"get":{"tags":["Discovery"],"operationId":"getAgentManifest","summary":"Get the agent integration manifest","responses":{"200":{"description":"Agent API discovery document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Manifest"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"options":{"operationId":"agentManifestOptions","summary":"CORS preflight","responses":{"204":{"description":"CORS preflight response. Agent routes allow GET, POST and OPTIONS from any origin.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Headers":{"schema":{"type":"string"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/agent/openapi":{"get":{"tags":["Discovery"],"operationId":"getAgentOpenApi","summary":"Get this OpenAPI 3.1 specification","responses":{"200":{"description":"OpenAPI 3.1 document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiDocument"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"options":{"operationId":"agentOpenApiOptions","summary":"CORS preflight","responses":{"204":{"description":"CORS preflight response. Agent routes allow GET, POST and OPTIONS from any origin.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Headers":{"schema":{"type":"string"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/agent/plans":{"get":{"tags":["Discovery"],"operationId":"listAgentPlans","summary":"List audit plans and website categories","responses":{"200":{"description":"Active plans, prices, page limits, capabilities and categories.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentCatalog"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"options":{"operationId":"agentPlansOptions","summary":"CORS preflight","responses":{"204":{"description":"CORS preflight response. Agent routes allow GET, POST and OPTIONS from any origin.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Headers":{"schema":{"type":"string"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/agent/orders":{"post":{"tags":["Orders"],"operationId":"createAgentOrder","summary":"Create an audit order and NanSwap payment request","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[!-~]{8,128}$"},"description":"Stable unique key for one intended order. Takes precedence over the body idempotency_key. Use 8-128 printable ASCII characters without spaces. Surrounding whitespace is trimmed before validation. Reuse the same key for every retry."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"200":{"description":"Existing order returned for an idempotent replay. The Idempotency-Replayed header is true.","headers":{"Location":{"schema":{"type":"string","format":"uri"},"description":"Status URL for the existing order."},"Idempotency-Replayed":{"schema":{"type":"string","const":"true"},"description":"Present when the request matched an existing order."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOrder"}}}},"201":{"description":"Order created. The Location header points at the status URL.","headers":{"Location":{"schema":{"type":"string","format":"uri"},"description":"Status URL for the created order."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOrder"}}}},"400":{"description":"Invalid order request, invalid idempotency key, or a payment request rejected by NanSwap Pay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The Idempotency-Key was already used for a different order request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"The payment provider is temporarily unavailable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"NanSwap Pay is not configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"options":{"operationId":"agentOrdersOptions","summary":"CORS preflight","responses":{"204":{"description":"CORS preflight response. Agent routes allow GET, POST and OPTIONS from any origin.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Headers":{"schema":{"type":"string"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/agent/orders/{order_id}":{"get":{"tags":["Orders"],"operationId":"getAgentOrderStatus","summary":"Get payment and audit status","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"The order_id returned by POST /api/v1/agent/orders. It is the report ID as well."}],"responses":{"200":{"description":"Current order status, payment instructions and next action.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOrder"}}}},"400":{"description":"The order identifier is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Order not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"options":{"operationId":"agentOrderStatusOptions","summary":"CORS preflight","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"The order_id returned by POST /api/v1/agent/orders. It is the report ID as well."}],"responses":{"204":{"description":"CORS preflight response. Agent routes allow GET, POST and OPTIONS from any origin.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Headers":{"schema":{"type":"string"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/demo/pay":{"post":{"tags":["Orders"],"operationId":"demoPayAgentOrder","summary":"Mark a demo order as paid","description":"Available only when the deployment enables demo payments. When live NanSwap payments are enabled this route returns 404.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoPaymentRequest"}}}},"responses":{"200":{"description":"Demo payment accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoPaymentResponse"}}}},"400":{"description":"order_id is missing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Demo payments are disabled or the order does not exist.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"options":{"operationId":"demoPayOptions","summary":"CORS preflight","responses":{"204":{"description":"CORS preflight response. Agent routes allow GET, POST and OPTIONS from any origin.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Headers":{"schema":{"type":"string"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/audits/{order_id}":{"get":{"tags":["Reports"],"operationId":"getAgentReport","summary":"Get the completed audit report","description":"Paid reports are retained for 14 days after completion; free daily-check reports are retained for 2 days. After the applicable period, report JSON, pages and findings are purged and this route returns 410. Orders and payment records are preserved.","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"The order_id returned by POST /api/v1/agent/orders. It is the report ID as well."}],"responses":{"200":{"description":"Completed audit report.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"404":{"description":"The order or audit does not exist, or the audit has not started yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The audit is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"The report has expired and its detailed data has been purged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"options":{"operationId":"agentReportOptions","summary":"CORS preflight","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"The order_id returned by POST /api/v1/agent/orders. It is the report ID as well."}],"responses":{"204":{"description":"CORS preflight response. Agent routes allow GET, POST and OPTIONS from any origin.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Headers":{"schema":{"type":"string"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/audits/{order_id}/export":{"get":{"tags":["Reports"],"operationId":"exportAgentReport","summary":"Export a completed audit report","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"The order_id returned by POST /api/v1/agent/orders. It is the report ID as well."},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["csv","json"],"default":"csv"},"description":"csv returns text/csv; json returns application/json. Unknown formats return 400."}],"responses":{"200":{"description":"Report export. The content type depends on format.","content":{"text/csv":{"schema":{"type":"string"}},"application/json":{"schema":{"$ref":"#/components/schemas/Report"}}}},"400":{"description":"format must be csv or json.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The order or audit does not exist, or the audit has not started yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The audit is still running.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"The report has expired and its detailed data has been purged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Unexpected server error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"options":{"operationId":"agentReportExportOptions","summary":"CORS preflight","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","minLength":1},"description":"The order_id returned by POST /api/v1/agent/orders. It is the report ID as well."}],"responses":{"204":{"description":"CORS preflight response. Agent routes allow GET, POST and OPTIONS from any origin.","headers":{"Access-Control-Allow-Origin":{"schema":{"type":"string","const":"*"}},"Access-Control-Allow-Methods":{"schema":{"type":"string"}},"Access-Control-Allow-Headers":{"schema":{"type":"string"}}}},"405":{"description":"The HTTP method is not supported for this route.","headers":{"Allow":{"schema":{"type":"string"},"description":"Comma-separated list of supported methods."}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"string","description":"Human-readable error message."}}},"OpenApiDocument":{"type":"object","additionalProperties":true,"description":"An OpenAPI 3.1 document."},"EndpointRef":{"type":"object","additionalProperties":false,"required":["method","url"],"properties":{"method":{"type":"string","enum":["GET","POST"]},"url":{"type":"string","format":"uri"}}},"Amount":{"type":"object","additionalProperties":false,"required":["cents","currency","display"],"properties":{"cents":{"type":"integer","minimum":0},"currency":{"type":"string"},"display":{"type":"string","pattern":"^[0-9]+\\.[0-9]{2}$"}}},"Manifest":{"type":"object","additionalProperties":false,"required":["name","schema_version","description","documentation_url","openapi_url","authentication","content_type","endpoints","required_order_fields","optional_order_fields","defaults","flow","payment","idempotency","limits","report","errors","ordering_note"],"properties":{"name":{"type":"string"},"schema_version":{"type":"string"},"description":{"type":"string"},"documentation_url":{"type":"string","format":"uri"},"openapi_url":{"type":"string","format":"uri"},"authentication":{"type":"string"},"content_type":{"type":"string"},"endpoints":{"type":"object","additionalProperties":false,"required":["manifest","plans","openapi","create_order","order_status","report","report_exports"],"properties":{"manifest":{"$ref":"#/components/schemas/EndpointRef"},"plans":{"$ref":"#/components/schemas/EndpointRef"},"openapi":{"$ref":"#/components/schemas/EndpointRef"},"create_order":{"$ref":"#/components/schemas/EndpointRef"},"order_status":{"$ref":"#/components/schemas/EndpointRef"},"report":{"$ref":"#/components/schemas/EndpointRef"},"report_exports":{"$ref":"#/components/schemas/EndpointRef"}}},"required_order_fields":{"type":"array","items":{"type":"string"}},"optional_order_fields":{"type":"array","items":{"type":"string"}},"defaults":{"type":"object","additionalProperties":false,"required":["category_id","scan_mode","payin_currency","selected_urls"],"properties":{"category_id":{"type":"string"},"scan_mode":{"type":"string","enum":["auto","manual"]},"payin_currency":{"type":"string"},"selected_urls":{"type":"array","items":{"type":"string"}}}},"flow":{"type":"array","items":{"type":"string"}},"payment":{"type":"object","additionalProperties":false,"required":["provider","mode","note","amount_rule","network_fees","confirmation","demo_mode_available"],"properties":{"provider":{"type":"string"},"mode":{"type":"string"},"note":{"type":"string"},"amount_rule":{"type":"string"},"network_fees":{"type":"string"},"confirmation":{"type":"string"},"demo_mode_available":{"type":"boolean"}}},"idempotency":{"type":"object","additionalProperties":false,"required":["header","optional_body_field","precedence","key_format","note"],"properties":{"header":{"type":"string"},"optional_body_field":{"type":"string"},"precedence":{"type":"string"},"key_format":{"type":"string"},"note":{"type":"string"}}},"limits":{"type":"object","additionalProperties":false,"required":["selected_pages_maximum","order_status_poll_seconds","automatic_order_dedupe_seconds","report_retention_days"],"properties":{"selected_pages_maximum":{"type":"integer"},"order_status_poll_seconds":{"type":"integer"},"automatic_order_dedupe_seconds":{"type":"integer"},"report_retention_days":{"type":"integer"}}},"report":{"type":"object","additionalProperties":false,"required":["retention_days","expired_status","export_formats"],"properties":{"retention_days":{"type":"integer"},"expired_status":{"type":"integer"},"export_formats":{"type":"array","items":{"type":"string","enum":["csv","json"]}}}},"errors":{"type":"object","additionalProperties":false,"required":["format","cors"],"properties":{"format":{"type":"string"},"cors":{"type":"boolean"}}},"ordering_note":{"type":"string"}}},"AgentCatalog":{"type":"object","additionalProperties":false,"required":["schema_version","currency","default_payin_currency","plans","categories","order_endpoint","documentation_url"],"properties":{"schema_version":{"type":"string"},"currency":{"type":"string"},"default_payin_currency":{"type":"string"},"plans":{"type":"array","items":{"$ref":"#/components/schemas/Plan"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"order_endpoint":{"type":"string"},"documentation_url":{"type":"string"}}},"Plan":{"type":"object","additionalProperties":false,"required":["id","name","description","page_limit","best_for","tier","price","features","capabilities"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"page_limit":{"type":"integer","minimum":1},"best_for":{"type":["string","null"]},"tier":{"type":["string","null"]},"price":{"$ref":"#/components/schemas/Amount"},"features":{"type":"array","items":{"type":"string"}},"capabilities":{"type":"object","additionalProperties":true}}},"Category":{"type":"object","additionalProperties":false,"required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"}}},"CreateOrderRequest":{"type":"object","additionalProperties":true,"description":"Unknown top-level fields are ignored. Only package_id, target_url and terms_accepted are required.","required":["package_id","target_url","terms_accepted"],"properties":{"package_id":{"type":"string","minLength":1,"examples":["site-10"],"description":"Use a paid plan id returned by GET /api/v1/agent/plans. The Free Daily Check is available on the website only and is rejected here."},"target_url":{"type":"string","format":"uri","examples":["https://example.com"],"description":"Public HTTP or HTTPS URL. Private hosts and URL credentials are rejected."},"category_id":{"type":"string","default":"general","pattern":"^[a-z0-9][a-z0-9-]{1,31}$","description":"Must be an active category id from GET /api/v1/agent/plans. Case-insensitive; normalized to lowercase."},"scan_mode":{"type":"string","enum":["auto","manual"],"default":"auto","description":"Case-insensitive; normalized to auto or manual."},"selected_urls":{"type":"array","maxItems":25,"items":{"type":"string","format":"uri"},"description":"Required when scan_mode is manual. Every URL must share the target URL's origin and stay within the selected plan's page limit."},"discount_code":{"type":["string","null"],"maxLength":24,"description":"Case-insensitive; normalized to uppercase."},"payin_currency":{"type":"string","default":"XNO","pattern":"^[A-Z0-9][A-Z0-9._-]{1,23}$","examples":["XNO","BAN","BTC","ETH"],"description":"NanSwap Pay pay-in currency code. Case-insensitive; normalized to uppercase. Defaults to the deployment default, XNO unless configured otherwise."},"idempotency_key":{"type":"string","minLength":8,"maxLength":128,"pattern":"^[!-~]{8,128}$","description":"Body alternative to the Idempotency-Key header. The header takes precedence when both are present. Surrounding whitespace is trimmed before validation."},"terms_accepted":{"type":"boolean","const":true,"description":"Must be true. Confirms acceptance of the Terms of Use and Privacy Policy."}}},"AgentOrder":{"type":"object","additionalProperties":false,"required":["schema_version","order_id","channel","status","demo","plan","target_url","category_id","scan","amount","payment","urls","next_action","polling","created_at","updated_at"],"properties":{"schema_version":{"type":"string"},"order_id":{"type":"string"},"idempotent_replay":{"type":"boolean","description":"Present only when an existing order was returned."},"channel":{"type":"string","examples":["agent"]},"status":{"type":"string","enum":["pending_payment","paid","processing","complete","failed"]},"demo":{"type":"boolean"},"plan":{"$ref":"#/components/schemas/OrderPlan"},"target_url":{"type":"string","format":"uri"},"category_id":{"type":"string"},"scan":{"$ref":"#/components/schemas/OrderScan"},"amount":{"$ref":"#/components/schemas/Amount"},"payment":{"$ref":"#/components/schemas/Payment"},"urls":{"$ref":"#/components/schemas/OrderUrls"},"next_action":{"$ref":"#/components/schemas/NextAction"},"polling":{"anyOf":[{"$ref":"#/components/schemas/Polling"},{"type":"null"}]},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"}}},"OrderPlan":{"type":"object","additionalProperties":false,"required":["id","name","page_limit"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"page_limit":{"type":"integer","minimum":1}}},"OrderScan":{"type":"object","additionalProperties":false,"required":["mode","selected_urls"],"properties":{"mode":{"type":"string","enum":["auto","manual"]},"selected_urls":{"type":"array","items":{"type":"string","format":"uri"}}}},"Payment":{"type":"object","additionalProperties":false,"required":["provider","demo","status","invoice_id","payin_currency","currency_to_send","amount_to_send","amount_to_send_exact","do_not_round","expected_amount_from","deposit_address","deposit_tag","price_amount","price_currency","fiat_price_amount","fiat_price_currency","payment_url","expires_at"],"properties":{"provider":{"type":"string"},"demo":{"type":"boolean"},"status":{"type":["string","null"]},"invoice_id":{"type":["string","null"]},"payin_currency":{"type":["string","null"]},"currency_to_send":{"type":["string","null"]},"amount_to_send":{"type":["number","null"],"description":"Amount of crypto to send. This is not the fiat audit price."},"amount_to_send_exact":{"type":["string","null"],"description":"Exact decimal amount as a string. Use this when the client may round numbers or serialise small values in scientific notation."},"do_not_round":{"type":"boolean","description":"When true, send the quoted amount without rounding or currency conversion."},"expected_amount_from":{"type":["number","null"],"description":"Alias of amount_to_send kept for compatibility."},"deposit_address":{"type":["string","null"]},"deposit_tag":{"type":["string","null"]},"price_amount":{"type":["number","null"],"deprecated":true,"description":"Legacy fiat invoice price. Never use this as the crypto amount."},"price_currency":{"type":["string","null"]},"fiat_price_amount":{"type":["number","null"],"description":"Fiat invoice price. Never use this as the crypto amount."},"fiat_price_currency":{"type":["string","null"]},"payment_url":{"type":["string","null"],"format":"uri"},"expires_at":{"type":["string","null"],"format":"date-time"}}},"OrderUrls":{"type":"object","additionalProperties":false,"required":["status","report","report_api","csv_export","json_export"],"properties":{"status":{"type":"string","format":"uri"},"report":{"type":"string","format":"uri","description":"Human-readable HTML report page."},"report_api":{"type":"string","format":"uri"},"csv_export":{"type":"string","format":"uri"},"json_export":{"type":"string","format":"uri"}}},"NextAction":{"oneOf":[{"$ref":"#/components/schemas/PayAction"},{"$ref":"#/components/schemas/DemoPayAction"},{"$ref":"#/components/schemas/ContactSupportAction"},{"$ref":"#/components/schemas/PollAction"},{"$ref":"#/components/schemas/FetchReportAction"}],"discriminator":{"propertyName":"action","mapping":{"pay":"#/components/schemas/PayAction","demo_pay":"#/components/schemas/DemoPayAction","contact_support":"#/components/schemas/ContactSupportAction","poll":"#/components/schemas/PollAction","fetch_report":"#/components/schemas/FetchReportAction"}}},"PayAction":{"type":"object","additionalProperties":false,"required":["action","method","status_url","payment_url","invoice_id","deposit_address","deposit_tag","amount_to_send","amount_to_send_exact","do_not_round","currency_to_send","expires_at","instruction"],"properties":{"action":{"type":"string","const":"pay"},"method":{"type":"string","enum":["GET","SEND"]},"status_url":{"type":"string","format":"uri"},"payment_url":{"type":["string","null"],"format":"uri"},"invoice_id":{"type":["string","null"]},"deposit_address":{"type":["string","null"]},"deposit_tag":{"type":["string","null"]},"amount_to_send":{"type":["number","null"]},"amount_to_send_exact":{"type":["string","null"]},"do_not_round":{"type":"boolean"},"currency_to_send":{"type":["string","null"]},"expires_at":{"type":["string","null"],"format":"date-time"},"instruction":{"type":"string"}}},"DemoPayAction":{"type":"object","additionalProperties":false,"required":["action","method","url","body","note"],"properties":{"action":{"type":"string","const":"demo_pay"},"method":{"type":"string","const":"POST"},"url":{"type":"string","format":"uri"},"body":{"type":"object","additionalProperties":false,"required":["order_id"],"properties":{"order_id":{"type":"string"}}},"note":{"type":"string"}}},"ContactSupportAction":{"type":"object","additionalProperties":false,"required":["action","contact_url"],"properties":{"action":{"type":"string","const":"contact_support"},"reason":{"type":"string","examples":["payment_expired","payment_underpaid","payment_instructions_incomplete"]},"payment_status":{"type":["string","null"]},"do_not_pay_again":{"type":"boolean"},"order_id":{"type":"string"},"status_url":{"type":"string","format":"uri"},"status":{"type":"string"},"contact_url":{"type":"string","format":"uri"}}},"PollAction":{"type":"object","additionalProperties":false,"required":["action","method","url","retry_after_seconds"],"properties":{"action":{"type":"string","const":"poll"},"method":{"type":"string","const":"GET"},"url":{"type":"string","format":"uri"},"retry_after_seconds":{"type":"integer","minimum":1}}},"FetchReportAction":{"type":"object","additionalProperties":false,"required":["action","method","url","report_url"],"properties":{"action":{"type":"string","const":"fetch_report"},"method":{"type":"string","const":"GET"},"url":{"type":"string","format":"uri"},"report_url":{"type":"string","format":"uri"}}},"Polling":{"type":"object","additionalProperties":false,"required":["interval_seconds","stop_when","stop_when_actions"],"properties":{"interval_seconds":{"type":"integer","minimum":1},"stop_when":{"type":"array","items":{"type":"string","enum":["complete","failed"]}},"stop_when_actions":{"type":"array","items":{"type":"string","enum":["contact_support","fetch_report"]}}}},"DemoPaymentRequest":{"type":"object","additionalProperties":true,"description":"Unknown top-level fields are ignored.","required":["order_id"],"properties":{"order_id":{"type":"string"}}},"DemoPaymentResponse":{"type":"object","additionalProperties":false,"required":["ok","status"],"properties":{"ok":{"type":"boolean","const":true},"status":{"type":"string","enum":["paid","processing","complete"]},"demo":{"type":"boolean","const":true}}},"Report":{"type":"object","additionalProperties":true,"required":["audit_id","order_id","target_url","category_id","plan","page_count","page_limit","score","findings","checks","scan_mode","selected_urls","discovery","insights","pages","generated_at","expires_at","retention_days"],"properties":{"audit_id":{"type":"string"},"order_id":{"type":"string"},"target_url":{"type":"string","format":"uri"},"category_id":{"type":"string"},"plan":{"$ref":"#/components/schemas/ReportPlan"},"page_count":{"type":"integer","minimum":0},"page_limit":{"type":"integer","minimum":0},"score":{"type":"integer","minimum":0,"maximum":100},"findings":{"type":"array","items":{"$ref":"#/components/schemas/Finding"}},"checks":{"type":"array","items":{"$ref":"#/components/schemas/Check"}},"scan_mode":{"type":"string","enum":["auto","manual"]},"selected_urls":{"type":"array","items":{"type":"string","format":"uri"}},"discovery":{"type":"object","additionalProperties":true},"insights":{"type":"object","additionalProperties":true},"pages":{"type":"array","items":{"$ref":"#/components/schemas/ReportPage"}},"generated_at":{"type":"string","format":"date-time"},"expires_at":{"type":["string","null"],"format":"date-time","description":"Report data is purged at this time."},"retention_days":{"type":"integer","enum":[2,14],"description":"2 for free daily-check reports, 14 for paid reports."}}},"ReportPlan":{"type":"object","additionalProperties":true,"required":["tier","label","eyebrow","best_for","capabilities"],"properties":{"tier":{"type":"string"},"label":{"type":"string"},"eyebrow":{"type":"string"},"best_for":{"type":"string"},"capabilities":{"type":"object","additionalProperties":true}}},"Finding":{"type":"object","additionalProperties":true,"required":["rule","group","severity","evidence","observed","expected","recommendation","affected_urls"],"properties":{"rule":{"type":"string"},"group":{"type":"string"},"severity":{"type":"string","enum":["high","medium","low"]},"evidence":{"type":["string","null"]},"observed":{"type":["string","null"],"description":"What was actually observed. A finding is not created from missing data."},"expected":{"type":["string","null"],"description":"The expected result for this check."},"recommendation":{"type":"string","description":"Actionable fix."},"affected_urls":{"type":"array","items":{"type":"string","format":"uri"}}}},"Check":{"type":"object","additionalProperties":true,"required":["rule","label","group","status","severity","evidence","observed","expected"],"properties":{"rule":{"type":"string"},"label":{"type":"string"},"group":{"type":"string"},"status":{"type":"string","enum":["pass","warn","fail","unverified"]},"severity":{"type":["string","null"],"enum":["high","medium","low",null]},"evidence":{"type":["string","null"]},"observed":{"type":["string","null"]},"expected":{"type":["string","null"]}}},"ReportPage":{"type":"object","additionalProperties":true,"required":["url","status_code"],"properties":{"url":{"type":"string","format":"uri"},"report":{"type":"object","additionalProperties":true,"description":"Per-page score, findings and checks."},"final_url":{"type":["string","null"],"format":"uri"},"status_code":{"type":["integer","null"]},"title":{"type":["string","null"]},"description":{"type":["string","null"]},"canonical_url":{"type":["string","null"]},"robots_meta":{"type":["string","null"]},"h1_count":{"type":["integer","null"]},"word_count":{"type":["integer","null"]},"images_without_alt":{"type":["integer","null"]},"picture_count":{"type":["integer","null"]},"internal_links":{"type":["integer","null"]},"external_links":{"type":["integer","null"]},"page_bytes":{"type":["integer","null"]},"duration_ms":{"type":["integer","null"]}}}}}}