{
  "openapi": "3.1.0",
  "info": {
    "title": "R.I.O. – Agenten-Serviceanfragen",
    "version": "1.0.0",
    "description": "Serviceanfrage im Auftrag eines Kunden. Zuerst GET mit Accept: application/json, Cookies beibehalten und Sitzungstoken verwenden. Der Kunde muss die Bestätigungsmail selbst bestätigen."
  },
  "servers": [
    {
      "url": "https://werkstatt.rio-uhren.de"
    }
  ],
  "paths": {
    "/anfrage": {
      "get": {
        "operationId": "prepareServiceInquiry",
        "summary": "Prepare session and read current requirements",
        "parameters": [
          {
            "name": "lang",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "de",
                "en"
              ],
              "default": "de"
            }
          },
          {
            "name": "Accept",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "JSON bootstrap; retain Set-Cookie headers. Do not cache tokens."
          }
        }
      },
      "post": {
        "operationId": "submitServiceInquiry",
        "summary": "Submit a customer-authorised inquiry pending email confirmation",
        "parameters": [
          {
            "name": "Accept",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "application/json"
            }
          },
          {
            "name": "X-CSRF-TOKEN",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "csrf_token from bootstrap; use the same session cookies."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "request_key",
                  "customer_authorized",
                  "privacy",
                  "language",
                  "source_site",
                  "agent_name",
                  "first_name",
                  "last_name",
                  "email",
                  "phone",
                  "address",
                  "postal_code",
                  "city",
                  "country",
                  "form_token"
                ],
                "properties": {
                  "first_name": {
                    "type": "string",
                    "maxLength": 60
                  },
                  "last_name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "company": {
                    "type": "string",
                    "maxLength": 35
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 50
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 30
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 35
                  },
                  "postal_code": {
                    "type": "string",
                    "maxLength": 9
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 30
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "agent_name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "form_token": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "request_key": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Stable UUID for retries of the same inquiry. A changed payload with the same UUID returns 409."
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "de",
                      "en"
                    ],
                    "default": "de"
                  },
                  "source_site": {
                    "type": "string",
                    "enum": [
                      "rio",
                      "speedmaster"
                    ],
                    "default": "rio"
                  },
                  "country": {
                    "type": "string",
                    "enum": [
                      "DE",
                      "AT",
                      "CH",
                      "LU",
                      "NL",
                      "BE",
                      "FR",
                      "IT",
                      "DK",
                      "PL",
                      "CZ"
                    ]
                  },
                  "privacy": {
                    "type": "boolean",
                    "const": true
                  },
                  "customer_authorized": {
                    "type": "boolean",
                    "const": true
                  },
                  "pickup": {
                    "type": "boolean",
                    "default": false
                  },
                  "pickup_day": {
                    "type": "string",
                    "format": "date",
                    "description": "Required when pickup=true. Select from the live bootstrap pickup_days."
                  },
                  "watches": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "type": "object",
                      "properties": {
                        "category": {
                          "type": "string",
                          "enum": [
                            "klein",
                            "gross",
                            "tasche"
                          ]
                        },
                        "type": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "brand": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "model": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "reference_number": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "serial_number": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "caliber": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "case_material": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "band_material": {
                          "type": "string",
                          "maxLength": 160
                        }
                      }
                    }
                  }
                },
                "description": "Plain text only, no URLs or HTML. Leave unknown watch details blank. Do not invent customer data. Photos use multipart/form-data only; no remote image URLs."
              }
            },
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "request_key",
                  "customer_authorized",
                  "privacy",
                  "language",
                  "source_site",
                  "agent_name",
                  "first_name",
                  "last_name",
                  "email",
                  "phone",
                  "address",
                  "postal_code",
                  "city",
                  "country",
                  "form_token"
                ],
                "properties": {
                  "first_name": {
                    "type": "string",
                    "maxLength": 60
                  },
                  "last_name": {
                    "type": "string",
                    "maxLength": 80
                  },
                  "company": {
                    "type": "string",
                    "maxLength": 35
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "maxLength": 50
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 30
                  },
                  "address": {
                    "type": "string",
                    "maxLength": 35
                  },
                  "postal_code": {
                    "type": "string",
                    "maxLength": 9
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 30
                  },
                  "notes": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "agent_name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "form_token": {
                    "type": "string",
                    "maxLength": 4096
                  },
                  "request_key": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Stable UUID for retries of the same inquiry. A changed payload with the same UUID returns 409."
                  },
                  "language": {
                    "type": "string",
                    "enum": [
                      "de",
                      "en"
                    ],
                    "default": "de"
                  },
                  "source_site": {
                    "type": "string",
                    "enum": [
                      "rio",
                      "speedmaster"
                    ],
                    "default": "rio"
                  },
                  "country": {
                    "type": "string",
                    "enum": [
                      "DE",
                      "AT",
                      "CH",
                      "LU",
                      "NL",
                      "BE",
                      "FR",
                      "IT",
                      "DK",
                      "PL",
                      "CZ"
                    ]
                  },
                  "privacy": {
                    "type": "boolean",
                    "const": true
                  },
                  "customer_authorized": {
                    "type": "boolean",
                    "const": true
                  },
                  "pickup": {
                    "type": "boolean",
                    "default": false
                  },
                  "pickup_day": {
                    "type": "string",
                    "format": "date",
                    "description": "Required when pickup=true. Select from the live bootstrap pickup_days."
                  },
                  "watches": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "type": "object",
                      "properties": {
                        "category": {
                          "type": "string",
                          "enum": [
                            "klein",
                            "gross",
                            "tasche"
                          ]
                        },
                        "type": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "brand": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "model": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "reference_number": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "serial_number": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "caliber": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "case_material": {
                          "type": "string",
                          "maxLength": 160
                        },
                        "band_material": {
                          "type": "string",
                          "maxLength": 160
                        }
                      }
                    }
                  },
                  "photos": {
                    "type": "array",
                    "maxItems": 3,
                    "items": {
                      "type": "string",
                      "format": "binary"
                    },
                    "description": "JPEG, PNG or WebP, up to 12 MiB each."
                  }
                },
                "description": "Plain text only, no URLs or HTML. Leave unknown watch details blank. Do not invent customer data. Photos use multipart/form-data only; no remote image URLs."
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Accepted pending customer email confirmation; receipt and duplicate flag returned. Not a repair order or a booked pickup."
          },
          "409": {
            "description": "Same request_key with different data, or request still in progress. Do not loop."
          },
          "410": {
            "description": "Confirmation expired. Customer may initiate a new inquiry."
          },
          "419": {
            "description": "CSRF/session mismatch. Obtain a new bootstrap in the same cookie session."
          },
          "422": {
            "description": "Validation or form timing error. Correct fields before resubmitting."
          },
          "429": {
            "description": "Rate limit. Honour Retry-After; no polling."
          },
          "503": {
            "description": "Temporarily unavailable. Use the published contact email."
          }
        }
      }
    }
  },
  "x-rio-protocol": "rio-service-inquiry/1",
  "x-customer-email-confirmation-required": true,
  "x-customer-confirmation-must-not-be-automated": true
}
