Вебхуки

Payload

Что именно BookNow отправляет в вебхуке: полный пример тела запроса для событий о записи и для продажи товаров, поля, параметры и заголовки.

Тело вебхука — это набор плейсхолдеров записи, тот же, что используется в шаблонах сообщений. Отправляется методом из настроек вебхука (POST или GET) с User-Agent: GuzzleHttp/7.

Формат по умолчанию

POST без пользовательских параметров: JSON-объект со всеми плейсхолдерами (Content-Type: application/json). Пример реальной доставки booking-created с тестового аккаунта (контакты сотрудника заменены):

{
  "id": 40555322,
  "uid": "d2da935b-73ab-40fe-8172-226bb0d74740",
  "booking_hash_id": "093121599",
  "booking_page": "https://bknw.ru/r/093121599",
  "my_url": "https://my.booknow.ru/bookings/40555322",
  "date": "29 сентября 2026 г.",
  "day": "29",
  "month_number": "09",
  "time": "09:00",
  "timezone": "Europe/Moscow",
  "booking_created_at": "2026-09-26T12:19:30+0000",
  "booking_created_at_formatted": "суббота, 26 сентября 2026 г., 15:19",
  "booking_date_start": "2026-09-29T06:00:00+0000",
  "booking_date_start_tz": "2026-09-29T09:00:00+0300",
  "booking_date_start_formatted": "вторник, 29 сентября 2026 г., 9:00",
  "booking_date_end": "2026-09-29T09:30:00+0000",
  "booking_date_end_formatted": "вторник, 29 сентября 2026 г., 12:30",
  "booking_duration": 210,
  "booking_duration_formatted": "3 часа 30 минут",
  "booking_status": "Новая запись",
  "booking_source": "unknown",
  "ref_title": "Unknown",
  "booking_price": "0",
  "booking_price_float": "0.00",
  "booking_price_int": 0,
  "booking_price_formatted": "RUB 0.00",
  "booking_price_currency": "RUB",
  "booking_paid_amount": "0",
  "booking_paid_amount_float": "0.00",
  "booking_paid_amount_formatted": "RUB 0.00",
  "customer_paid_amount": "0",
  "customer_paid_amount_float": "0.00",
  "customer_paid_amount_formatted": "RUB 0.00",
  "booking_description": "Тестовая бронь для документации API",
  "company_name": "Тест компани",
  "company_logo": "",
  "company_page": "https://bknw.ru/test-kompani",
  "location_name": "Тест компани",
  "location_id": 1092,
  "location_uuid": "28929ff4-7d82-417d-b8e6-c83142a57437",
  "location_street": "Ленина улица 20",
  "location_apt": "",
  "location_zip": "610004",
  "location_city": "Киров",
  "location_address_formatted": "Ленина улица 20 , 610004 Киров",
  "location_lat": 58.611683,
  "location_lng": 49.680664,
  "address": "Киров, Ленина улица 20",
  "location_description": null,
  "customer_id": 10168521,
  "customer_name": "Тест",
  "customer_first_name": "Тест",
  "customer_last_name": "Документация",
  "customer_middle_name": "",
  "customer_full_name": "Тест Документация",
  "customer_email": "docs-test@example.com",
  "customer_phone": "+79990000001",
  "customer_birthday": "",
  "customer_comment": "",
  "visits_total": 0,
  "booked_sum_amount": 0,
  "paid_sum_amount": 0,
  "service_id": 73429,
  "service_name": "Бритье1",
  "service_category": "Новая",
  "service_related": "",
  "services_description": "Бритье1",
  "services_count": 1,
  "user_name": "Alexander1 YYY",
  "user_email": "master@example.com",
  "user_phone": "+79990000002",
  "users_description": "Alexander1 YYY",
  "booking_attributes.booking_callback": "",
  "booking_attributes.booking_comment": "",
  "booking_attributes.booking_google_meet": "",
  "booking_attributes.booking_test": "",
  "booking_attributes.booking_google_meet_guest_emails": "",
  "booking_attributes.booking_microsoft_teams": "",
  "booking_attributes.booking_pravila": "",
  "booking_attributes.booking_pravila_i_usloviia": "",
  "booking_attributes.booking_internal_note": "",
  "customer_attributes.customer_phone": "+79990000001",
  "customer_attributes.customer_first_name": "Тест",
  "customer_attributes.customer_last_name": "Документация",
  "customer_attributes.customer_middle_name": null,
  "customer_attributes.customer_birthday": null,
  "customer_attributes.customer_comment": null,
  "customer_attributes.customer_email": "docs-test@example.com",
  "customer_attributes.customer_test_atribut": "",
  "customer_attributes.customer_novyi_atribut": "",
  "customer_attributes.customer_test_attr": "",
  "customer_attributes.customer_test_bool": "",
  "customer_attributes.customer_novyi_atribut_007": "",
  "utm_source": "",
  "utm_medium": "",
  "utm_campaign": "",
  "utm_term": "",
  "utm_content": "",
  "quantity": 1,
  "slots_count": 1
}

