{
  "openapi": "3.1.0",
  "info": {
    "title": "SparkInn — publiczne API POS i kiosków",
    "version": "1.0068",
    "description": "Kontrakt wdrożony 2 grudnia 2026. Schematy wejścia pochodzą z API; odpowiedzi zawierają fikcyjne przykłady. Nie jest to sandbox. Administracyjne wydawanie kluczy, kodów kiosku i konfiguracja webhooków wymagają uprawnień w panelu PMS.",
    "contact": {
      "name": "DuoTech Management",
      "email": "biuro@sparkinn.pl"
    }
  },
  "servers": [
    {
      "url": "https://app.sparkinn.pl/api/integrations/v1",
      "description": "Produkcja — operacje zapisują rzeczywiste dane konta"
    }
  ],
  "security": [
    {
      "IntegrationKey": []
    }
  ],
  "paths": {
    "/stays/resolve": {
      "post": {
        "tags": [
          "POS"
        ],
        "summary": "resolveStay",
        "operationId": "resolveStay",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Resolve"
              },
              "example": {
                "property_id": "11111111-1111-4111-8111-111111111111",
                "source_property_id": "22222222-2222-4222-8222-222222222222",
                "outlet_code": "restaurant",
                "sales_profile_code": "dinner",
                "room_number": "101",
                "payer": "RESERVATION"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wynik operacji. W podglądzie kiosku sprawdź status i ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "charge_allowed": true,
                  "charge_target_token": "TOKEN_Z_ODPOWIEDZI_SERWERA",
                  "expires_at": "2026-12-02T17:32:00Z",
                  "property_id": "11111111-1111-4111-8111-111111111111",
                  "source_property_id": "22222222-2222-4222-8222-222222222222",
                  "room_id": "33333333-3333-4333-8333-333333333333",
                  "bed_id": null,
                  "seller_id": "44444444-4444-4444-8444-444444444444",
                  "provider_id": "55555555-5555-4555-8555-555555555555",
                  "sales_model": "OPERATOR",
                  "payer_kind": "RESERVATION",
                  "transaction_limit": "1000.00"
                }
              }
            }
          },
          "401": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "403": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "404": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "409": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "413": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "422": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "429": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "503": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          }
        },
        "x-required-scope": "stays:resolve"
      }
    },
    "/charges": {
      "post": {
        "tags": [
          "POS"
        ],
        "summary": "createCharge",
        "operationId": "createCharge",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Charge"
              },
              "example": {
                "property_id": "11111111-1111-4111-8111-111111111111",
                "charge_target_token": "TOKEN_Z_ODPOWIEDZI_SERWERA",
                "external_reference": "restaurant/2026/104",
                "amount": "100.00",
                "currency": "PLN",
                "occurred_at": "2026-12-02T18:30:00+01:00",
                "description": "Kolacja dla dwóch osób",
                "items": [
                  {
                    "name": "Kolacja",
                    "quantity": "2",
                    "unit_price": "50.00",
                    "tax_rate": "8"
                  }
                ],
                "document_reference": "POS/2026/104",
                "already_paid": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Wynik operacji. W podglądzie kiosku sprawdź status i ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "88888888-8888-4888-8888-888888888888",
                  "property_id": "11111111-1111-4111-8111-111111111111",
                  "source_property_id": "22222222-2222-4222-8222-222222222222",
                  "reservation_id": "66666666-6666-4666-8666-666666666666",
                  "folio_id": "99999999-9999-4999-8999-999999999999",
                  "external_reference": "restaurant/2026/104",
                  "amount": "100.00",
                  "remaining": "100.00",
                  "version": 1,
                  "created_at": "2026-12-02T17:30:01Z"
                }
              }
            }
          },
          "401": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "403": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "404": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "409": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "413": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "422": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "429": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "503": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          }
        },
        "x-required-scope": "charges:create"
      },
      "get": {
        "tags": [
          "POS"
        ],
        "summary": "getOwnCharge",
        "operationId": "getOwnCharge",
        "parameters": [
          {
            "name": "property_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Property Id"
            }
          },
          {
            "name": "external_reference",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "External Reference"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wynik operacji. W podglądzie kiosku sprawdź status i ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "88888888-8888-4888-8888-888888888888",
                  "property_id": "11111111-1111-4111-8111-111111111111",
                  "source_property_id": "22222222-2222-4222-8222-222222222222",
                  "reservation_id": "66666666-6666-4666-8666-666666666666",
                  "folio_id": "99999999-9999-4999-8999-999999999999",
                  "external_reference": "restaurant/2026/104",
                  "amount": "100.00",
                  "remaining": "100.00",
                  "version": 1,
                  "created_at": "2026-12-02T17:30:01Z"
                }
              }
            }
          },
          "401": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "403": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "404": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "409": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "413": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "422": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "429": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "503": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          }
        },
        "x-required-scope": "charges:read:own"
      }
    },
    "/charges/{cid}/reverse": {
      "post": {
        "tags": [
          "POS"
        ],
        "summary": "reverseCharge",
        "operationId": "reverseCharge",
        "parameters": [
          {
            "name": "cid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Cid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Correction"
              },
              "example": {
                "property_id": "11111111-1111-4111-8111-111111111111",
                "expected_version": 1,
                "amount": "25.00",
                "reason": "Rezygnacja z części zamówienia",
                "document_reference": "KOR/POS/2026/104"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wynik operacji. W podglądzie kiosku sprawdź status i ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "88888888-8888-4888-8888-888888888888",
                  "property_id": "11111111-1111-4111-8111-111111111111",
                  "source_property_id": "22222222-2222-4222-8222-222222222222",
                  "reservation_id": "66666666-6666-4666-8666-666666666666",
                  "folio_id": "99999999-9999-4999-8999-999999999999",
                  "external_reference": "restaurant/2026/104",
                  "amount": "100.00",
                  "remaining": "75.00",
                  "version": 2,
                  "created_at": "2026-12-02T17:30:01Z"
                }
              }
            }
          },
          "401": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "403": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "404": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "409": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "413": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "422": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "429": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "503": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          }
        },
        "x-required-scope": "charges:reverse:own"
      }
    },
    "/cards": {
      "post": {
        "tags": [
          "POS"
        ],
        "summary": "registerCard",
        "operationId": "registerCard",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiCard"
              },
              "example": {
                "property_id": "11111111-1111-4111-8111-111111111111",
                "reservation_id": "66666666-6666-4666-8666-666666666666",
                "issuer": "locks-a",
                "code": "TEST-CARD-001",
                "label": "Karta 101-A",
                "person_key": "guest:77777777-7777-4777-8777-777777777777",
                "valid_from": "2026-12-02T14:00:00+01:00",
                "valid_until": "2026-12-05T11:00:00+01:00"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wynik operacji. W podglądzie kiosku sprawdź status i ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "id": "eeeeeeee-eeee-4eee-8eee-eeeeeeeeeeee",
                  "label": "Karta 101-A",
                  "valid_from": "2026-12-02T13:00:00Z",
                  "valid_until": "2026-12-05T10:00:00Z"
                }
              }
            }
          },
          "401": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "403": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "404": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "409": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "413": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "422": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "429": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "503": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          }
        },
        "x-required-scope": "cards:manage"
      }
    },
    "/cards/{cid}/revoke": {
      "post": {
        "tags": [
          "POS"
        ],
        "summary": "revokeCard",
        "operationId": "revokeCard",
        "parameters": [
          {
            "name": "cid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Cid"
            }
          },
          {
            "name": "property_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Property Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wynik operacji. W podglądzie kiosku sprawdź status i ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "revoked": true
                }
              }
            }
          },
          "401": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "403": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "404": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "409": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "413": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "422": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "429": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "503": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          }
        },
        "x-required-scope": "cards:manage"
      }
    },
    "/kiosk/resolve": {
      "post": {
        "tags": [
          "Kiosk"
        ],
        "summary": "previewKiosk",
        "operationId": "previewKiosk",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Lookup"
              },
              "example": {
                "property_id": "11111111-1111-4111-8111-111111111111",
                "access_code": "ski_PRZYKLADOWY_KOD_ZASTAP_KODEM_OD_RECEPCJI_12345678"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wynik operacji. W podglądzie kiosku sprawdź status i ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "examples": {
                  "ready": {
                    "value": {
                      "ready": true,
                      "status": "READY",
                      "reason": null,
                      "operation": "CHECK_IN",
                      "target": "ROOM",
                      "reservation_id": "66666666-6666-4666-8666-666666666666",
                      "expected_version": 4,
                      "preview_hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
                      "check_in": "2026-12-02",
                      "check_out": "2026-12-05",
                      "early_departure": true,
                      "required_confirmations": [
                        "guests_present"
                      ]
                    }
                  },
                  "receptionRequired": {
                    "value": {
                      "ready": false,
                      "status": "RECEPTION_REQUIRED",
                      "reason": "kiosk_payment_required",
                      "operation": "CHECK_OUT",
                      "target": "ROOM",
                      "reservation_id": "66666666-6666-4666-8666-666666666666",
                      "expected_version": 4,
                      "preview_hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
                      "check_in": "2026-12-02",
                      "check_out": "2026-12-05",
                      "early_departure": true,
                      "required_confirmations": [
                        "extras_reviewed",
                        "documents_reviewed",
                        "keys_returned"
                      ]
                    }
                  },
                  "completed": {
                    "value": {
                      "ready": false,
                      "status": "COMPLETED",
                      "result": {
                        "status": "COMPLETED",
                        "operation": "CHECK_IN",
                        "reservation_id": "66666666-6666-4666-8666-666666666666",
                        "version": 5,
                        "access_device_action": "ADAPTER_REQUIRED"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "403": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "404": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "409": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "413": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "422": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "429": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "503": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          }
        },
        "x-required-scope": "kiosk:read"
      }
    },
    "/kiosk/check-in": {
      "post": {
        "tags": [
          "Kiosk"
        ],
        "summary": "checkInKiosk",
        "operationId": "checkInKiosk",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Command"
              },
              "example": {
                "property_id": "11111111-1111-4111-8111-111111111111",
                "access_code": "ski_PRZYKLADOWY_KOD_ZASTAP_KODEM_OD_RECEPCJI_12345678",
                "expected_version": 4,
                "preview_hash": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
                "guests_present": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wynik operacji. W podglądzie kiosku sprawdź status i ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "status": "COMPLETED",
                  "operation": "CHECK_IN",
                  "reservation_id": "66666666-6666-4666-8666-666666666666",
                  "version": 5,
                  "access_device_action": "ADAPTER_REQUIRED"
                }
              }
            }
          },
          "401": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "403": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "404": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "409": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "413": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "422": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "429": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "503": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          }
        },
        "x-required-scope": "kiosk:check-in"
      }
    },
    "/kiosk/check-out": {
      "post": {
        "tags": [
          "Kiosk"
        ],
        "summary": "checkOutKiosk",
        "operationId": "checkOutKiosk",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200,
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Command"
              },
              "example": {
                "property_id": "11111111-1111-4111-8111-111111111111",
                "access_code": "ski_OSOBNY_KOD_WYJAZDU_ZASTAP_KODEM_Z_PMS_1234567890",
                "expected_version": 8,
                "preview_hash": "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789",
                "extras_reviewed": true,
                "documents_reviewed": true,
                "keys_returned": true,
                "early_departure_confirmed": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Wynik operacji. W podglądzie kiosku sprawdź status i ready.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                },
                "example": {
                  "status": "COMPLETED",
                  "operation": "CHECK_OUT",
                  "reservation_id": "66666666-6666-4666-8666-666666666666",
                  "version": 9,
                  "access_device_action": "ADAPTER_REQUIRED"
                }
              }
            }
          },
          "401": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "403": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "404": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "409": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "413": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "422": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "429": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          },
          "503": {
            "description": "Błąd API/bramki; kod określa dalszą obsługę.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationError"
                }
              }
            }
          }
        },
        "x-required-scope": "kiosk:check-out"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "IntegrationKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "spi_…",
        "description": "Odrębne klucze i zakresy dla POS oraz kiosku. Sekret przechowuje backend integratora."
      }
    },
    "schemas": {
      "IntegrationError": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "correlation_id": {
                "type": "string",
                "format": "uuid"
              },
              "fields": {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "Resolve": {
        "properties": {
          "property_id": {
            "type": "string",
            "format": "uuid",
            "title": "Property Id"
          },
          "source_property_id": {
            "type": "string",
            "format": "uuid",
            "title": "Source Property Id"
          },
          "outlet_code": {
            "type": "string",
            "maxLength": 60,
            "minLength": 1,
            "title": "Outlet Code"
          },
          "sales_profile_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ],
            "title": "Sales Profile Code"
          },
          "room_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Room Id"
          },
          "room_number": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ],
            "title": "Room Number"
          },
          "bed_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bed Id"
          },
          "reservation_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reservation Id"
          },
          "person_key": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ],
            "title": "Person Key"
          },
          "card_issuer": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 60
              },
              {
                "type": "null"
              }
            ],
            "title": "Card Issuer"
          },
          "card_code": {
            "anyOf": [
              {
                "type": "string",
                "format": "password",
                "writeOnly": true
              },
              {
                "type": "null"
              }
            ],
            "title": "Card Code"
          },
          "payer": {
            "type": "string",
            "enum": [
              "RESERVATION",
              "PERSON"
            ],
            "title": "Payer",
            "default": "RESERVATION"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "property_id",
          "source_property_id",
          "outlet_code"
        ],
        "title": "Resolve"
      },
      "ApiCard": {
        "properties": {
          "issuer": {
            "type": "string",
            "maxLength": 60,
            "minLength": 1,
            "title": "Issuer"
          },
          "code": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "format": "password",
            "title": "Code",
            "writeOnly": true
          },
          "label": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Label"
          },
          "person_key": {
            "type": "string",
            "maxLength": 100,
            "minLength": 1,
            "title": "Person Key"
          },
          "valid_from": {
            "type": "string",
            "format": "date-time",
            "title": "Valid From"
          },
          "valid_until": {
            "type": "string",
            "format": "date-time",
            "title": "Valid Until"
          },
          "property_id": {
            "type": "string",
            "format": "uuid",
            "title": "Property Id"
          },
          "reservation_id": {
            "type": "string",
            "format": "uuid",
            "title": "Reservation Id"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "issuer",
          "code",
          "label",
          "person_key",
          "valid_from",
          "valid_until",
          "property_id",
          "reservation_id"
        ],
        "title": "ApiCard"
      },
      "Correction": {
        "properties": {
          "property_id": {
            "type": "string",
            "format": "uuid",
            "title": "Property Id"
          },
          "expected_version": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Expected Version"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "string"
              }
            ],
            "title": "Amount"
          },
          "reason": {
            "type": "string",
            "maxLength": 500,
            "minLength": 3,
            "title": "Reason"
          },
          "document_reference": {
            "type": "string",
            "maxLength": 150,
            "title": "Document Reference",
            "default": ""
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "property_id",
          "expected_version",
          "amount",
          "reason"
        ],
        "title": "Correction"
      },
      "Command": {
        "properties": {
          "property_id": {
            "type": "string",
            "format": "uuid",
            "title": "Property Id"
          },
          "access_code": {
            "type": "string",
            "maxLength": 100,
            "minLength": 40,
            "format": "password",
            "title": "Access Code",
            "writeOnly": true
          },
          "expected_version": {
            "type": "integer",
            "minimum": 1.0,
            "title": "Expected Version"
          },
          "preview_hash": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$",
            "title": "Preview Hash"
          },
          "guests_present": {
            "type": "boolean",
            "title": "Guests Present",
            "default": false
          },
          "extras_reviewed": {
            "type": "boolean",
            "title": "Extras Reviewed",
            "default": false
          },
          "documents_reviewed": {
            "type": "boolean",
            "title": "Documents Reviewed",
            "default": false
          },
          "keys_returned": {
            "type": "boolean",
            "title": "Keys Returned",
            "default": false
          },
          "early_departure_confirmed": {
            "type": "boolean",
            "title": "Early Departure Confirmed",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "property_id",
          "access_code",
          "expected_version",
          "preview_hash"
        ],
        "title": "Command"
      },
      "Lookup": {
        "properties": {
          "property_id": {
            "type": "string",
            "format": "uuid",
            "title": "Property Id"
          },
          "access_code": {
            "type": "string",
            "maxLength": 100,
            "minLength": 40,
            "format": "password",
            "title": "Access Code",
            "writeOnly": true
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "property_id",
          "access_code"
        ],
        "title": "Lookup"
      },
      "Charge": {
        "properties": {
          "property_id": {
            "type": "string",
            "format": "uuid",
            "title": "Property Id"
          },
          "charge_target_token": {
            "type": "string",
            "format": "password",
            "title": "Charge Target Token",
            "writeOnly": true
          },
          "external_reference": {
            "type": "string",
            "maxLength": 150,
            "minLength": 1,
            "title": "External Reference"
          },
          "amount": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "string"
              }
            ],
            "title": "Amount"
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "title": "Currency"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "title": "Occurred At"
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "minLength": 1,
            "title": "Description"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/Item"
            },
            "type": "array",
            "maxItems": 100,
            "minItems": 1,
            "title": "Items"
          },
          "document_reference": {
            "type": "string",
            "maxLength": 150,
            "title": "Document Reference",
            "default": ""
          },
          "already_paid": {
            "type": "boolean",
            "const": false,
            "title": "Already Paid",
            "default": false
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "property_id",
          "charge_target_token",
          "external_reference",
          "amount",
          "currency",
          "occurred_at",
          "description",
          "items"
        ],
        "title": "Charge"
      },
      "Item": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 200,
            "minLength": 1,
            "title": "Name"
          },
          "quantity": {
            "anyOf": [
              {
                "type": "number",
                "exclusiveMinimum": 0.0
              },
              {
                "type": "string"
              }
            ],
            "title": "Quantity"
          },
          "unit_price": {
            "anyOf": [
              {
                "type": "number",
                "minimum": 0.0
              },
              {
                "type": "string"
              }
            ],
            "title": "Unit Price"
          },
          "tax_rate": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "23",
                  "8",
                  "5",
                  "0",
                  "ZW"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Tax Rate"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "name",
          "quantity",
          "unit_price"
        ],
        "title": "Item"
      }
    }
  },
  "webhooks": {
    "sparkinnEvent": {
      "post": {
        "summary": "Zdarzenie wysyłane do odbiorcy integratora",
        "security": [],
        "description": "Publiczny HTTPS:443, HMAC-SHA256 na surowym body, trwała deduplikacja event_id. Schemat i podpis opisano w przewodniku; to nie jest endpoint serwera SparkInn.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "charge.posted.v1",
                      "charge.reversed.v1",
                      "local_fee.assessed.v1",
                      "local_fee.corrected.v1",
                      "payment.recorded.v1",
                      "pos.charge_corrected.v1",
                      "pos.charge_created.v1",
                      "reservation.cancelled.v1",
                      "reservation.changed.v1",
                      "reservation.created.v1",
                      "stay.assignment_changed.v1",
                      "stay.checked_in.v1",
                      "stay.checked_out.v1",
                      "webhook.test.v1"
                    ]
                  }
                }
              },
              "example": {
                "event_id": "c0000000-0000-4000-8000-000000000001",
                "schema_version": 1,
                "correlation_id": "90000000-0000-4000-8000-000000000001",
                "type": "pos.charge_created.v1",
                "occurred_at": "2026-12-02T17:30:01Z",
                "tenant_id": "d0000000-0000-4000-8000-000000000001",
                "property_id": "11111111-1111-4111-8111-111111111111",
                "resource_id": "88888888-8888-4888-8888-888888888888",
                "resource_version": 1,
                "data": {
                  "reservation_id": "66666666-6666-4666-8666-666666666666",
                  "source_property_id": "22222222-2222-4222-8222-222222222222",
                  "folio_id": "99999999-9999-4999-8999-999999999999",
                  "external_reference": "restaurant/2026/104",
                  "amount": "100.00",
                  "remaining": "100.00",
                  "seller_id": "44444444-4444-4444-8444-444444444444"
                }
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Zdarzenie trwale zapisane albo znany duplikat"
          },
          "503": {
            "description": "Przejściowa niedostępność, ponów dostarczenie"
          }
        }
      }
    }
  }
}
