# Book Event

Endpoint: POST /activity/{location_id}/{event_id}/book
Version: 1.0.0
Security: BearerPartner

## Security:

  - `BearerPartner` (unknown)
    http bearer Bearer {PartnerToken}

## Path parameters:

  - `location_id` (number, required)
    location ID

  - `event_id` (integer, required)
    Event ID

## Header parameters:

  - `Accept` (string, required)
    e.g. application/vnd.api.v2+json

  - `Content-Type` (string, required)
    application/json

## Request fields (*/*):

  - `fullname` (string, required)
    Client name

  - `phone` (string, required)
    Customer phone (for example +13155550175)

  - `email` (string, required)
    Postal address of the client

  - `national_id` (string)
    Client IIN — 12 digits with a valid check digit. Accepted only for locations in Kazakhstan and ignored for other countries. Optional: when omitted or empty, the IIN already saved for the client is left unchanged.

  - `code` (number)
    SMS confirmation code for verifying the phone number. This field is required if the location has phone_confirmation = true

  - `comment` (string)
    Appointment Comment

  - `notify_by_sms` (integer)
    Specifies how many hours in advance an SMS reminder should be sent before the appointment. Set to 0 to disable SMS reminders.

  - `notify_by_email` (integer)
    Specifies how many hours in advance an email reminder should be sent before the appointment. Set to 0 to disable email reminders

  - `type` (string)
    Appointment source

  - `api_id` (number)
    Appointment ID from external system

  - `clients_count` (number)
    number of seats

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `success` (boolean)
    Execution success status (true)

  - `data` (object)
    Object with data

  - `data.id` (integer)
    Appointment ID

  - `data.hash` (string)
    Appointment ID, for deleting it immediately after creation

  - `meta` (array)
    Metadata (empty array)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Authentication needed.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: Access denied.

## Response 404:

  - `404` (unknown)
    Not Found

## Response 404 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object | array)
    Additional response data (empty object or empty array)
    Example: {}

## Response 422:

  - `422` (unknown)
    Unprocessable Entity

## Response 422 fields (application/json):

  - `success` (boolean)
    Response status.
    Example: false

  - `data` (object | null)
    Response data.
    Example: null

  - `meta` (object)
    Additional response data.

  - `meta.message` (string)
    Error message.
    Example: An error has occurred.

  - `meta.errors` (array)
    Set of a validation error messages.

