Cascade provides a REST API. Below is a practical minimum in PHP with the cURL / Laravel Http client.
Set OTP_API_TOKEN and OTP_API_DOMAIN in your backend environment. Set OTP_API_DOMAIN to the domain bound to the key, such as example.kz. Send the 4- or 6-digit code the user entered as a string. The verification examples read it from OTP_CODE.
Useful links: API, send, verify, examples, FAQ, pricing, documentation.
Installation
An official Composer package may not exist. In Laravel use the Http facade; in plain PHP — cURL.
# Laravel already includes an HTTP client
Laravel client (fragment)
$token = getenv('OTP_API_TOKEN');
Http::withToken($token)
->withHeaders(['X-Cascade-Client-Domain' => getenv('OTP_API_DOMAIN')])
->acceptJson()
->post('https://cascade.kz/api/otp/send', [
'phone' => '77001234567',
'purpose' => 'verification',
])->json();
cURL
$ch = curl_init('https://cascade.kz/api/otp/verify');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer '.getenv('OTP_API_TOKEN'),
'X-Cascade-Client-Domain: '.getenv('OTP_API_DOMAIN'),
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'phone' => '77001234567',
'code' => getenv('OTP_CODE'),
'purpose' => 'verification',
]),
CURLOPT_RETURNTRANSFER => true,
]);
$body = json_decode(curl_exec($ch), true);
See documentation, send-otp, FAQ.