A modern PHP SDK for the UberEats API, supporting PHP 7.4 and above.
- π Modern PHP 7.4+ with strict typing
- π Type-safe request/response objects
- π§ͺ Comprehensive test coverage
- π Detailed documentation
- π Webhook support
- π οΈ PSR-3 logging support
- π― PSR-12 coding standards
- π Static analysis with PHPStan level max
- PHP 7.4 or higher
- Composer
- Guzzle HTTP Client
- PSR-3 Logger (optional)
- Getting Started
- Working with Orders
- Working with Stores
- Working with Deliveries
- Integration Features
composer require ubereats/php-sdk
use UberEats\Client\UberEatsClient;
// Create client instance
$client = new UberEatsClient();
// Authenticate
$token = $client->authenticate(
clientId: 'your-client-id',
clientSecret: 'your-client-secret'
);
// Get order details
$order = $client->getOrder('order-id');
// Get store details
$store = $client->getStore('store-id');
authenticate(string $clientId, string $clientSecret): AccessToken
getOrder(string $orderId): Order
acceptOrder(string $orderId, AcceptOrderRequest $request): Order
denyOrder(string $orderId, DenyOrderRequest $request): Order
cancelOrder(string $orderId, CancelOrderRequest $request): Order
getStore(string $storeId): Store
getStores(): StoreCollection
use UberEats\Webhook\WebhookHandler;
$handler = new WebhookHandler();
$event = $handler->handle($payload);
switch ($event->type) {
case 'orders.notification':
handleOrderNotification($event);
break;
case 'orders.scheduled.notification':
handleScheduledOrder($event);
break;
case 'delivery.state_changed':
handleDeliveryStateChange($event);
break;
default:
throw new \InvalidArgumentException('Unknown event type');
}
The SDK throws UberEatsException
for any API errors. Each exception includes:
- HTTP status code
- Error message
- Original response data
try {
$order = $client->getOrder('invalid-id');
} catch (UberEatsException $e) {
echo $e->getMessage();
echo $e->getCode();
}
composer test
composer phpstan
composer cs-fix
composer test-coverage
If you discover any security related issues, please email contact@benmacha.tn instead of using the issue tracker.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
Please see CHANGELOG.md for more information on what has changed recently.
This package is licensed under the MIT License. See the LICENSE file for details.