Download the PHP package kirimi/kirimi-php without Composer
On this page you can find all versions of the php package kirimi/kirimi-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kirimi/kirimi-php
More information about kirimi/kirimi-php
Files in kirimi/kirimi-php
Package kirimi-php
Short Description Official PHP client library for the Kirimi WhatsApp API. Send messages, handle OTP verification, and manage WhatsApp communication with ease.
License MIT
Homepage https://github.com/kiriminow/kirimi-php
Informations about the package kirimi-php
Kirimi PHP Client
Official PHP client library for the Kirimi WhatsApp API. This library provides a simple and efficient way to send WhatsApp messages, handle OTP generation and validation, and manage WhatsApp communication from your PHP applications.
๐ Features
- โ Send WhatsApp messages (text and media)
- โ Broadcast to up to 1000 recipients
- โ WhatsApp Business API (WABA) templates, replies, conversations and OTP
- โ Generate and validate OTP codes (v1 and v2)
- โ Reverse OTP verification
- โ Devices, contacts, packages and deposits
- โ Support for multiple package types (Free, Lite, Basic, Pro)
- โ PSR-4 autoloading support
- โ Comprehensive error handling with HTTP status codes
- โ Type hints and modern PHP features
- โ Service classes for common use cases
๐ฆ Installation
Install via Composer:
๐ง Requirements
- PHP 8.0 or higher
- Guzzle HTTP client (installed automatically)
- ext-json (usually included in PHP)
๐ง Setup
Get your User Code and Secret Key from the Kirimi Dashboard.
๐ API Reference
Constructor
Parameters:
$userCode(string): Your unique user code from Kirimi Dashboard$secret(string): Your secret key for authentication$endpoint(string): API endpoint URL (optional)
Send Message
Send WhatsApp messages with optional media support. The recipient is passed as $receiver
and sent to the API as receiver (country code, no +).
Parameters:
$deviceId(string): Your device ID$receiver(string): Recipient's phone number (with country code)$message(string): Message content$mediaUrl(string|null): URL of media file to send (optional)$options(array): OptionalfileName,enableTypingEffect,typingSpeedMs,quotedMessageId
Send Message Fast
Send a message without the typing effect simulation.
Send Message File
Send a file/document via multipart upload (max 50MB). The filename is sent both as the
multipart filename and as the fileName field.
Broadcast Message
Send a message to up to 1000 recipients. $numbers is always sent as a JSON array
and $label is required.
WABA โ Send Template Message
Send a Meta-approved template via WhatsApp Business API. WABA endpoints use waba_id,
never device_id.
WABA โ Reply, Conversations & Templates
WABA โ OTP
Devices
User Info
Contacts
Existing numbers are skipped, not overwritten.
Generate OTP
Generate and send OTP via device WhatsApp.
Validate OTP
Send OTP V2
Send an OTP through the Kirimi provider, your own device, or your own WABA.
Verify OTP V2
Reverse OTP
The customer sends a token back to your device, which verifies automatically.
Deposits & Packages
Package Support:
- Free: Text only (with watermark)
- Lite/Basic/Pro: Text + Media support
Health Check
Check the API service status.
๐ฏ Quick Start
Check out the examples/demo.php file for a complete demonstration of all features:
๐ก Usage Examples
Basic WhatsApp Messaging
OTP Verification Flow
Notification Service
Laravel Integration
๐ Package Types & Features
| Package | ID | Features | OTP Support |
|---|---|---|---|
| Free | 1 | Text only (with watermark) | โ |
| Lite | 2, 6, 9 | Text + Media | โ |
| Basic | 3, 7, 10 | Text + Media + OTP | โ |
| Pro | 4, 8, 11 | Text + Media + OTP | โ |
โ ๏ธ Error Handling
The library provides comprehensive error handling using KirimiException. Use
getStatusCode() to distinguish failures; it returns the HTTP status code from the
response (null for network errors).
| Code | Meaning |
|---|---|
400 |
Invalid params |
401 |
Wrong secret |
402 |
Insufficient balance (/v2/otp/send whatsapp) |
403 |
Feature not in package / subscription inactive |
404 |
Not found |
429 |
Rate limited |
500 |
Server error |
502 |
Number undeliverable |
503 |
Provider outage |
๐ Security Notes
- Always keep your secret key secure and never expose it in client-side code
- Use environment variables to store credentials
- Validate phone numbers before sending messages
- Implement rate limiting in your application
๐ฆ Rate Limits & Quotas
- Each message sent reduces your device quota (unless unlimited)
- OTP codes expire after 5 minutes
- Device must be in 'connected' status to send messages
- Check your dashboard for current quota and usage statistics
๐งช Testing
Run the test suite:
Run tests with coverage:
Check code style:
Fix code style:
๐ค Contributing
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch
- Follow PSR-12 coding standards
- Add tests for new features
- Submit a pull request
๐ License
๐จโ๐ป Author
Ari Padrian - [email protected]
๐ Additional Resources
Made with โค๏ธ for the PHP and WhatsApp automation community