{
  "openapi": "3.1.0",
  "info": {
    "title": "Priceivy REST API v1",
    "version": "1.0.0",
    "summary": "Stammdaten importieren und freigegebene Preise abrufen.",
    "description": "Die Priceivy REST API v1 ist der Weg, Stammdaten (Produkte, Kategorien, Kunden, Kundengruppen, Steuersatzgruppen) aus Warenwirtschaft oder Shop zu übergeben und die freigegebenen berechneten Preise abzuholen. Berechnete Preise lassen sich über die API nicht schreiben (Produkte nehmen Import-Preise wie `ek` an). Beträge sind ganze Cent-Werte.\n\n**Fehlerformat:** `{\"error\": \"…\", \"code\": \"…\"}`, bei Bulk-Validierungsfehlern zusätzlich `details.validation_errors`. `error` ist ein deutscher Text für Menschen und kann sich ändern; werte `code` (stabil, snake_case) und den HTTP-Status aus. Alle Codes mit empfohlener Reaktion: https://priceivy.com/docs/api-v1#fehlercodes\n\n**Rate-Limit:** 100 Anfragen pro Minute je Schlüssel und 300 je Organisation. Nach erfolgreicher Authentifizierung liefert jede Antwort `X-RateLimit-*` (bezogen auf den Schlüssel), bei 429 zusätzlich `Retry-After`. Bulk-Aufrufe zählen als eine Anfrage. Nach vielen fehlgeschlagenen Anmeldeversuchen von einer IP-Adresse folgt 429 mit `code: auth_rate_limited` (ohne `X-RateLimit-*`).\n\n**Pagination:** `limit`, `offset` oder Cursor `after`; Antworten tragen `pagination` mit `total` und ggf. `next_cursor`.\n\nAusführliche Beschreibung: https://priceivy.com/docs/api-v1",
    "contact": {
      "name": "Priceivy",
      "url": "https://priceivy.com/docs/api-v1"
    }
  },
  "servers": [
    {
      "url": "https://app.priceivy.com/api/v1",
      "description": "Produktion"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Produkte"
    },
    {
      "name": "Kategorien"
    },
    {
      "name": "Kunden"
    },
    {
      "name": "Kundengruppen"
    },
    {
      "name": "Steuersatzgruppen"
    },
    {
      "name": "Berechnete Preise"
    },
    {
      "name": "Import-Auswahl"
    },
    {
      "name": "Offene Freigaben",
      "description": "Offene Preisvorschläge, die auf Freigabe warten. Nur lesen: Freigeben geht nur in Priceivy."
    },
    {
      "name": "Preis-Check-Ergebnisse",
      "description": "Letzte Preis-Check-Ergebnisse je Produkt. Idealo DE live; Idealo AT nur, wo eingerichtet; andere Marktplätze (z. B. Amazon, eBay, Kaufland, Otto) nur indirekt über Idealo; Google Shopping pausiert."
    }
  ],
  "paths": {
    "/products": {
      "get": {
        "operationId": "list_products",
        "tags": [
          "Produkte"
        ],
        "summary": "Produkte auflisten",
        "description": "Seitenweise Liste, sortiert nach Anlage (neueste zuerst). Paginierung per `limit`/`offset` oder Cursor `after`. Mit `updated_since`: nur Einträge, die sich seitdem geändert haben (auch ihre Unterdaten), älteste Änderung zuerst; gelöschte als `DeletedEntry`. Das Umbenennen einer Kategorie löst kein Produkt-Delta aus: `categories[].name` kann danach veraltet sein, Kategorienamen über `GET /categories?updated_since=…` nachziehen (Zuordnung über die `external_id` der Kategorie).",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/After"
          },
          {
            "$ref": "#/components/parameters/UpdatedSince"
          }
        ],
        "responses": {
          "200": {
            "description": "Seite der Liste.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/Product"
                          },
                          {
                            "$ref": "#/components/schemas/DeletedEntry"
                          }
                        ]
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DeltaBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/products/{external_id}": {
      "get": {
        "operationId": "get_products",
        "tags": [
          "Produkte"
        ],
        "summary": "Produkt abrufen",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Produkt.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "put": {
        "operationId": "upsert_products",
        "tags": [
          "Produkte"
        ],
        "summary": "Produkt anlegen oder aktualisieren",
        "description": "Upsert über die `external_id` aus dem Pfad, idempotent. 201 bei Neuanlage, sonst 200. Setzt voraus, dass der Datentyp in der Import-Auswahl eingeschaltet ist. Ist `import_excluded` am Produkt gesetzt, antwortet die API mit 200 und einem Feld `warning`, ohne zu schreiben. Beim Anlegen kann das Artikel-Limit des Plans zu 403 führen. Verweist eine Staffel auf einen Kunden und ist die Import-Auswahl nicht lesbar, antwortet die API mit 503.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Produkt aktualisiert.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    },
                    "warning": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Produkt neu angelegt.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "delete_products",
        "tags": [
          "Produkte"
        ],
        "summary": "Produkt löschen",
        "description": "Soft-Delete. Ein zweiter Aufruf mit derselben `external_id` liefert 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Gelöscht.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/products/bulk-upsert": {
      "post": {
        "operationId": "bulk_upsert_products",
        "tags": [
          "Produkte"
        ],
        "summary": "Produkte in Bulk anlegen oder aktualisieren",
        "description": "Bis zu 1000 Items je Request, zählt als eine Anfrage im Rate-Limit. Alle Items werden vorab validiert: ein Fehler führt zu 422 für den ganzen Request. Danach ist Teilerfolg möglich (siehe `summary.failed` und `errors`). Doppelte `external_id`s im Request: das letzte Item gewinnt. Setzt voraus, dass der Datentyp in der Import-Auswahl eingeschaltet ist. Verweist eine Staffel auf einen Kunden und ist die Import-Auswahl nicht lesbar, antwortet die API mit 503.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductBulkUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUpsertResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/products/bulk-delete": {
      "post": {
        "operationId": "bulk_delete_products",
        "tags": [
          "Produkte"
        ],
        "summary": "Produkte in Bulk löschen",
        "description": "Bis zu 1000 `external_ids` je Request, zählt als eine Anfrage im Rate-Limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkDeleteResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/categories": {
      "get": {
        "operationId": "list_categories",
        "tags": [
          "Kategorien"
        ],
        "summary": "Kategorien auflisten",
        "description": "Seitenweise Liste, sortiert nach Anlage (neueste zuerst). Paginierung per `limit`/`offset` oder Cursor `after`. Mit `updated_since`: nur Einträge, die sich seitdem geändert haben (auch ihre Unterdaten), älteste Änderung zuerst; gelöschte als `DeletedEntry`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/After"
          },
          {
            "$ref": "#/components/parameters/UpdatedSince"
          }
        ],
        "responses": {
          "200": {
            "description": "Seite der Liste.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/Category"
                          },
                          {
                            "$ref": "#/components/schemas/DeletedEntry"
                          }
                        ]
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DeltaBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/categories/{external_id}": {
      "get": {
        "operationId": "get_categories",
        "tags": [
          "Kategorien"
        ],
        "summary": "Kategorie abrufen",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Kategorie.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Category"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "put": {
        "operationId": "upsert_categories",
        "tags": [
          "Kategorien"
        ],
        "summary": "Kategorie anlegen oder aktualisieren",
        "description": "Upsert über die `external_id` aus dem Pfad, idempotent. 201 bei Neuanlage, sonst 200. Setzt voraus, dass der Datentyp in der Import-Auswahl eingeschaltet ist.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Kategorie aktualisiert.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Category"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Kategorie neu angelegt.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Category"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "delete": {
        "operationId": "delete_categories",
        "tags": [
          "Kategorien"
        ],
        "summary": "Kategorie löschen",
        "description": "Soft-Delete. Ein zweiter Aufruf mit derselben `external_id` liefert 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Gelöscht.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/categories/bulk-upsert": {
      "post": {
        "operationId": "bulk_upsert_categories",
        "tags": [
          "Kategorien"
        ],
        "summary": "Kategorien in Bulk anlegen oder aktualisieren",
        "description": "Bis zu 1000 Items je Request, zählt als eine Anfrage im Rate-Limit. Alle Items werden vorab validiert: ein Fehler führt zu 422 für den ganzen Request. Danach ist Teilerfolg möglich (siehe `summary.failed` und `errors`). Doppelte `external_id`s im Request: das letzte Item gewinnt. Setzt voraus, dass der Datentyp in der Import-Auswahl eingeschaltet ist.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryBulkUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUpsertResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/categories/bulk-delete": {
      "post": {
        "operationId": "bulk_delete_categories",
        "tags": [
          "Kategorien"
        ],
        "summary": "Kategorien in Bulk löschen",
        "description": "Bis zu 1000 `external_ids` je Request, zählt als eine Anfrage im Rate-Limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkDeleteResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/customers": {
      "get": {
        "operationId": "list_customers",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunden auflisten",
        "description": "Seitenweise Liste, sortiert nach Anlage (neueste zuerst). Paginierung per `limit`/`offset` oder Cursor `after`. Mit `updated_since`: nur Einträge, die sich seitdem geändert haben (auch ihre Unterdaten), älteste Änderung zuerst; gelöschte als `DeletedEntry`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/After"
          },
          {
            "$ref": "#/components/parameters/UpdatedSince"
          }
        ],
        "responses": {
          "200": {
            "description": "Seite der Liste.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/Customer"
                          },
                          {
                            "$ref": "#/components/schemas/DeletedEntry"
                          }
                        ]
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DeltaBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/customers/{external_id}": {
      "get": {
        "operationId": "get_customers",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunde abrufen",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Kunde.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "put": {
        "operationId": "upsert_customers",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunde anlegen oder aktualisieren",
        "description": "Upsert über die `external_id` aus dem Pfad, idempotent. 201 bei Neuanlage, sonst 200. Setzt voraus, dass der Datentyp in der Import-Auswahl eingeschaltet ist (bei neuen Organisationen standardmäßig aus; nicht lesbare Auswahl: 503).",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Kunde aktualisiert.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Kunde neu angelegt.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      },
      "delete": {
        "operationId": "delete_customers",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunde löschen",
        "description": "Soft-Delete. Ein zweiter Aufruf mit derselben `external_id` liefert 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Gelöscht.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/customers/bulk-upsert": {
      "post": {
        "operationId": "bulk_upsert_customers",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunden in Bulk anlegen oder aktualisieren",
        "description": "Bis zu 1000 Items je Request, zählt als eine Anfrage im Rate-Limit. Alle Items werden vorab validiert: ein Fehler führt zu 422 für den ganzen Request. Danach ist Teilerfolg möglich (siehe `summary.failed` und `errors`). Doppelte `external_id`s im Request: das letzte Item gewinnt. Setzt voraus, dass der Datentyp in der Import-Auswahl eingeschaltet ist (bei neuen Organisationen standardmäßig aus; nicht lesbare Auswahl: 503).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerBulkUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUpsertResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/customers/bulk-delete": {
      "post": {
        "operationId": "bulk_delete_customers",
        "tags": [
          "Kunden"
        ],
        "summary": "Kunden in Bulk löschen",
        "description": "Bis zu 1000 `external_ids` je Request, zählt als eine Anfrage im Rate-Limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkDeleteResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/customer-groups": {
      "get": {
        "operationId": "list_customer_groups",
        "tags": [
          "Kundengruppen"
        ],
        "summary": "Kundengruppen auflisten",
        "description": "Seitenweise Liste, sortiert nach Anlage (neueste zuerst). Paginierung per `limit`/`offset` oder Cursor `after`. Mit `updated_since`: nur Einträge, die sich seitdem geändert haben (auch ihre Unterdaten), älteste Änderung zuerst; gelöschte als `DeletedEntry`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/After"
          },
          {
            "$ref": "#/components/parameters/UpdatedSince"
          }
        ],
        "responses": {
          "200": {
            "description": "Seite der Liste.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/CustomerGroup"
                          },
                          {
                            "$ref": "#/components/schemas/DeletedEntry"
                          }
                        ]
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DeltaBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/customer-groups/{external_id}": {
      "get": {
        "operationId": "get_customer_groups",
        "tags": [
          "Kundengruppen"
        ],
        "summary": "Kundengruppe abrufen",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Kundengruppe.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerGroup"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "put": {
        "operationId": "upsert_customer_groups",
        "tags": [
          "Kundengruppen"
        ],
        "summary": "Kundengruppe anlegen oder aktualisieren",
        "description": "Upsert über die `external_id` aus dem Pfad, idempotent. 201 bei Neuanlage, sonst 200. Setzt voraus, dass der Datentyp in der Import-Auswahl eingeschaltet ist.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerGroupUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Kundengruppe aktualisiert.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerGroup"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Kundengruppe neu angelegt.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CustomerGroup"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "delete": {
        "operationId": "delete_customer_groups",
        "tags": [
          "Kundengruppen"
        ],
        "summary": "Kundengruppe löschen",
        "description": "Soft-Delete. Ein zweiter Aufruf mit derselben `external_id` liefert 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Gelöscht.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/customer-groups/bulk-upsert": {
      "post": {
        "operationId": "bulk_upsert_customer_groups",
        "tags": [
          "Kundengruppen"
        ],
        "summary": "Kundengruppen in Bulk anlegen oder aktualisieren",
        "description": "Bis zu 1000 Items je Request, zählt als eine Anfrage im Rate-Limit. Alle Items werden vorab validiert: ein Fehler führt zu 422 für den ganzen Request. Danach ist Teilerfolg möglich (siehe `summary.failed` und `errors`). Doppelte `external_id`s im Request: das letzte Item gewinnt. Setzt voraus, dass der Datentyp in der Import-Auswahl eingeschaltet ist.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerGroupBulkUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUpsertResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/customer-groups/bulk-delete": {
      "post": {
        "operationId": "bulk_delete_customer_groups",
        "tags": [
          "Kundengruppen"
        ],
        "summary": "Kundengruppen in Bulk löschen",
        "description": "Bis zu 1000 `external_ids` je Request, zählt als eine Anfrage im Rate-Limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkDeleteResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/tax-rate-groups": {
      "get": {
        "operationId": "list_tax_rate_groups",
        "tags": [
          "Steuersatzgruppen"
        ],
        "summary": "Steuersatzgruppen auflisten",
        "description": "Seitenweise Liste, sortiert nach Anlage (neueste zuerst). Paginierung per `limit`/`offset` oder Cursor `after`. Mit `updated_since`: nur Einträge, die sich seitdem geändert haben (auch ihre Unterdaten), älteste Änderung zuerst; gelöschte als `DeletedEntry`.",
        "parameters": [
          {
            "$ref": "#/components/parameters/Limit"
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "$ref": "#/components/parameters/After"
          },
          {
            "$ref": "#/components/parameters/UpdatedSince"
          }
        ],
        "responses": {
          "200": {
            "description": "Seite der Liste.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "oneOf": [
                          {
                            "$ref": "#/components/schemas/TaxRateGroup"
                          },
                          {
                            "$ref": "#/components/schemas/DeletedEntry"
                          }
                        ]
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DeltaBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/tax-rate-groups/{external_id}": {
      "get": {
        "operationId": "get_tax_rate_groups",
        "tags": [
          "Steuersatzgruppen"
        ],
        "summary": "Steuersatzgruppe abrufen",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Steuersatzgruppe.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRateGroup"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "put": {
        "operationId": "upsert_tax_rate_groups",
        "tags": [
          "Steuersatzgruppen"
        ],
        "summary": "Steuersatzgruppe anlegen oder aktualisieren",
        "description": "Upsert über die `external_id` aus dem Pfad, idempotent. 201 bei Neuanlage, sonst 200.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRateGroupUpsert"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Steuersatzgruppe aktualisiert.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRateGroup"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Steuersatzgruppe neu angelegt.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/TaxRateGroup"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      },
      "delete": {
        "operationId": "delete_tax_rate_groups",
        "tags": [
          "Steuersatzgruppen"
        ],
        "summary": "Steuersatzgruppe löschen",
        "description": "Soft-Delete. Ein zweiter Aufruf mit derselben `external_id` liefert 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Gelöscht.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteResult"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/tax-rate-groups/bulk-upsert": {
      "post": {
        "operationId": "bulk_upsert_tax_rate_groups",
        "tags": [
          "Steuersatzgruppen"
        ],
        "summary": "Steuersatzgruppen in Bulk anlegen oder aktualisieren",
        "description": "Bis zu 1000 Items je Request, zählt als eine Anfrage im Rate-Limit. Alle Items werden vorab validiert: ein Fehler führt zu 422 für den ganzen Request. Danach ist Teilerfolg möglich (siehe `summary.failed` und `errors`). Doppelte `external_id`s im Request: das letzte Item gewinnt.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaxRateGroupBulkUpsertRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkUpsertResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/tax-rate-groups/bulk-delete": {
      "post": {
        "operationId": "bulk_delete_tax_rate_groups",
        "tags": [
          "Steuersatzgruppen"
        ],
        "summary": "Steuersatzgruppen in Bulk löschen",
        "description": "Bis zu 1000 `external_ids` je Request, zählt als eine Anfrage im Rate-Limit.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkDeleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ergebnis des Bulk-Laufs.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkDeleteResult"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/calculated-prices": {
      "get": {
        "operationId": "list_calculated_prices",
        "tags": [
          "Berechnete Preise"
        ],
        "summary": "Freigegebene berechnete Preise auflisten",
        "description": "Nur freigegebene Preise, je Produkt gruppiert nach Kanal und Preisart. Produkte mit `export_excluded` fehlen, Verkaufspreise ≤ 0 werden nie ausgeliefert. Eine Seite endet spätestens bei 7.500 Preiszeilen und liefert dann `next_cursor`, auch wenn sie weniger als `limit` Produkte enthält. Mit `updated_since`: nur Produkte, deren freigegebene Preise sich seitdem geändert haben, älteste Änderung zuerst, je Produkt alle aktuellen Preise; nicht mit `updated_after`/`updated_before` kombinierbar.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Produkte pro Seite (1 bis 500, Standard 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/Offset"
          },
          {
            "name": "after",
            "in": "query",
            "description": "Cursor: `external_id` des letzten Produkts der Vorseite. Unbekanntes Produkt: 404.",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/UpdatedSince"
          },
          {
            "name": "updated_after",
            "in": "query",
            "description": "Nur Preise mit `updated_at` nach diesem Zeitpunkt (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "updated_before",
            "in": "query",
            "description": "Nur Preise mit `updated_at` vor diesem Zeitpunkt (ISO 8601).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Seite der Preise.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GroupedCalculatedPrice"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/DeltaBadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/calculated-prices/by-product/{external_id}": {
      "get": {
        "operationId": "get_calculated_prices_by_product",
        "tags": [
          "Berechnete Preise"
        ],
        "summary": "Freigegebene Preise eines Produkts abrufen",
        "description": "Wie die Liste, für ein Produkt. Produkte mit `export_excluded` liefern 404.",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExternalId"
          }
        ],
        "responses": {
          "200": {
            "description": "Preise des Produkts.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GroupedCalculatedPrice"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          }
        }
      }
    },
    "/import-settings": {
      "get": {
        "operationId": "get_import_settings",
        "tags": [
          "Import-Auswahl"
        ],
        "summary": "Import-Auswahl der Organisation lesen",
        "description": "Nur lesend. Geändert wird die Auswahl in Priceivy unter Einrichten, Import / Export.",
        "responses": {
          "200": {
            "description": "Import-Auswahl.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ImportSettings"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        }
      }
    },
    "/pending-approvals": {
      "get": {
        "operationId": "list_pending_approvals",
        "tags": [
          "Offene Freigaben"
        ],
        "summary": "Offene Freigaben auflisten",
        "description": "Offene Preisvorschläge, die auf Freigabe warten und den Live-Preis ändern würden (dieselbe Auswahl wie „Freigaben“ in Priceivy), älteste Änderung zuerst. Nur lesen: Freigeben geht nur in Priceivy (`approval_url`). Nur-Lesen-Schlüssel sind erlaubt. Mit `updated_since` nur geänderte Vorschläge. Freigegebene oder verworfene Vorschläge fallen aus der Liste und werden nicht als gelöscht gemeldet; für einen vollständigen Abgleich ohne `updated_since` abrufen. Weiterblättern immer mit `next_cursor` (kein `offset`); `pagination.total` ist hier immer `null`. `pagination.next_updated_since` steht auf jeder Seite, auch ohne `updated_since`: Wert für den nächsten Abgleich (10 Minuten vor der Datenbankzeit, auf allen Seiten eines Laufs gleich).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Vorschläge pro Seite (1 bis 200, Standard 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "$ref": "#/components/parameters/ReadCursor"
          },
          {
            "$ref": "#/components/parameters/ReadUpdatedSince"
          },
          {
            "name": "platform",
            "in": "query",
            "description": "Nur Vorschläge dieses Kanals (Name oder ID eines Kalkulationskanals). Unbekannt: 422.",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Seite der offenen Freigaben.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination",
                    "approval_url"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PendingApproval"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "approval_url": {
                      "type": "string",
                      "format": "uri",
                      "description": "Freigabe-Ansicht in Priceivy."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`updated_since` ungültig (`invalid_updated_since`) oder Cursor `after` ungültig, verändert oder aus einer anderen Abfrage (`invalid_cursor`).",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_updated_since": {
                    "value": {
                      "error": "updated_since muss ein Zeitpunkt nach RFC 3339 mit Zeitzone sein, z. B. 2026-12-01T10:00:00Z",
                      "code": "invalid_updated_since"
                    }
                  },
                  "invalid_cursor": {
                    "value": {
                      "error": "Cursor \"after\" ist ungültig oder gehört nicht zu dieser Abfrage. Ohne after mit demselben updated_since neu beginnen.",
                      "code": "invalid_cursor"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "description": "Vorübergehend nicht verfügbar (Zeitüberschreitung oder Datenbank-Update noch nicht eingespielt). Später erneut versuchen.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unavailable": {
                    "value": {
                      "error": "Offene Freigaben sind über die API noch nicht verfügbar. Bitte versuch es später erneut.",
                      "code": "service_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/competitor-results": {
      "get": {
        "operationId": "list_competitor_results",
        "tags": [
          "Preis-Check-Ergebnisse"
        ],
        "summary": "Preis-Check-Ergebnisse auflisten",
        "description": "Letztes Preis-Check-Ergebnis je Produkt und Idealo-Preis-Check-Plattform eines Markts, älteste Änderung zuerst: eigener Platz, eigener Gesamtpreis inkl. Versand, Platz-1-Preis, Abstand, Anzahl Konkurrenzangebote, Zeitpunkt des Checks. Idealo DE live; Idealo AT nur, wo eingerichtet; andere Marktplätze (z. B. Amazon, eBay, Kaufland, Otto) nur indirekt über Idealo; Google Shopping pausiert. Händlernamen nur für Wettbewerber, die deine Organisation in Priceivy markiert hat (`marked_competitors`, nur DE, Stand des letzten Preis-Checks; fehlt, wenn dieser die aktuellen Markierungen noch nicht kennt), alle anderen bleiben anonym. `state`: `ready`, `no_own_shop` (kein eigener Idealo-Shop hinterlegt: Ergebnisse ohne eigenen Platz/Preis) oder `no_results` (noch kein Preis-Check). `watchlist`: `ready`, `none_marked`, `unavailable` (keine Namen) oder `not_for_market` (AT). Nur-Lesen-Schlüssel sind erlaubt. Weiterblättern immer mit `next_cursor` (kein `offset`); `pagination.total` ist hier immer `null`. `pagination.next_updated_since` steht auf jeder Seite, auch ohne `updated_since`: Wert für den nächsten Abgleich (10 Minuten vor der Datenbankzeit, auf allen Seiten eines Laufs gleich).",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Einträge pro Seite (1 bis 500, Standard 100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          },
          {
            "$ref": "#/components/parameters/ReadCursor"
          },
          {
            "$ref": "#/components/parameters/ReadUpdatedSince"
          },
          {
            "name": "market",
            "in": "query",
            "description": "Idealo-Markt `de` (Standard) oder `at` (nur, wo eingerichtet).",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "at"
              ],
              "default": "de"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Seite der Preis-Check-Ergebnisse.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "pagination",
                    "source",
                    "market",
                    "state",
                    "watchlist"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CompetitorResult"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/Pagination"
                    },
                    "source": {
                      "const": "idealo"
                    },
                    "market": {
                      "type": "string",
                      "enum": [
                        "de",
                        "at"
                      ]
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "no_own_shop",
                        "no_results"
                      ]
                    },
                    "watchlist": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "none_marked",
                        "unavailable",
                        "not_for_market"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`updated_since` ungültig (`invalid_updated_since`) oder Cursor `after` ungültig, verändert oder aus einer anderen Abfrage (`invalid_cursor`).",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "invalid_updated_since": {
                    "value": {
                      "error": "updated_since muss ein Zeitpunkt nach RFC 3339 mit Zeitzone sein, z. B. 2026-12-01T10:00:00Z",
                      "code": "invalid_updated_since"
                    }
                  },
                  "invalid_cursor": {
                    "value": {
                      "error": "Cursor \"after\" ist ungültig oder gehört nicht zu dieser Abfrage. Ohne after mit demselben updated_since neu beginnen.",
                      "code": "invalid_cursor"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalError"
          },
          "503": {
            "description": "Vorübergehend nicht verfügbar (Zeitüberschreitung oder Datenbank-Update noch nicht eingespielt). Später erneut versuchen.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "examples": {
                  "unavailable": {
                    "value": {
                      "error": "Preis-Check-Ergebnisse sind über die API noch nicht verfügbar. Bitte versuch es später erneut.",
                      "code": "service_unavailable"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "rp_…",
        "description": "API-Schlüssel der Organisation (Format `rp_` + 32 Hex-Zeichen) im Header `Authorization: Bearer rp_…`. Ein Schlüssel hat vollen Zugriff auf die Stammdaten und freigegebenen Preise seiner Organisation."
      }
    },
    "headers": {
      "X-RateLimit-Limit": {
        "description": "Limit des Schlüssel-Fensters (100 Anfragen pro Minute).",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Verbleibende Anfragen im aktuellen Fenster des Schlüssels.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Reset": {
        "description": "Ende des Fensters als Unix-Zeitstempel in Millisekunden.",
        "schema": {
          "type": "integer",
          "format": "int64"
        }
      },
      "Retry-After": {
        "description": "Sekunden bis zum nächsten Versuch (1 bis 60).",
        "schema": {
          "type": "integer"
        }
      }
    },
    "parameters": {
      "ExternalId": {
        "name": "external_id",
        "in": "path",
        "required": true,
        "description": "Eigene Kennung des Datensatzes (URL-kodiert).",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Einträge pro Seite (1 bis 1000, Standard 50). Werte außerhalb des Bereichs werden begrenzt, nicht abgelehnt.",
        "schema": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000,
          "default": 50
        }
      },
      "Offset": {
        "name": "offset",
        "in": "query",
        "description": "Offset (0 bis 1.000.000). Wird mit `after` ignoriert. Werte außerhalb des Bereichs werden begrenzt, nicht abgelehnt.",
        "schema": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000000,
          "default": 0
        }
      },
      "After": {
        "name": "after",
        "in": "query",
        "description": "Cursor: `external_id` des letzten Eintrags der Vorseite (am besten `next_cursor`). Unbekannter Wert: 422.",
        "schema": {
          "type": "string"
        }
      },
      "UpdatedSince": {
        "name": "updated_since",
        "in": "query",
        "description": "Nur Änderungen seit diesem Zeitpunkt (RFC 3339 mit Zeitzone, z. B. `2026-12-01T10:00:00Z`; Bruchteile von Sekunden erlaubt). Sortierung dann: älteste Änderung zuerst. Folgeseiten mit `after` = `next_cursor` und demselben `updated_since`, kein `offset`. Antwort enthält `pagination.next_updated_since` für den nächsten Lauf. Gelöschte Datensätze kommen als `DeletedEntry` (nur mindestens 24 Stunden lang; Löschungen erkennt zuverlässig nur ein Vollabgleich). Ungültig, ohne Zeitzone oder mehr als 5 Minuten in der Zukunft: 400 `invalid_updated_since`. Siehe https://priceivy.com/docs/api-v1#delta",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ReadUpdatedSince": {
        "name": "updated_since",
        "in": "query",
        "description": "Nur Einträge mit `updated_at` ab diesem Zeitpunkt (einschließlich). Gleiche Regeln wie bei den Listen: RFC 3339 mit Zeitzone, z. B. `2026-12-01T10:00:00Z`, Bruchteile von Sekunden erlaubt. Für den nächsten Abgleich `pagination.next_updated_since` des letzten Laufs übergeben. Ungültig, ohne Zeitzone oder mehr als 5 Minuten in der Zukunft: 400 `invalid_updated_since`. Folgeseiten mit demselben `updated_since`.",
        "schema": {
          "type": "string",
          "format": "date-time"
        }
      },
      "ReadCursor": {
        "name": "after",
        "in": "query",
        "description": "Undurchsichtiger, signierter Cursor: `pagination.next_cursor` der vorherigen Seite unverändert übergeben, zusammen mit denselben übrigen Parametern (`updated_since`, Filter). Ungültig, verändert oder aus einer anderen Abfrage: 400 `invalid_cursor`, dann ohne `after` neu beginnen.",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Ungültiger JSON-Body.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "invalid_json": {
                "value": {
                  "error": "Ungültiger JSON-Body",
                  "code": "validation_failed"
                }
              }
            }
          }
        }
      },
      "Unauthorized": {
        "description": "API-Schlüssel fehlt oder ist ungültig. Nach zu vielen Fehlversuchen von derselben IP-Adresse antwortet die API stattdessen mit 429 (`code: auth_rate_limited`). Keine `X-RateLimit-*`-Header.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "missing_key": {
                "summary": "Schlüssel fehlt",
                "value": {
                  "error": "API-Key fehlt",
                  "code": "unauthorized"
                }
              },
              "invalid_key": {
                "summary": "Schlüssel ungültig",
                "value": {
                  "error": "API-Key ist ungültig",
                  "code": "unauthorized"
                }
              }
            }
          }
        }
      },
      "Forbidden": {
        "description": "Schlüssel abgelaufen (`api_key_expired`), Organisation deaktiviert (`organization_deactivated`), Nur-Lesen-Schlüssel schreibt (`forbidden_read_only`), Datentyp in der Import-Auswahl ausgeschaltet (`import_locked`) oder Artikel-Limit des Plans erreicht (`plan_limit_reached`).",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "read_only": {
                "summary": "Nur-Lesen-Schlüssel schreibt",
                "value": {
                  "error": "Dieser API-Schlüssel ist nur zum Lesen freigegeben.",
                  "code": "forbidden_read_only"
                }
              },
              "expired": {
                "summary": "Schlüssel abgelaufen",
                "value": {
                  "error": "API-Key ist abgelaufen",
                  "code": "api_key_expired"
                }
              },
              "deactivated": {
                "summary": "Organisation deaktiviert",
                "value": {
                  "error": "Organisation ist deaktiviert",
                  "code": "organization_deactivated"
                }
              },
              "import_locked": {
                "summary": "Datentyp in der Import-Auswahl ausgeschaltet",
                "value": {
                  "error": "Kunden sind in deiner Import-Auswahl ausgeschaltet. Aktiviere „Kunden“ unter Einrichten → Import / Export in Priceivy, wenn wir sie übernehmen sollen. Löschen bleibt möglich.",
                  "code": "import_locked"
                }
              },
              "plan_limit": {
                "summary": "Artikel-Limit des Plans erreicht",
                "value": {
                  "error": "Artikel-Limit deines Plans erreicht (max. 1.000 Artikel). Bestehende Artikel kannst du weiter aktualisieren; für neue Artikel wechsle unter Einstellungen → Zahlungen auf einen größeren Plan.",
                  "code": "plan_limit_reached"
                }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Datensatz nicht gefunden.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "not_found": {
                "value": {
                  "error": "Produkt nicht gefunden",
                  "code": "not_found"
                }
              }
            }
          }
        }
      },
      "Conflict": {
        "description": "Konflikt, z. B. gleichzeitiges Anlegen derselben `external_id`.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "conflict": {
                "value": {
                  "error": "Produkt mit dieser external_id existiert bereits",
                  "code": "conflict"
                }
              }
            }
          }
        }
      },
      "Unprocessable": {
        "description": "Validierungsfehler. Bei Bulk-Requests mit `details.validation_errors`.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/Error"
                },
                {
                  "$ref": "#/components/schemas/BulkValidationError"
                }
              ]
            },
            "examples": {
              "validation": {
                "summary": "Feld ungültig",
                "value": {
                  "error": "name ist erforderlich",
                  "code": "validation_failed"
                }
              },
              "invalid_cursor": {
                "summary": "Cursor unbekannt",
                "value": {
                  "error": "Cursor \"after\" verweist auf eine unbekannte external_id: SKU-999",
                  "code": "invalid_cursor"
                }
              },
              "bulk": {
                "summary": "Bulk-Validierung",
                "value": {
                  "error": "1 von 2 Items haben Validierungsfehler",
                  "code": "validation_failed",
                  "details": {
                    "validation_errors": [
                      {
                        "index": 1,
                        "external_id": "SKU-2",
                        "error": "name ist erforderlich"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Zu viele Anfragen. Zwei Varianten: (1) `code: rate_limited`, Rate-Limit überschritten (100/min je Schlüssel, 300/min je Organisation): mit `X-RateLimit-*` und `Retry-After`. (2) `code: auth_rate_limited`: zu viele fehlgeschlagene Anmeldeversuche von derselben IP-Adresse (30 pro Minute), ersetzt dann die 401. Diese Variante kommt ohne `X-RateLimit-*`, nur mit `Retry-After`. Nicht automatisch wiederholen, zuerst den API-Schlüssel prüfen.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "rate_limited": {
                "summary": "Rate-Limit (mit Backoff wiederholen)",
                "value": {
                  "error": "Rate Limit überschritten. Bitte versuch es später erneut.",
                  "code": "rate_limited"
                }
              },
              "auth_rate_limited": {
                "summary": "Fehlversuche (nicht wiederholen, Schlüssel prüfen)",
                "value": {
                  "error": "Zu viele fehlgeschlagene Anmeldeversuche. Bitte versuch es später erneut.",
                  "code": "auth_rate_limited"
                }
              }
            }
          }
        }
      },
      "InternalError": {
        "description": "Interner Serverfehler.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "internal": {
                "value": {
                  "error": "Interner Serverfehler",
                  "code": "internal_error"
                }
              }
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "Vorübergehend nicht verfügbar: Import-Auswahl nicht lesbar (Kundendaten werden dann nicht verarbeitet) oder, nur mit `updated_since`, der Abruf von Änderungen. Später erneut versuchen.",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "unavailable": {
                "value": {
                  "error": "Die Import-Auswahl ist gerade nicht lesbar. Bitte versuch es später erneut.",
                  "code": "service_unavailable"
                }
              },
              "delta_unavailable": {
                "value": {
                  "error": "Der Abruf mit updated_since ist vorübergehend nicht verfügbar",
                  "code": "service_unavailable"
                }
              }
            }
          }
        }
      },
      "DeltaBadRequest": {
        "description": "Nur mit `updated_since`: Zeitpunkt ungültig (`invalid_updated_since`), Cursor `after` ungültig, verändert oder aus einer anderen Abfrage (`invalid_cursor`) oder ein Parameter, der sich mit `updated_since` nicht verträgt (`validation_failed`).",
        "headers": {
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "examples": {
              "invalid_updated_since": {
                "value": {
                  "error": "updated_since muss ein Zeitpunkt nach RFC 3339 mit Zeitzone sein, z. B. 2026-12-01T10:00:00Z",
                  "code": "invalid_updated_since"
                }
              },
              "invalid_cursor": {
                "value": {
                  "error": "Cursor \"after\" ist ungültig oder gehört nicht zu dieser Abfrage. Ohne after mit demselben updated_since neu beginnen.",
                  "code": "invalid_cursor"
                }
              },
              "offset": {
                "value": {
                  "error": "offset ist mit updated_since nicht möglich; Folgeseiten mit after=next_cursor abrufen",
                  "code": "validation_failed"
                }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "code"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Menschenlesbare Fehlermeldung (Deutsch)."
          },
          "code": {
            "type": "string",
            "enum": [
              "unauthorized",
              "auth_rate_limited",
              "api_key_expired",
              "organization_deactivated",
              "forbidden_read_only",
              "plan_limit_reached",
              "import_locked",
              "forbidden",
              "not_found",
              "validation_failed",
              "invalid_cursor",
              "invalid_updated_since",
              "payload_too_large",
              "conflict",
              "rate_limited",
              "service_unavailable",
              "internal_error"
            ],
            "description": "Maschinenlesbarer, stabiler Fehlercode (snake_case). Steht in jeder Fehlerantwort der API. Ausnahme: Ein 413 vom Body-Limit der Plattform (4,5 MB) wird vor der API beantwortet, ist kein JSON und hat kein `code`; werte dann den HTTP-Status aus. Neue Codes können hinzukommen; behandle unbekannte Codes wie den HTTP-Status. Bedeutung und empfohlene Reaktion: https://priceivy.com/docs/api-v1#fehlercodes"
          },
          "details": {
            "type": "object",
            "additionalProperties": true,
            "description": "Optional, aktuell nur bei Bulk-Validierungsfehlern (422): `validation_errors`."
          }
        },
        "description": "Fehlerantwort. `error` ist ein deutscher Text, `code` ein stabiler maschinenlesbarer Code, `details` ist optional."
      },
      "BulkValidationError": {
        "type": "object",
        "required": [
          "error",
          "code",
          "details"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "validation_failed"
            ]
          },
          "details": {
            "type": "object",
            "required": [
              "validation_errors"
            ],
            "properties": {
              "validation_errors": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "index",
                    "external_id",
                    "error"
                  ],
                  "properties": {
                    "index": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "external_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "error": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Pagination": {
        "type": "object",
        "required": [
          "limit",
          "offset",
          "total"
        ],
        "properties": {
          "limit": {
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Gesamtzahl; bei `/calculated-prices` mit Cursor kann sie `null` sein, mit `updated_since` ist sie immer `null`."
          },
          "next_cursor": {
            "type": "string",
            "description": "Wert für den nächsten `after`-Parameter. Fehlt auf der letzten Seite. Eine Seite kann kürzer als `limit` sein und trotzdem einen Cursor liefern. Mit `updated_since` ein undurchsichtiger, signierter Wert (nur zusammen mit demselben `updated_since` gültig)."
          },
          "next_updated_since": {
            "type": "string",
            "format": "date-time",
            "description": "Nur mit `updated_since`: Wert für `updated_since` im nächsten Lauf (UTC, Mikrosekunden). Auf allen Seiten eines Laufs gleich; liegt 10 Minuten vor der Serverzeit, die letzten Änderungen kommen deshalb im nächsten Lauf erneut (Upserts idempotent schreiben)."
          }
        }
      },
      "CreatedBy": {
        "oneOf": [
          {
            "type": "object",
            "required": [
              "type"
            ],
            "properties": {
              "type": {
                "const": "user"
              }
            }
          },
          {
            "type": "object",
            "required": [
              "type",
              "key_prefix"
            ],
            "properties": {
              "type": {
                "const": "api_key"
              },
              "key_prefix": {
                "type": "string"
              }
            }
          }
        ],
        "description": "Wer den Datensatz angelegt hat. `null`, wenn unbekannt."
      },
      "KeyValue": {
        "type": "object",
        "required": [
          "key",
          "value",
          "created_at"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "value": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProductPriceInput": {
        "type": "object",
        "required": [
          "price_type",
          "currency"
        ],
        "properties": {
          "price_type": {
            "type": "string",
            "maxLength": 50,
            "description": "Preisart, z. B. `ek`. Einige Typen sind gesperrt (Blacklist, siehe API-Dokumentation)."
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "description": "ISO-4217-Code, z. B. `EUR`."
          },
          "price_net": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Netto in Cent."
          },
          "price_gross": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Brutto in Cent. Mindestens `price_net` oder `price_gross` ist Pflicht."
          }
        },
        "additionalProperties": false
      },
      "ProductPrice": {
        "type": "object",
        "required": [
          "price_type",
          "currency",
          "price_net",
          "price_gross",
          "created_at"
        ],
        "properties": {
          "price_type": {
            "type": "string"
          },
          "currency": {
            "type": [
              "string",
              "null"
            ]
          },
          "price_net": {
            "type": [
              "integer",
              "null"
            ]
          },
          "price_gross": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProductImageInput": {
        "type": "object",
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048,
            "description": "http- oder https-URL."
          },
          "sort": {
            "type": "number"
          }
        },
        "additionalProperties": false
      },
      "ProductImage": {
        "type": "object",
        "required": [
          "url",
          "sort",
          "created_at"
        ],
        "properties": {
          "url": {
            "type": "string"
          },
          "sort": {
            "type": "number"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "KeyValueInput": {
        "type": "object",
        "required": [
          "key",
          "value"
        ],
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 255
          },
          "value": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "AttributeInput": {
        "type": "object",
        "required": [
          "key",
          "value"
        ],
        "properties": {
          "key": {
            "type": "string",
            "maxLength": 255
          },
          "value": {
            "oneOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "number"
              }
            ],
            "description": "Text oder endliche Zahl."
          },
          "value_type": {
            "type": "string",
            "enum": [
              "text",
              "number"
            ],
            "description": "Setzt den org-weiten Typ des Keys. Fehlt das Feld, bleibt der Typ unverändert."
          }
        }
      },
      "QuantityTierInput": {
        "type": "object",
        "required": [
          "external_id",
          "min_quantity"
        ],
        "properties": {
          "external_id": {
            "type": "string",
            "maxLength": 255
          },
          "min_quantity": {
            "type": "number",
            "exclusiveMinimum": 0
          },
          "customer_external_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "customer_group_external_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255,
            "description": "Nicht zusammen mit `customer_external_id` setzbar."
          }
        },
        "additionalProperties": false
      },
      "QuantityTier": {
        "type": "object",
        "required": [
          "external_id",
          "min_quantity",
          "customer_external_id",
          "customer_group_external_id",
          "created_at"
        ],
        "properties": {
          "external_id": {
            "type": "string"
          },
          "min_quantity": {
            "type": "number"
          },
          "customer_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_group_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProductFields": {
        "type": "object",
        "properties": {
          "sku": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "gtin": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "import_excluded": {
            "type": "boolean",
            "description": "Ist es `true`, überspringt der Upsert das Produkt (Antwort 200 mit `warning`)."
          },
          "export_excluded": {
            "type": "boolean",
            "description": "Blendet das Produkt in `/calculated-prices` aus."
          },
          "prices": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/ProductPriceInput"
            },
            "description": "`price_type` + `currency` dürfen nur einmal vorkommen."
          },
          "images": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/ProductImageInput"
            }
          },
          "identifiers": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "$ref": "#/components/schemas/KeyValueInput"
            }
          },
          "attributes": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/AttributeInput"
            }
          },
          "category_external_ids": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "quantity_tiers": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/QuantityTierInput"
            }
          },
          "tax_rate_group_external_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          }
        }
      },
      "ProductUpsert": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProductFields"
          }
        ],
        "description": "Body für `PUT /products/{external_id}`. Die `external_id` kommt aus dem Pfad. Unbekannte Felder führen zu 422. Gesendete Felder ersetzen den Stand; nicht gesendete bleiben unverändert.",
        "unevaluatedProperties": false
      },
      "ProductBulkItem": {
        "description": "Wie `ProductUpsert`, zusätzlich mit `external_id`. Unbekannte Felder führen zu 422.",
        "allOf": [
          {
            "$ref": "#/components/schemas/ProductFields"
          },
          {
            "type": "object",
            "required": [
              "external_id"
            ],
            "properties": {
              "external_id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 255
              }
            }
          }
        ],
        "unevaluatedProperties": false
      },
      "Product": {
        "type": "object",
        "required": [
          "external_id",
          "sku",
          "name",
          "gtin",
          "import_excluded",
          "export_excluded",
          "created_at",
          "updated_at",
          "created_by",
          "prices",
          "images",
          "identifiers",
          "attributes",
          "categories",
          "quantity_tiers",
          "tax_rate_group_external_id"
        ],
        "properties": {
          "external_id": {
            "type": "string"
          },
          "sku": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "gtin": {
            "type": [
              "string",
              "null"
            ]
          },
          "import_excluded": {
            "type": "boolean"
          },
          "export_excluded": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreatedBy"
              },
              {
                "type": "null"
              }
            ]
          },
          "prices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductPrice"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProductImage"
            }
          },
          "identifiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyValue"
            }
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyValue"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "external_id",
                "name"
              ],
              "properties": {
                "external_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "quantity_tiers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuantityTier"
            }
          },
          "tax_rate_group_external_id": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CategoryUpsert": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "parent_external_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "attributes": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/AttributeInput"
            }
          }
        },
        "additionalProperties": false
      },
      "CategoryBulkItem": {
        "type": "object",
        "required": [
          "external_id",
          "name"
        ],
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "parent_external_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "attributes": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "$ref": "#/components/schemas/AttributeInput"
            }
          }
        },
        "additionalProperties": false
      },
      "Category": {
        "type": "object",
        "required": [
          "external_id",
          "name",
          "parent_external_id",
          "created_at",
          "updated_at",
          "created_by",
          "attributes"
        ],
        "properties": {
          "external_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "parent_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreatedBy"
              },
              {
                "type": "null"
              }
            ]
          },
          "attributes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KeyValue"
            }
          }
        }
      },
      "CustomerGroupUpsert": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "additionalProperties": false
      },
      "CustomerGroupBulkItem": {
        "type": "object",
        "required": [
          "external_id",
          "name"
        ],
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          }
        },
        "additionalProperties": false
      },
      "CustomerGroup": {
        "type": "object",
        "required": [
          "external_id",
          "name",
          "created_at",
          "updated_at",
          "created_by"
        ],
        "properties": {
          "external_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreatedBy"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CustomerUpsert": {
        "type": "object",
        "required": [
          "customer_number",
          "name"
        ],
        "properties": {
          "customer_number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "customer_group_external_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          }
        },
        "additionalProperties": false
      },
      "CustomerBulkItem": {
        "type": "object",
        "required": [
          "external_id",
          "customer_number",
          "name"
        ],
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "customer_number": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "customer_group_external_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          }
        },
        "additionalProperties": false
      },
      "Customer": {
        "type": "object",
        "required": [
          "external_id",
          "customer_number",
          "name",
          "customer_group_external_id",
          "created_at",
          "updated_at",
          "created_by"
        ],
        "properties": {
          "external_id": {
            "type": "string"
          },
          "customer_number": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "customer_group_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreatedBy"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "TaxRate": {
        "type": "object",
        "required": [
          "country_iso2",
          "rate"
        ],
        "properties": {
          "country_iso2": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "ISO 3166-1 alpha-2, z. B. `DE`."
          },
          "rate": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000,
            "description": "Basispunkte: 1900 = 19,00 %."
          }
        },
        "additionalProperties": false
      },
      "TaxRateGroupUpsert": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "tax_rates": {
            "type": "array",
            "maxItems": 600,
            "items": {
              "$ref": "#/components/schemas/TaxRate"
            },
            "description": "Pro Land höchstens ein Eintrag."
          }
        },
        "additionalProperties": false
      },
      "TaxRateGroupBulkItem": {
        "type": "object",
        "required": [
          "external_id",
          "name"
        ],
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "tax_rates": {
            "type": "array",
            "maxItems": 600,
            "items": {
              "$ref": "#/components/schemas/TaxRate"
            }
          }
        },
        "additionalProperties": false
      },
      "TaxRateGroup": {
        "type": "object",
        "required": [
          "external_id",
          "name",
          "tax_rates",
          "created_at",
          "updated_at",
          "created_by"
        ],
        "properties": {
          "external_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "tax_rates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxRate"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CreatedBy"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "BulkDeleteRequest": {
        "type": "object",
        "required": [
          "external_ids"
        ],
        "properties": {
          "external_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "additionalProperties": false
      },
      "BulkItemError": {
        "type": "object",
        "required": [
          "external_id",
          "error"
        ],
        "properties": {
          "external_id": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      },
      "BulkUpsertResult": {
        "type": "object",
        "required": [
          "summary",
          "errors"
        ],
        "properties": {
          "summary": {
            "type": "object",
            "required": [
              "total",
              "created",
              "updated",
              "failed",
              "duplicates",
              "skipped"
            ],
            "properties": {
              "total": {
                "type": "integer"
              },
              "created": {
                "type": "integer"
              },
              "updated": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "duplicates": {
                "type": "integer"
              },
              "skipped": {
                "type": "integer"
              }
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkItemError"
            }
          },
          "skipped_external_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "BulkDeleteResult": {
        "type": "object",
        "required": [
          "summary",
          "errors"
        ],
        "properties": {
          "summary": {
            "type": "object",
            "required": [
              "total",
              "succeeded",
              "failed"
            ],
            "properties": {
              "total": {
                "type": "integer"
              },
              "succeeded": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              }
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BulkItemError"
            }
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "DeleteResult": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "success": {
                "const": true
              }
            }
          }
        }
      },
      "CalculatedPriceBase": {
        "type": "object",
        "required": [
          "price_net",
          "price_gross",
          "tax_rate",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "price_net": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Netto in Cent."
          },
          "price_gross": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Brutto in Cent."
          },
          "tax_rate": {
            "type": [
              "number",
              "null"
            ]
          },
          "valid_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "status": {
            "const": "approved",
            "description": "Die API liefert ausschließlich freigegebene Preise."
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PriceTypeGroup": {
        "type": "object",
        "required": [
          "base",
          "customer_group_prices",
          "customer_prices",
          "quantity_tier_prices"
        ],
        "properties": {
          "base": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CalculatedPriceBase"
              },
              {
                "type": "null"
              }
            ]
          },
          "customer_group_prices": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/CalculatedPriceBase"
                },
                {
                  "type": "object",
                  "required": [
                    "customer_group_external_id"
                  ],
                  "properties": {
                    "customer_group_external_id": {
                      "type": "string"
                    },
                    "customer_group_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              ]
            }
          },
          "customer_prices": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/CalculatedPriceBase"
                },
                {
                  "type": "object",
                  "required": [
                    "customer_external_id"
                  ],
                  "properties": {
                    "customer_external_id": {
                      "type": "string"
                    },
                    "customer_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              ]
            }
          },
          "quantity_tier_prices": {
            "type": "array",
            "items": {
              "allOf": [
                {
                  "$ref": "#/components/schemas/CalculatedPriceBase"
                },
                {
                  "type": "object",
                  "required": [
                    "quantity_tier_external_id",
                    "min_quantity",
                    "customer_external_id",
                    "customer_group_external_id"
                  ],
                  "properties": {
                    "quantity_tier_external_id": {
                      "type": "string"
                    },
                    "min_quantity": {
                      "type": "number"
                    },
                    "customer_external_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "customer_group_external_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "customer_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "customer_group_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              ]
            }
          }
        }
      },
      "PlatformPrices": {
        "type": "object",
        "required": [
          "platform_name",
          "platform_provider",
          "platform_country_iso2",
          "platform_currency_iso3",
          "prices"
        ],
        "properties": {
          "platform_id": {
            "type": "string",
            "description": "Interne ID des Kanals; optional."
          },
          "platform_name": {
            "type": "string"
          },
          "platform_provider": {
            "type": "string"
          },
          "platform_country_iso2": {
            "type": "string"
          },
          "platform_currency_iso3": {
            "type": "string"
          },
          "prices": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/PriceTypeGroup"
            },
            "description": "Schlüssel = Preisart (`price`, `special_price`, `min_price`, `max_price`)."
          }
        }
      },
      "GroupedCalculatedPrice": {
        "type": "object",
        "required": [
          "product_external_id",
          "platforms"
        ],
        "properties": {
          "product_external_id": {
            "type": "string"
          },
          "platforms": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlatformPrices"
            }
          },
          "deleted": {
            "type": "boolean",
            "const": true,
            "description": "Nur mit `updated_since`: Das Produkt hat keine lieferbaren Preise mehr (gelöscht, vom Export ausgeschlossen oder letzter freigegebener Preis entfernt); `platforms` ist dann leer."
          }
        }
      },
      "ImportSettings": {
        "type": "object",
        "required": [
          "customized",
          "updated_at"
        ],
        "properties": {
          "products": {
            "type": "boolean"
          },
          "categories": {
            "type": "boolean"
          },
          "quantity_tiers": {
            "type": "boolean"
          },
          "customers": {
            "type": "boolean"
          },
          "customer_groups": {
            "type": "boolean"
          },
          "customized": {
            "type": "boolean",
            "description": "`false` = nie gespeichert, es gelten die Standardwerte."
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sync": {
            "type": "object",
            "description": "Was der Abgleich-Client automatisch tun darf. Fehlt, wenn der Stand nicht lesbar ist.",
            "properties": {
              "import_auto_enabled": {
                "type": "boolean"
              },
              "export_enabled": {
                "type": "boolean"
              },
              "export_auto_enabled": {
                "type": "boolean"
              }
            }
          }
        },
        "description": "Je Datentyp ein Schalter, ob der Import erlaubt ist (`true`), dazu `customized`, `updated_at` und optional `sync`."
      },
      "ProductBulkUpsertRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/ProductBulkItem"
            }
          }
        }
      },
      "CategoryBulkUpsertRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/CategoryBulkItem"
            }
          }
        }
      },
      "CustomerBulkUpsertRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/CustomerBulkItem"
            }
          }
        }
      },
      "CustomerGroupBulkUpsertRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/CustomerGroupBulkItem"
            }
          }
        }
      },
      "TaxRateGroupBulkUpsertRequest": {
        "type": "object",
        "required": [
          "items"
        ],
        "additionalProperties": false,
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/TaxRateGroupBulkItem"
            }
          }
        }
      },
      "DeletedEntry": {
        "type": "object",
        "description": "Nur mit `updated_since`: soft-gelöschter Datensatz. Bleibt mindestens 24 Stunden abrufbar, danach endgültig entfernt.",
        "required": [
          "external_id",
          "deleted",
          "deleted_at",
          "updated_at"
        ],
        "properties": {
          "external_id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "const": true
          },
          "deleted_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PendingApproval": {
        "type": "object",
        "description": "Offener Preisvorschlag, der den Live-Preis ändern würde. Beträge in Cent. Kein Einkaufspreis, kein Kundenname (Kunden nur über `customer_external_id`).",
        "required": [
          "proposal_id",
          "product_external_id",
          "product_name",
          "platform_name",
          "platform_provider",
          "platform_country_iso2",
          "price_type",
          "currency_iso3",
          "proposed_price_net",
          "proposed_price_gross",
          "live_price_net",
          "live_price_gross",
          "change_percent_gross",
          "customer_external_id",
          "customer_group_external_id",
          "customer_group_name",
          "quantity_tier_external_id",
          "min_quantity",
          "valid_from",
          "valid_to",
          "updated_at",
          "approval_url"
        ],
        "properties": {
          "proposal_id": {
            "type": "string",
            "description": "Stabile ID des Vorschlags (zum Entdoppeln beim Abgleich)."
          },
          "product_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "platform_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Kanal (Kalkulationskanal)."
          },
          "platform_provider": {
            "type": [
              "string",
              "null"
            ]
          },
          "platform_country_iso2": {
            "type": [
              "string",
              "null"
            ]
          },
          "price_type": {
            "type": "string",
            "enum": [
              "price",
              "special_price"
            ],
            "description": "Verkaufspreis oder Sonderpreis."
          },
          "currency_iso3": {
            "type": [
              "string",
              "null"
            ]
          },
          "proposed_price_net": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Vorgeschlagener Preis netto in Cent."
          },
          "proposed_price_gross": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Vorgeschlagener Preis brutto in Cent."
          },
          "live_price_net": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Aktueller freigegebener Preis netto in Cent; `null`, wenn es noch keinen gibt."
          },
          "live_price_gross": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Aktueller freigegebener Preis brutto in Cent."
          },
          "change_percent_gross": {
            "type": [
              "number",
              "null"
            ],
            "description": "Änderung brutto in Prozent (eine Nachkommastelle); `null` ohne Live-Preis."
          },
          "customer_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_group_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "customer_group_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity_tier_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "min_quantity": {
            "type": [
              "number",
              "null"
            ]
          },
          "valid_from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "valid_to": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Zeitpunkt der letzten Berechnung; Sortier- und Delta-Feld."
          },
          "approval_url": {
            "type": "string",
            "format": "uri",
            "description": "Link zur Freigabe in Priceivy."
          }
        }
      },
      "MarkedCompetitorResult": {
        "type": "object",
        "description": "Ein Wettbewerber, den deine Organisation in Priceivy markiert hat (Einstellungen → Preis-Check, Modus „beobachten“). Nur hier stehen Händlernamen.",
        "required": [
          "alias",
          "name",
          "mode",
          "total_gross",
          "competitor_rank",
          "ahead_of_you"
        ],
        "properties": {
          "alias": {
            "type": "string",
            "description": "Kurzname, den deine Organisation vergeben hat."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Händlername aus dem Idealo-Händlerverzeichnis (wie in der App); `null`, wenn der Händler dort nicht mehr steht."
          },
          "mode": {
            "type": "string",
            "enum": [
              "watch",
              "ignore"
            ]
          },
          "total_gross": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Bestes Angebot dieses Händlers: Gesamtpreis inkl. Versand, brutto in Cent."
          },
          "competitor_rank": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Platz unter den Konkurrenzangeboten nach Gesamtpreis (eigene Angebote nicht mitgezählt)."
          },
          "ahead_of_you": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Günstiger als dein eigenes Angebot; `null` ohne eigenes Angebot."
          }
        }
      },
      "CompetitorResult": {
        "type": "object",
        "description": "Letztes Preis-Check-Ergebnis eines Produkts auf einer Idealo-Preis-Check-Plattform. Beträge brutto in Cent. Händlernamen nur in `marked_competitors`; alle anderen Händler bleiben anonym.",
        "required": [
          "product_external_id",
          "platform_name",
          "source",
          "market",
          "competitor_offer_count",
          "cheapest_competitor_total_gross",
          "own_rank",
          "own_total_gross",
          "own_shipping_gross",
          "rank_one_total_gross",
          "gap_to_rank_one_gross",
          "checked_at",
          "updated_at"
        ],
        "properties": {
          "product_external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "platform_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Preis-Check-Plattform."
          },
          "source": {
            "const": "idealo"
          },
          "market": {
            "type": "string",
            "enum": [
              "de",
              "at"
            ]
          },
          "competitor_offer_count": {
            "type": "integer",
            "description": "Anzahl Konkurrenzangebote (ohne eigene)."
          },
          "cheapest_competitor_total_gross": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Günstigstes Konkurrenzangebot inkl. Versand."
          },
          "own_rank": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Dein Platz nach Gesamtpreis inkl. Versand (1 = günstigstes Angebot). `null` ohne eigenes Angebot oder ohne hinterlegten eigenen Idealo-Shop."
          },
          "own_total_gross": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Dein Gesamtpreis inkl. Versand."
          },
          "own_shipping_gross": {
            "type": [
              "integer",
              "null"
            ]
          },
          "rank_one_total_gross": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Gesamtpreis des Platz-1-Angebots (eigenes eingeschlossen)."
          },
          "gap_to_rank_one_gross": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Dein Gesamtpreis minus Platz 1 (0 = du bist Platz 1)."
          },
          "checked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Zeitpunkt des letzten Preis-Checks."
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "Letzte Änderung des Eintrags (Wert oder neuer Preis-Check); Sortier- und Delta-Feld."
          },
          "marked_competitors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MarkedCompetitorResult"
            },
            "description": "Nur `market: de`. Stand des letzten Preis-Checks (`checked_at`), nicht live. `[]`: kein markierter Wettbewerber hatte dabei ein Angebot (oder keiner ist im Modus „beobachten“ markiert). Eigene Idealo-Shops zählen nie als Wettbewerber. Fehlt, wenn es keine sichere Aussage gibt: Der letzte Preis-Check kennt die aktuellen Markierungen noch nicht (z. B. Wettbewerber danach markiert oder umbenannt; ab dem nächsten Preis-Check wieder da), oder Markierungen oder eigene Shops sind gerade nicht lesbar (`watchlist: unavailable`)."
          }
        }
      }
    }
  }
}
