Entry Validation
This section describes the endpoints related to validating entry through turnstiles using skipasses in a ski resort system. It includes creating validation records and querying them.
Validate an Entry (SKIDATA Integration)
Request:
POST /api/v1/entry/validation/
This endpoint is used by SKIDATA turnstile system for basic validation.
Example usage: Data structure:
{
"entry_datetime": "2023-11-21T12:34:56",
"mitz_number": "MITZ001",
"skipass_number": "SP9876543210",
"turnstile_number": "T001",
"valid_for_entry_skidata": true
}
Curl:
curl -X POST http://exampledomain.com/api/v1/entry/validation/ \
-H "Content-Type: application/json" \
-d @data.json
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
| entry_datetime | datetime | Yes | The datetime of entry attempt. |
| mitz_number | string | Yes | Unique identifier for the mitz. |
| skipass_number | string | Yes | Unique identifier for the skipass. |
| turnstile_number | string | Yes | The number of the turnstile being accessed. |
| valid_for_entry_skidata | boolean | Yes | Indicates if the skipass is valid for entry according to Skidata system. |
Note:
- Not Authorization Protected - Public endpoint for turnstile integration
- Returns basic validation response in SKIDATA format
Response:
Content-Type application/json
200 OK / 400 Bad Request
{
"status": "valid" / "invalid",
"timestamp": "2023-11-21T12:34:56",
"skipassNumber": "1234567890",
"error": null / "Error details if any"
}
Validate an Entry (Cashier Interface - Extended)
Request:
POST /api/v1/entry/validation/check-detailed/
This endpoint is used by cashier web interface for detailed validation information.
Example usage:
{
"entry_datetime": "2023-11-21T12:34:56",
"mitz_number": "WEB-01",
"skipass_number": "1-1-2-20907",
"turnstile_number": "WEB-CASHIER",
"valid_for_entry_skidata": false
}
Curl:
curl -X POST http://exampledomain.com/api/v1/entry/validation/check-detailed/ \
-H "Content-Type: application/json" \
-H "X-CSRFToken: YOUR_CSRF_TOKEN" \
-d @data.json
Response (Valid Skipass):
{
"status": "success",
"timestamp": "2025-11-04T12:34:56+01:00",
"skipassNumber": "1-1-2-20907",
"validation_status": "valid",
"booking_number": "TEST-BOOKING-001",
"lesson_id": 5,
"validation_reason": "",
"customer": {
"name": "Тест",
"surname": "Клієнт",
"phone_number": "+380501234567",
"email": "test@example.com"
},
"source_system": "Лижна школа",
"valid_from": "2025-11-04T10:00:00+01:00",
"valid_until": "2025-11-04T12:00:00+01:00"
}
Response (Invalid Skipass):
{
"status": "success",
"timestamp": "2025-11-04T12:34:56+01:00",
"skipassNumber": "1-1-2-99999",
"validation_status": "invalid",
"booking_number": "",
"lesson_id": null,
"validation_reason": "Скіпас не знайдено в уроках або бронюваннях готелю",
"customer": {
"name": "Майбутній",
"surname": "Клієнт",
"phone_number": "+380509999999",
"email": null
},
"source_system": "Лижна школа",
"valid_from": "2025-11-05T10:00:00+01:00",
"valid_until": "2025-11-05T12:00:00+01:00"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| status | string | Always "success" for successful API call |
| timestamp | string | ISO 8601 timestamp of validation |
| skipassNumber | string | The skipass number that was checked |
| validation_status | string | "valid" or "invalid" - result of validation |
| booking_number | string | Booking/lesson reference number |
| lesson_id | integer | Lesson ID if from ski school (null for hotel) |
| validation_reason | string | Reason for rejection (empty if valid) |
| customer | object | Customer information (if skipass found in database) |
| source_system | string | "Лижна школа" or "Готель" |
| valid_from | string | ISO 8601 datetime when skipass becomes valid |
| valid_until | string | ISO 8601 datetime when skipass expires |
Customer Object
| Field | Type | Description |
|---|---|---|
| name | string | Customer first name |
| surname | string | Customer last name |
| phone_number | string | Customer phone number |
| string | Customer email (can be null) |
Notes
- SKIDATA Endpoint (
/api/v1/entry/validation/): - Simple response format
- No authentication required
- Used by turnstile hardware
-
Records validation in database
-
Cashier Endpoint (
/api/v1/entry/validation/check-detailed/): - Extended response with customer details
- Shows source system (Ski School/Hotel)
- Includes validity period
- Shows information even for invalid skipasses
-
Requires CSRF token for web interface
-
Both endpoints:
- Save validation record to database
- Check both ski school lessons and hotel bookings
- Support new unified Skipass model structure