PHPackages                             foodticket/takeaway-pos-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. foodticket/takeaway-pos-client

ActiveLibrary[API Development](/categories/api)

foodticket/takeaway-pos-client
==============================

A PHP client to integrate with the Takeaway POS API

1.0.8(2w ago)110.9k↑22.2%1MITPHPPHP ^8.3

Since Mar 18Pushed 2w ago1 watchersCompare

[ Source](https://github.com/food-ticket/takeaway-pos-api-client)[ Packagist](https://packagist.org/packages/foodticket/takeaway-pos-client)[ RSS](/packages/foodticket-takeaway-pos-client/feed)WikiDiscussions main Synced yesterday

READMEChangelog (8)Dependencies (6)Versions (12)Used By (0)

Takeaway POS API implementation for Laravel
===========================================

[](#takeaway-pos-api-implementation-for-laravel)

[![GitHub license](https://camo.githubusercontent.com/dcfd4525b3e95551691fd645e2123a32a45c957703d551bb36ed0aa0f2a116ed/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4e61657265656e2f5374726170446f776e2e6a732e737667)](https://github.com/Naereen/StrapDown.js/blob/master/LICENSE)

This package allows you to easily make requests to the Takeaway POS API and handle incoming webhooks.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Laravel &gt;= 12.0

Installation
------------

[](#installation)

```
composer require foodticket/takeaway-pos-api-client
```

The package will automatically register itself via Laravel's package discovery.

Publish the config file:

```
php artisan vendor:publish --tag=config
```

Configuration
-------------

[](#configuration)

Add the following variables to your `.env` file:

VariableDefaultDescription`TAKEAWAY_POS_API_URL``https://posapi.takeaway.com/`Base URL for the POS API`TAKEAWAY_POS_API_KEY`—Your POS API key`TAKEAWAY_POS_API_SECRET`—Your POS API secret`TAKEAWAY_POS_API_VERSION``1.3`API version sent on loginThe published `config/takeaway.php` also exposes two routing options:

```
'routes_prefix'     => '/takeaway-pos/webhooks',
'routes_middleware' => ['webhooks'],
```

Change these to control where incoming webhook routes are mounted and which middleware they run under.

Usage
-----

[](#usage)

Instantiate `TakeawayApi` directly or resolve it from the container:

```
use Foodticket\Takeaway\Endpoints\TakeawayApi;

$api = new TakeawayApi();
```

---

Outgoing API endpoints
----------------------

[](#outgoing-api-endpoints)

### Login — `logInClient()`

[](#login--loginclient)

Register a POS client with its connected restaurant at the Takeaway POS API. Must be called before the restaurant can receive orders.

```
$api->logInClient(
    restaurantId: 'restaurant-uuid',
    orderUrl: 'https://your-app.example/takeaway-pos/webhooks/order',
    aliveUrl: 'https://your-app.example/takeaway-pos/webhooks/keep-alive/restaurant-uuid',
    clientKey: 'your-client-key',
    driverUpdateUrl: null,       // optional — defaults to 'https://nodriverupdates' if omitted
    orderCancelledUrl: null,     // optional — subscribes to orderCancelled events
);
```

**HTTP request:** `POST /login`

FieldRequiredDescription`apiKey`yesPulled from `takeaway.api_key` config`restaurant`yesThe restaurant identifier`orderUrl`yesURL called by Takeaway when a new order arrives`aliveUrl`yesURL polled by Takeaway to check POS availability`clientKey`yesUnique key identifying this POS client`version`yesPulled from `takeaway.api_version` config`driverUpdateUrl`noURL for driver status updates`subscribe.orderCancelled`noURL called when an order is cancelled---

### Logout — `logOutClient()`

[](#logout--logoutclient)

Deregister a restaurant from the POS API. Logged-out restaurants no longer receive orders. If multiple restaurants share the same `aliveUrl`, the health-check ping continues until all of them are logged out.

```
$api->logOutClient(
    restaurantId: 'restaurant-uuid',
);
```

**HTTP request:** `POST /logout`

FieldRequiredDescription`apiKey`yesPulled from `takeaway.api_key` config`restaurant`yesThe restaurant identifier---

### Set order status — `setOrderStatus()`

[](#set-order-status--setorderstatus)

Update the status of an order. A `confirmed` status **must** be sent for every order, and it **must** include `changedDeliveryTime`.

```
use Foodticket\Takeaway\Enums\OrderStatus;
use Carbon\Carbon;

$api->setOrderStatus(
    statusUrl: $statusUrl,           // URL provided in the incoming order payload
    id: $orderId,
    status: OrderStatus::CONFIRMED,
    key: $orderKey,
    changedDeliveryTime: Carbon::now()->addMinutes(30), // required when status is CONFIRMED
    message: null,                   // optional — free-text note
);
```

**HTTP request:** `POST {statusUrl}`

FieldRequiredDescription`id`yesOrder identifier`status`yesOne of the `OrderStatus` enum values (see below)`key`yesOrder key provided in the incoming order payload`changedDeliveryTime`conditionalISO 8601 timestamp — **required** when status is `confirmed``text`noOptional message/note#### `OrderStatus` enum values

[](#orderstatus-enum-values)

CaseValueDescription`OrderStatus::RECEIVED``received`Set by Takeaway — do not send this yourself`OrderStatus::PRINTED``printed`Order was printed by the restaurant`OrderStatus::CONFIRMED``confirmed`Order confirmed with estimated delivery time`OrderStatus::ERROR``error`General error — triggers a call-centre callback; does not delete the order`OrderStatus::KITCHEN``kitchen`Restaurant started preparing the order`OrderStatus::IN_DELIVERY``in_delivery`Order picked up by a courier`OrderStatus::DELIVERED``delivered`Order delivered to the customer---

Incoming webhooks
-----------------

[](#incoming-webhooks)

The package automatically registers two routes under the configured prefix (default `/takeaway-pos/webhooks`):

MethodPathDescription`GET``/takeaway-pos/webhooks/keep-alive/{restaurantId}`Health-check endpoint polled by Takeaway`ANY``/takeaway-pos/webhooks/{event}`Generic handler for all other webhook events### Keep-alive

[](#keep-alive)

Takeaway polls the `aliveUrl` you registered on login to verify the POS is online. The route fires a Laravel event and returns HTTP 200:

```
Event::dispatch('takeaway-pos.keep-alive', $restaurantId);

```

Listen for it in your application:

```
Event::listen('takeaway-pos.keep-alive', function (string $restaurantId) {
    // mark restaurant as online, etc.
});
```

### Event webhooks

[](#event-webhooks)

All other incoming notifications (orders, cancellations, driver updates, etc.) are routed through the `/{event}` handler. The payload must include an `event` field; the controller fires a Laravel event named:

```
takeaway-pos.{kebab-slug-of-event-name}

```

For example, an `orderCreated` notification fires `takeaway-pos.order-created`.

The event payload is a `TakeawayWebhook` object:

```
Event::listen('takeaway-pos.order-created', function (TakeawayWebhook $webhook) {
    $webhook->eventName();    // 'takeaway-pos.order-created'
    $webhook->restaurantId(); // restaurant identifier from the payload
    $webhook->resourceId();   // order id from the payload
    $webhook->payload();      // full raw payload array
});
```

---

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within this project, please report it by email to .

###  Health Score

53

—

FairBetter than 96% of packages

Maintenance96

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~102 days

Recently: every ~187 days

Total

9

Last Release

18d ago

PHP version history (5 changes)1.0.0PHP ^8.1

1.0.5PHP ^8.1|^8.2

1.0.6PHP ^8.1|^8.2|^8.3

1.0.7PHP ^8.2

1.0.8PHP ^8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a331f154c735cc3b44cc802b7b183a58e503dfcf5dc3add0dea69eae3bc61ff?d=identicon)[foodticket](/maintainers/foodticket)

---

Top Contributors

[![rikmorskate](https://avatars.githubusercontent.com/u/3383883?v=4)](https://github.com/rikmorskate "rikmorskate (9 commits)")[![foodticket-developer](https://avatars.githubusercontent.com/u/148194376?v=4)](https://github.com/foodticket-developer "foodticket-developer (5 commits)")[![h-sols](https://avatars.githubusercontent.com/u/210041382?v=4)](https://github.com/h-sols "h-sols (5 commits)")[![hsols](https://avatars.githubusercontent.com/u/10848608?v=4)](https://github.com/hsols "hsols (1 commits)")

---

Tags

phpapi clientdeliveryTakeaway POSTakeaway

### Embed Badge

![Health badge](/badges/foodticket-takeaway-pos-client/health.svg)

```
[![Health](https://phpackages.com/badges/foodticket-takeaway-pos-client/health.svg)](https://phpackages.com/packages/foodticket-takeaway-pos-client)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M986](/packages/statamic-cms)[backpack/crud

Quickly build admin interfaces using Laravel, Bootstrap and JavaScript.

3.4k3.7M223](/packages/backpack-crud)[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k9.5M89](/packages/openai-php-laravel)[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

74331.3k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
