cURL Запрос:

curl --location 'https://pms.frontdesk24.ru/api/online/putOrder' \
--data-raw '{
    "data": {
        "token": "EE9217BE-2D5C-47AF-93D2-31B9EEFD3317", /*Токен*/
        "source": "pms.frontdesk24.ru", /*Сайт с которого бронирование*/
        "paymentMethodID": 2, /*Способ оплаты*/
        "comment": "Прокомментировал",
        "customer": {
            "email": "test@frontdesk24.ru",
            "phone": "+79161234567",
            "surname": "Тестовый",
            "name": "Тест",
            "secondName": "Тестович"
        },
        "reservations": [
            {
                "dateFrom": "2024-09-18",
                "dateTo": "2024-09-19",
                "roomCategoryID": 6930,
                "tariffID": 23974,
                "isPromotion": 0,
                "promocode": null,
                "guestsCount": 2,
                "bedPlace": 0,
                "currency": "",
                "price": 5000,
                "totalDiscountPercent": 0,
                "promocodeDiscountPercent": 0,
                "promotionDiscountPercent": 0,
                "priceWithoutDiscount": 5000,
                "priceRub": 5000,
                "prepaymentRub": 0,
                "prepaymentCurrency": 0,
                "guests": [
                    {
                        "surname": "Тестовый",
                        "name": "Тест",
                        "secondName": "Тестович",
                        "email": "test@frontdesk24.ru",
                        "phone": "+79161234567",
                        "withoutBed": false
                    },
                    {
                        "surname": "Тестовая",
                        "name": "Теста",
                        "secondName": "Тестовна",
                        "age": 7,
                        "withoutBed": false
                    }
                ]
            }
        ],
        "extraServices": []
    }
}'


PHP Запрос:

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://pms.frontdesk24.ru/api/online/putOrder',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "data": {
        "token": "EE9217BE-2D5C-47AF-93D2-31B9EEFD3317", /*Токен*/
        "source": "pms.frontdesk24.ru", /*Сайт с которого бронирование*/
        "paymentMethodID": 2, /*Способ оплаты*/
        "comment": "Прокомментировал",
        "customer": {
            "email": "test@frontdesk24.ru",
            "phone": "+79161234567",
            "surname": "Тестовый",
            "name": "Тест",
            "secondName": "Тестович"
        },
        "reservations": [
            {
                "dateFrom": "2024-09-18",
                "dateTo": "2024-09-19",
                "roomCategoryID": 6930,
                "tariffID": 23974,
                "isPromotion": 0,
                "promocode": null,
                "guestsCount": 2,
                "bedPlace": 0,
                "currency": "",
                "price": 5000,
                "totalDiscountPercent": 0,
                "promocodeDiscountPercent": 0,
                "promotionDiscountPercent": 0,
                "priceWithoutDiscount": 5000,
                "priceRub": 5000,
                "prepaymentRub": 0,
                "prepaymentCurrency": 0,
                "guests": [
                    {
                        "surname": "Тестовый",
                        "name": "Тест",
                        "secondName": "Тестович",
                        "email": "test@frontdesk24.ru",
                        "phone": "+79161234567",
                        "withoutBed": false
                    },
                    {
                        "surname": "Тестовая",
                        "name": "Теста",
                        "secondName": "Тестовна",
                        "age": 7,
                        "withoutBed": false
                    }
                ]
            }
        ],
        "extraServices": []
    }
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;


Ответ:

{
  "data": [
    [
      {
        "hotelId": 2398,
        "hotelName": "Firefly hotel 2",
        "hotelAddress": "",
        "hotelLocation": null,
        "hotelEmail": "",
        "hotelPhones": "",
        "hotelImage": "Content/Images/2398_Hotels_638539579700390206_x450.jpg",
        "hotelLocation1": null,
        "bookingCode": 117,
        "createDate": "2024-09-18T14:55:49.187",
        "customerName": "Тестовый Тест Тестович",
        "customerPhone": "+79161234567",
        "customerEmail": "test@frontdesk24.ru",
        "comment": "Прокомментировал",
        "paymentMethodName": "Оплата в отеле",
        "accommodationPrice": 5000,
        "toPay": 5000,
        "prepayment": 5000,
        "paid": null,
        "linkToPay": null,
        "payBefore": null,
        "allowBill": 0,
        "orderCanceled": 0,
        "qrCodeLink": "https://pms.frontdesk24.ru/qrcoder/getqrcode.aspx?encode=ST00012|Name=|PersonalAcc=|BankName=|BIC=|CorrespAcc=|Sum=500000|PayeeINN=|PayeeKPP=|lastName=Тестовый|firstName=Тест|middleName=Тестович|Purpose=Услуги отеля по счету №117|payerAddress=|contract=",
        "reservationCurrency": null
      }
    ],
    [
      {
        "id": 10931732,
        "arrivalDateTime": "2024-09-18T14:00:00",
        "departureDateTime": "2024-09-19T12:00:00",
        "roomTypeName": "Стандарт",
        "tariffName": "Базовый",
        "tariffDescription": null,
        "mealsIncluded": 0,
        "mealsType": null,
        "bedPlace": null,
        "numberOfGuests": 2,
        "price": 5000,
        "reservationCurrency": null
      }
    ],
    [
      {
        "id": 13399971,
        "name": "Тестовый Тест Тестович",
        "reservationID": 10931732,
        "age": null,
        "withoutBed": 0
      },
      {
        "id": 13399972,
        "name": "Тестовая Теста Тестовна",
        "reservationID": 10931732,
        "age": null,
        "withoutBed": 0
      }
    ],
    []
  ]
}


