{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/spendesk/json-schema/spendesk-bulk-update-settlements-state-partial-success-schema.json",
  "title": "bulkUpdateSettlementsStatePartialSuccess",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/spendesk-settlements-and-wallet-api-openapi.yml#/components/schemas/bulkUpdateSettlementsStatePartialSuccess",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "updatedSettlements": {
      "type": "array",
      "description": "List of settlements with their update outcomes.",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/updateSettlementStateSuccess"
          },
          {
            "$ref": "#/$defs/updateSettlementStateFailure"
          }
        ]
      }
    }
  },
  "required": [
    "updatedSettlements"
  ],
  "$defs": {
    "updateSettlementStateFailure": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "The ID of the settlement."
        },
        "outcome": {
          "type": "string",
          "enum": [
            "notUpdated"
          ]
        },
        "reason": {
          "type": "string",
          "description": "The settlement or its accounting export state could not be found.",
          "enum": [
            "notFound"
          ]
        }
      },
      "required": [
        "id",
        "outcome",
        "reason"
      ],
      "title": "updateSettlementStateFailure"
    },
    "updateSettlementStateSuccess": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "The ID of the settlement."
        },
        "outcome": {
          "type": "string",
          "enum": [
            "updated"
          ]
        }
      },
      "required": [
        "id",
        "outcome"
      ],
      "title": "updateSettlementStateSuccess"
    }
  }
}