> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypersender.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Request OTP Code (Laravel SDK)

> Generate and send an OTP code from Laravel using Hypersender.

Generate a one-time password and deliver it to a WhatsApp user using the Laravel SDK. The response includes the OTP `uuid`, generated `code`, status, and expiry time so you can track validation.

## Parameters

| Field | Type | Required | Description |
| - | - | - | - |
| chatId | string | yes | WhatsApp chat ID of the recipient (e.g., `20123456789@c.us`). |
| length | int | no | Code length (default `6`). |
| useLetter | bool | no | Include letters (default `false`). |
| useNumber | bool | no | Include numbers (default `true`). |
| allCapital | bool | no | Uppercase letters when `useLetter` is true (default `false`). |
| name | string | no | Display name inside the message (e.g., your app name). |
| expires | int | no | TTL in seconds (default `1800`). |

## Send the request

```php theme={null}
use Hypersender\Hypersender;

$otp = Hypersender::otp()->requestCode([
  'chatId' => '20123456789@c.us',
  'length' => 6,
  'useLetter' => false,
  'useNumber' => true,
  'allCapital' => false,
  'name' => 'YourApp',
  'expires' => 900,
]);
```

* Store `uuid` if you plan to track or audit the request.
* Use `status` to monitor the send/validation lifecycle (`pending`, `sent`, `validated`, `expired`).

![Request OTP Code](https://mintcdn.com/hypersender/heaRhbtv5g__uNmh/images/docs/whatsapp/img/otp-code.png?fit=max\&auto=format\&n=heaRhbtv5g__uNmh\&q=85\&s=866ee46af326e16a3f01a5d9e3c4d572)

## Next

Validate the code the user enters with [Validate OTP Code](https://docs.hypersender.com/v2/packages-and-sdks/laravel/otp/validate-otp-code-laravel-sdk.md).

> [!WARNING]
>
> OTP codes are short-lived and single-use. Prompt users to request a new code after expiry or repeated failures.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.