{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://weverlabs.com/schemas/settlement-provider-route.schema.json",
  "title": "Settlement Provider Route",
  "description": "Route object that binds a quote, settlement intent, provider rail, credit account, and run contract into one fundable path for agent-paid OS work.",
  "type": "object",
  "required": [
    "route_id",
    "provider_id",
    "provider_type",
    "requested_tool",
    "quote_id",
    "settlement_intent_id",
    "credit_account_id",
    "amount",
    "asset",
    "route_status",
    "links"
  ],
  "properties": {
    "route_id": {
      "type": "string"
    },
    "provider_id": {
      "type": "string"
    },
    "provider_type": {
      "type": "string"
    },
    "requested_tool": {
      "type": "string"
    },
    "agent_id": {
      "type": "string"
    },
    "quote_id": {
      "type": "string"
    },
    "run_contract_id": {
      "type": "string"
    },
    "settlement_intent_id": {
      "type": "string"
    },
    "credit_account_id": {
      "type": "string"
    },
    "amount": {
      "type": "number",
      "minimum": 0
    },
    "asset": {
      "type": "string"
    },
    "currency": {
      "type": "string"
    },
    "credits_to_fund": {
      "type": "number",
      "minimum": 0
    },
    "route_status": {
      "type": "string",
      "enum": [
        "route_created",
        "payment_request_ready",
        "provider_confirmation_pending",
        "credits_funded",
        "settlement_receipt_ready",
        "route_closed",
        "route_exception"
      ]
    },
    "payment_request": {
      "type": "object",
      "additionalProperties": true
    },
    "next_actions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "links": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    }
  },
  "additionalProperties": true
}
