‘eventCode’ => ‘Test’,
‘companyCode’ => ‘Test1’,
‘reservationID’ => ‘963852’,
‘entertainments’ => array(
array(
‘entertainmentCode’ => ‘Test’,
‘dateFrom’ => ‘2023-05-22 14:00’,
‘dateTo’ => ‘2023-05-23 12:00’,
‘auths’ => array(
array(
‘authType’ => 1,
‘authValue’ => ‘12345’
)
)
)
)
);

$options = array(
‘method’ => ‘POST’,
‘headers’ => array(
‘Content-Type’ => ‘application/json’,
),
‘body’ => json_encode($data),
);

$response = wp_remote_request($url, $options);

if (is_wp_error($response)) {
$error_message = $response->get_error_message();
echo „Something went wrong: $error_message”;
} else {
$response_body = wp_remote_retrieve_body($response);
$decoded_response = json_decode($response_body);
// Handle the response as needed
var_dump($decoded_response);
}
?>