События booking-updated, booking-rescheduled, booking-canceled и booking-succeeded содержат тот же набор полей с актуальными значениями: после переноса меняются booking_date_start и booking_date_end, после отмены и завершения — booking_status. Поля события в теле нет, см. обзор.

Группы полей

ГруппаПоляПримечание
Идентификаторыid, uid, booking_hash_id, booking_page, my_urluid совпадает с uuid записи в API; booking_page — страница записи для клиента; my_url — карточка в панели
Времяbooking_date_start, booking_date_end (UTC), booking_date_start_tz (в поясе локации), *_formatted (текст на языке аккаунта), date, day, month_number, time, timezone, booking_duration (минуты)
Статус и деньгиbooking_status (название статуса на языке аккаунта), booking_price*, booking_paid_amount*, customer_paid_amount*, booking_price_currencyсуммы в основных единицах валюты строкой ("0", "1500.00"), *_int — целое число
Компания и локацияcompany_*, location_*, address
Клиентcustomer_*, visits_total, booked_sum_amount, paid_sum_amount
Услуга и сотрудникservice_*, services_description, services_count, user_* (сотрудник), users_descriptionу мультиуслуги перечисления через запятую
Атрибутыbooking_attributes.<slug>, customer_attributes.<slug>набор зависит от пользовательских атрибутов аккаунта (панель → Настройки → Данные)
Источникbooking_source, ref_title, utm_*
Количествоquantity (мест), slots_count (слотов подряд)

Продажа товаров (goods-sold)

Другой набор полей: сводка по продаже и список товаров с индексами goods.N.*:

{
  "goods_name": "товар для теста",
  "goods_quantity": 1,
  "amount": 40000,
  "user_name": null,
  "goods.0.name": "товар для теста",
  "goods.0.article": "ТОВ-91893210",
  "goods.0.brand": null,
  "goods.0.description": null,
  "goods.0.is_payable": true,
  "goods.0.price": 40000,
  "goods.0.unit": "pcs",
  "goods.0.is_consumable": true,
  "goods.0.consumable_price": 12000,
  "goods.0.consumable_unit": "ml",
  "goods.0.quantity_in_unit": 10,
  "goods.0.quantity": 1,
  "goods.0.amount": 40000,
  "goods.0.user_name": null
}
При завершении записи без товаров goods-sold тоже отправляется, с пустым телом []. Проверяйте, что тело — непустой объект, прежде чем обрабатывать.

Свои параметры вместо тела

Если в настройках вебхука заданы параметры (parameters, пары ключ → значение), BookNow отправляет только их, а не полный JSON:

  • POST — как форму application/x-www-form-urlencoded;
  • GET — как query-string.

В значениях параметров, заголовков и адреса поддерживаются плейсхолдеры с двоеточием, как в шаблонах сообщений: :customer_phone, :booking_date_start, :uid. Так можно привести запрос к формату стороннего API без промежуточного сервиса:

{
  "url": "https://crm.example.ru/api/leads?source=booknow",
  "method": "post",
  "parameters": { "phone": ":customer_phone", "name": ":customer_full_name", "start": ":booking_date_start", "booknow_uid": ":uid" },
  "headers": { "X-Api-Key": "ваш ключ" },
  "success_statuses": "200, 201",
  "events": ["booking-created"]
}

Опция «числовые значения» в настройках вебхука в панели приводит числовые строки ("0", "1500.00") к числам.

Copyright © 2026