Download the PHP package foodticket/takeaway-pos-client without Composer

On this page you can find all versions of the php package foodticket/takeaway-pos-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package takeaway-pos-client

Takeaway POS API implementation for Laravel

GitHub license

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

Requirements

Installation

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

Publish the config file:

Configuration

Add the following variables to your .env file:

Variable Default Description
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 login

The published config/takeaway.php also exposes two routing options:

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

Usage

Instantiate TakeawayApi directly or resolve it from the container:


Outgoing API endpoints

Login — logInClient()

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

HTTP request: POST /login

Field Required Description
apiKey yes Pulled from takeaway.api_key config
restaurant yes The restaurant identifier
orderUrl yes URL called by Takeaway when a new order arrives
aliveUrl yes URL polled by Takeaway to check POS availability
clientKey yes Unique key identifying this POS client
version yes Pulled from takeaway.api_version config
driverUpdateUrl no URL for driver status updates
subscribe.orderCancelled no URL called when an order is cancelled

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.

HTTP request: POST /logout

Field Required Description
apiKey yes Pulled from takeaway.api_key config
restaurant yes The restaurant identifier

Set order status — setOrderStatus()

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

HTTP request: POST {statusUrl}

Field Required Description
id yes Order identifier
status yes One of the OrderStatus enum values (see below)
key yes Order key provided in the incoming order payload
changedDeliveryTime conditional ISO 8601 timestamp — required when status is confirmed
text no Optional message/note

OrderStatus enum values

Case Value Description
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

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

Method Path Description
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

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

Listen for it in your application:

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:

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

The event payload is a TakeawayWebhook object:


Security Vulnerabilities

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


All versions of takeaway-pos-client with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
guzzlehttp/guzzle Version ^7.0
laravel/framework Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package foodticket/takeaway-pos-client contains the following files

Loading the files please wait ...