{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/marketsdk/json-schema/marketsdk-marketplace-object-schema.json",
  "title": "MarketplaceObject",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/marketsdk-marketplace-api-openapi.yml#/components/schemas/MarketplaceObject",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "enum": [
        "marketplace"
      ]
    },
    "id": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "test",
        "live"
      ]
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "currency": {
      "type": "string"
    },
    "payments": {
      "type": "boolean"
    },
    "seller_verification": {
      "type": "boolean"
    },
    "hold_funds_until_completion": {
      "type": "boolean"
    },
    "fee": {
      "$ref": "#/$defs/FeeSettingsDto"
    },
    "timers": {
      "$ref": "#/$defs/TimerSettingsDto"
    },
    "reputation": {
      "$ref": "#/$defs/ReputationSettingsDto"
    },
    "disputes": {
      "$ref": "#/$defs/DisputeSettingsDto"
    },
    "moderation": {
      "$ref": "#/$defs/ModerationSettingsDto"
    },
    "allowed_origins": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "read_only": {
      "description": "Set while the marketplace answers reads only, for example after a missed payment. Changes are refused with 403 `marketplace_read_only`. Null when open.",
      "anyOf": [
        {
          "$ref": "#/$defs/ReadOnlyObject"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "object",
    "id",
    "mode",
    "description",
    "currency",
    "payments",
    "seller_verification",
    "hold_funds_until_completion",
    "fee",
    "timers",
    "reputation",
    "disputes",
    "moderation",
    "allowed_origins",
    "read_only"
  ],
  "$defs": {
    "DisputeSettingsDto": {
      "type": "object",
      "properties": {
        "evidence_days": {
          "type": "number",
          "minimum": 1,
          "maximum": 30,
          "default": 7,
          "description": "Days both parties have to give evidence once a dispute opens."
        },
        "decision_days": {
          "type": "number",
          "minimum": 1,
          "maximum": 60,
          "default": 14,
          "description": "Days the customer's team has to decide once evidence closes. After that the dispute is marked overdue."
        }
      }
    },
    "FeeSettingsDto": {
      "type": "object",
      "properties": {
        "percent_bps": {
          "type": "number",
          "minimum": 0,
          "maximum": 10000,
          "description": "Basis points: 250 is 2.5 percent."
        },
        "fixed_amount": {
          "type": "number",
          "minimum": 0,
          "description": "Minor units, in the marketplace currency."
        }
      }
    },
    "ModerationSettingsDto": {
      "type": "object",
      "properties": {
        "prohibited_keywords": {
          "maxItems": 200,
          "description": "Words or phrases that block publication when found in a listing title or description, ignoring case.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ReadOnlyObject": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "enum": [
            "payment_failed",
            "cancelled",
            "plan_inactive",
            "policy_not_accepted",
            "stripe_connection",
            "suspended"
          ]
        },
        "since": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "reason",
        "since"
      ]
    },
    "ReputationSettingsDto": {
      "type": "object",
      "properties": {
        "window_months": {
          "type": "number",
          "minimum": 6,
          "maximum": 60,
          "default": 24
        },
        "backout_weight": {
          "type": "number",
          "minimum": 1,
          "maximum": 5,
          "default": 2
        },
        "dispute_weight": {
          "type": "number",
          "minimum": 1,
          "maximum": 5,
          "default": 3
        },
        "blend": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "default": 0.6
        },
        "prior_rating": {
          "type": "number",
          "minimum": 3,
          "maximum": 5,
          "default": 4
        },
        "prior_weight": {
          "type": "number",
          "minimum": 0,
          "maximum": 10,
          "default": 2
        },
        "minimum_events": {
          "type": "number",
          "minimum": 1,
          "maximum": 10,
          "default": 3
        }
      }
    },
    "TimerSettingsDto": {
      "type": "object",
      "properties": {
        "payment_window_minutes": {
          "type": "number",
          "minimum": 5,
          "maximum": 1440,
          "default": 30
        },
        "commitment_window_days": {
          "type": "number",
          "minimum": 1,
          "maximum": 90,
          "default": 14
        },
        "agreement_window_hours": {
          "type": "number",
          "minimum": 1,
          "maximum": 168,
          "default": 48
        },
        "confirmation_window_days": {
          "type": "number",
          "minimum": 1,
          "maximum": 30,
          "default": 7
        },
        "review_window_days": {
          "type": "number",
          "minimum": 7,
          "maximum": 90,
          "default": 30
        },
        "dispute_window_days": {
          "type": "number",
          "minimum": 0,
          "maximum": 60,
          "default": 14
        }
      }
    }
  }
}