tims / zomato-pos-php-sdk
PHP SDK for the Zomato POS Integration APIs (menu, order, and outlet management)
Requires
- php: ^8.1
- ext-json: *
- guzzlehttp/guzzle: ^7.5
Requires (Dev)
- phpunit/phpunit: ^10.0|^11.0
README
PHP SDK for the Zomato POS Integration APIs (menu, order, and outlet management).
For restaurant discovery / search, use the separate package tims/zomato-php-sdk.
Docs: Menu · Order · Outlet · Glossary
Requirements
- PHP 8.1+ (8.1, 8.2, 8.3, and 8.4)
ext-json- Guzzle 7
Installation
composer require tims/zomato-pos-php-sdk
Authentication
Partner onboarding is required (NDA, IP whitelist, credentials from your Zomato POC). Exact request/response schemas are in the partner API reference (login + domain whitelist).
use Tims\ZomatoPos\PosClient; $pos = new PosClient(getenv('ZOMATO_POS_API_KEY'));
| Constructor argument | Default | Purpose |
|---|---|---|
$apiKey |
required | POS API key from Zomato POC |
$httpClient |
new Guzzle client | Inject a custom Guzzle client |
$guzzleOptions |
[] |
Extra Guzzle options |
$baseUrl |
https://api.zomato.com |
Override API host |
$apiKeyHeader |
api-key |
Auth header name (override if your POC uses another) |
Do not commit API keys. Prefer environment variables.
Incoming webhooks (order relay, menu processing, serviceability, etc.) are configured on your side with Zomato — they are not HTTP client methods.
Quick start
use Tims\ZomatoPos\Enums\AutoTurnOnTime; use Tims\ZomatoPos\Enums\RejectionMessageId; use Tims\ZomatoPos\PosClient; $pos = new PosClient(getenv('ZOMATO_POS_API_KEY')); $pos->addMenu([/* full menu snapshot — see partner API reference */]); $pos->getMenu(['restaurant_id' => 123]); $pos->updateItemStock([ 'catalogueVendorEntityIds' => ['sku-1'], 'inStock' => false, 'autoTurnOnTime' => AutoTurnOnTime::TwoHours, ]); $pos->confirmOrder(['order_id' => 99, 'restaurant_id' => 123]); $pos->rejectOrder([ 'order_id' => 99, 'restaurant_id' => 123, 'rejection_message_id' => RejectionMessageId::ItemsOutOfStock, ]); $pos->updateDeliveryStatus(['restaurant_id' => 123, 'delivery_status' => true]);
Successful responses are decoded JSON arrays. Failed HTTP responses throw Tims\ZomatoPos\ApiException.
Menu management
| Method | Path |
|---|---|
addMenu(array $payload) |
POST /online-ordering/v3/menu/add |
getMenu(array $payload) |
POST /online-ordering/v3/menu/get |
updateItemStock(array $payload) |
POST /online-ordering/v3/menu/item/stock |
Order management
| Method | Path |
|---|---|
confirmOrder(array $payload) |
POST /online-ordering/v1/order/confirm |
rejectOrder(array $payload) |
POST /online-ordering/v1/order/reject |
markOrderReady(array $payload) |
POST /online-ordering/v1/order/ready |
markOrderPickedUp(array $payload) |
POST /online-ordering/v1/order/pickedup |
markOrderAssigned(array $payload) |
POST /online-ordering/v1/order/assigned |
markOrderDelivered(array $payload) |
POST /online-ordering/v1/order/delivered |
getOrdersRating(array $payload) |
POST /online-ordering/v1/order-analytics/get_orders_rating |
updateComplaint(array $payload) |
POST /online-ordering/v1/complaints/update |
updateMerchantAgreedCancellation(array $payload) |
POST /online-ordering/v1/mac/update |
getOrderContactDetails(array $payload) |
POST /online-ordering/v1/order/get-contact-details |
Outlet management
| Method | Path |
|---|---|
updateDeliveryCharge(array $payload) |
POST /online-ordering/v3/restaurant/delivery-charge/update |
getDeliveryStatus(array $payload) |
POST /online-ordering/v1/restaurant_delivery_status/get |
updateDeliveryStatus(array $payload) |
POST /online-ordering/v1/restaurant_delivery_status/update |
getDeliveryTime(array $payload) |
POST /online-ordering/v1/restaurant/delivery-time/get |
addSurgeDeliveryTime(array $payload) |
POST /online-ordering/v1/restaurant/delivery-time/add_surge |
getZomatoDeliveryTimings(array $payload) |
POST /online-ordering/v1/restaurant/zomato-delivery-timings/get |
updateZomatoDeliveryTimings(array $payload) |
POST /online-ordering/v1/restaurant/zomato-delivery-timings/update |
getSelfDeliveryTimings(array $payload) |
POST /online-ordering/v1/restaurant/self-delivery-timings/get |
updateSelfDeliveryTimings(array $payload) |
POST /online-ordering/v1/restaurant/self-delivery-timings/update |
getLogisticsStatus(array $payload) |
POST /online-ordering/v1/restaurant/logistics-status/get |
updateSelfDeliveryServiceability(array $payload) |
POST /online-ordering/v1/restaurant/logistics-status/update_self_delivery_serviceability |
Glossary enums
use Tims\ZomatoPos\Enums\AutoTurnOnTime; use Tims\ZomatoPos\Enums\Charge; use Tims\ZomatoPos\Enums\OrderDiscountCategory; use Tims\ZomatoPos\Enums\RejectionMessageId; use Tims\ZomatoPos\Enums\ServingInfo; use Tims\ZomatoPos\Enums\Tax; use Tims\ZomatoPos\Enums\Unit;
Confirm rejection message IDs against the official glossary for your integration.
Error handling
use Tims\ZomatoPos\ApiException; use Tims\ZomatoPos\PosClient; try { $data = (new PosClient($apiKey))->getDeliveryStatus(['restaurant_id' => 123]); } catch (ApiException $e) { $e->getStatusCode(); $e->getResponseBody(); $e->getResponseHeaders(); $e->getMessage(); }
Examples
export ZOMATO_POS_API_KEY=your_key export ZOMATO_RESTAURANT_ID=123 php examples/get-delivery-status.php
Testing
composer install
composer test
Tests use Guzzle mock handlers; no live API key is required.
Related
- Restaurant discovery SDK:
tims/zomato-php-sdk
License
This package is open-sourced software licensed under the MIT license.
Copyright (c) 2026 TIMS.