{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sellerassistant-app/json-schema/sellerassistant-app-repricer-strategy-schema.json",
  "title": "RepricerStrategy",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sellerassistant-app-openapi.json#/components/schemas/RepricerStrategy",
  "properties": {
    "id": {
      "type": "integer"
    },
    "team_id": {
      "type": "integer"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "color": {
      "type": [
        "string",
        "null"
      ]
    },
    "action": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "follow_buybox",
        "follow_lowest",
        "follow_featured_offer",
        "adjust_price"
      ]
    },
    "action_params": {
      "properties": {
        "price_adjustment": {
          "description": "Price offset. Negative = undercut, positive = premium. The write takes the number, or the string of it.",
          "type": "number",
          "format": "float"
        },
        "price_adjustment_type": {
          "description": "Whether adjustment is a fixed dollar amount or percentage.",
          "type": "string",
          "enum": [
            "amount",
            "percent"
          ]
        },
        "reference": {
          "description": "The offers the price follows. Only follow_lowest reads it.",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "any",
            "fba",
            "fbm",
            "same_as_mine"
          ]
        },
        "respect_map": {
          "description": "Keep the price at or above the MAP of the product. Only the follow strategies read it.",
          "type": [
            "boolean",
            "null"
          ]
        },
        "when_winning": {
          "description": "While we hold the Buy Box. hold keeps the price. follow_next follows the next Buy Box-eligible competitor with the same price_adjustment (-0.01 = one cent below, 0 = match). It never lowers the price, never goes above the max price or the competitive price threshold, and holds when neither exists. Only follow_buybox and follow_featured_offer read it. No key is hold; a new strategy gets follow_next. In a rule, no key uses the strategy value.",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "hold",
            "follow_next"
          ]
        },
        "win_back_buybox": {
          "description": "Recover a suppressed Buy Box before custom rules.",
          "type": "boolean",
          "default": true
        },
        "buybox_recovery_step": {
          "description": "Step down in the listing currency. Minimum 0.01; at most two decimal places.",
          "type": "number",
          "default": 0.01
        },
        "when_unopposed": {
          "description": "With follow_next and no Buy Box-eligible competitor: hold (default) or max (go to the max price; holds when no max price is set).",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "hold",
            "max"
          ]
        },
        "when_below_min": {
          "description": "When the Buy Box, the lowest competitor or the featured offer is below the min price. min (default) stays at the min price. max goes to the max price (holds when no max price is set). hold keeps the current price. Only follow_buybox, follow_lowest and follow_featured_offer read it. In a rule, no key uses the strategy value.",
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "min",
            "max",
            "hold"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "limits": {
      "description": "Every number here answers as a number. The keys that name a thing stay words.",
      "properties": {
        "min_price_mode": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "break_even_plus",
            "target_roi",
            "target_margin"
          ]
        },
        "target_roi": {
          "description": "The ROI the minimum price aims at, in percent.",
          "type": [
            "number",
            "null"
          ]
        },
        "target_margin": {
          "type": [
            "number",
            "null"
          ]
        },
        "min_price_markup": {
          "type": [
            "number",
            "null"
          ]
        },
        "missing_cost_fallback": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "error",
            "none"
          ]
        },
        "min_price": {
          "type": [
            "number",
            "null"
          ]
        },
        "max_price": {
          "type": [
            "number",
            "null"
          ]
        },
        "max_change": {
          "type": [
            "number",
            "null"
          ]
        },
        "max_change_percent": {
          "type": [
            "number",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "rules": {
      "description": "The rules the strategy runs before its own action. The first rule that matches wins. A strategy with no rules answers null.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "properties": {
          "name": {
            "type": "string"
          },
          "condition": {
            "properties": {
              "type": {
                "type": "string"
              },
              "value": {
                "description": "The value the condition compares against. A number, a word or true."
              }
            },
            "type": "object"
          },
          "action": {
            "description": "The action of the rule. `hold` keeps the price as it is. `set_max` moves the price to the max price.",
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "follow_buybox",
              "follow_lowest",
              "follow_featured_offer",
              "adjust_price",
              "hold",
              "set_max"
            ]
          },
          "action_params": {
            "properties": {
              "price_adjustment": {
                "type": "number",
                "format": "float"
              },
              "price_adjustment_type": {
                "type": "string",
                "enum": [
                  "amount",
                  "percent"
                ]
              },
              "reference": {
                "description": "The offers the price follows. Only follow_lowest reads it.",
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "any",
                  "fba",
                  "fbm",
                  "same_as_mine"
                ]
              },
              "respect_map": {
                "description": "Keep the price at or above the MAP of the product. Only the follow strategies read it.",
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "when_winning": {
                "description": "While we hold the Buy Box. hold keeps the price. follow_next follows the next Buy Box-eligible competitor with the same price_adjustment (-0.01 = one cent below, 0 = match). It never lowers the price, never goes above the max price or the competitive price threshold, and holds when neither exists. Only follow_buybox and follow_featured_offer read it. No key is hold; a new strategy gets follow_next. In a rule, no key uses the strategy value.",
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "hold",
                  "follow_next"
                ]
              },
              "when_unopposed": {
                "description": "With follow_next and no Buy Box-eligible competitor: hold (default) or max (go to the max price; holds when no max price is set).",
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "hold",
                  "max"
                ]
              },
              "when_below_min": {
                "description": "When the Buy Box, the lowest competitor or the featured offer is below the min price. min (default) stays at the min price. max goes to the max price (holds when no max price is set). hold keeps the current price. Only follow_buybox, follow_lowest and follow_featured_offer read it. In a rule, no key uses the strategy value.",
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "min",
                  "max",
                  "hold"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          }
        },
        "type": "object"
      }
    },
    "rules_count": {
      "description": "How many rules the strategy holds.",
      "type": "integer"
    },
    "is_default": {
      "type": "boolean"
    },
    "product_count": {
      "description": "How many products use the strategy. The list of the strategies counts them. A strategy inside another answer does not, and answers null.",
      "type": [
        "integer",
        "null"
      ]
    },
    "created_by": {
      "type": [
        "integer",
        "null"
      ]
    },
    "updated_by": {
      "type": [
        "integer",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "type": "object"
}