foodticket / jet-connect-client
A PHP client to integrate with the JET Connect API
Requires
- php: ^8.3
- guzzlehttp/guzzle: ^7.0
- laravel/framework: ^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^10.0|^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- 1.0.13
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-feature/delivery-update
- dev-feature/OBV3-5679-remove-webhook-logs
- dev-feature/OBV3-5633-always-validate-webhooks
- dev-feature/allow-overriding-api-key
- dev-feature/add-item-modification-endpoint
- dev-feature/add-more-requests
- dev-feature/confirm-order
- dev-feature/add-more-logging
- dev-feature/add-menu-ingest-endpoint
- dev-laravel-12
This package is auto-updated.
Last update: 2026-12-01 08:48:35 UTC
README
This package allows you to easily make requests to JustEatTakeaway's JET Connect API.
Requirements
- PHP >= 8.3
- Laravel >= 12.0
Installation
You can install the package via composer:
composer require foodticket/jet-connect
The package will automatically register itself.
Configuration
To start using the JET Connect API you will need an API key. Add the API key to your project's .env file:
JET_CONNECT_API_KEY=
Making requests
All endpoints are accessed through JetConnectApi:
use Foodticket\JetConnect\Endpoints\JetConnectApi; $api = new JetConnectApi();
setItemAvailability
Mark one or more menu items as available or unavailable for a given restaurant.
use Foodticket\JetConnect\Enums\Availability; $api->setItemAvailability( availability: Availability::UNAVAILABLE, itemsIds: ['plu-123', 'plu-456'], restaurant: $restaurantId, nextAvailableAt: now()->addHours(2), // optional, only used when UNAVAILABLE );
| Parameter | Type | Required | Description |
|---|---|---|---|
availability |
Availability |
Yes | Availability::AVAILABLE or Availability::UNAVAILABLE |
itemsIds |
array |
Yes | Array of item PLU/reference strings |
restaurant |
string |
Yes | Restaurant identifier |
nextAvailableAt |
Carbon|null |
No | When the item becomes available again (only applies when marking unavailable) |
ingestMenu
Push a full menu to JET Connect for one or more restaurants.
$api->ingestMenu( restaurants: ['restaurant-id-1'], menus: [$menuArray], callbackUrl: 'https://yourapp.com/jet-connect/menu-callback', // optional );
| Parameter | Type | Required | Description |
|---|---|---|---|
restaurants |
array |
Yes | Array of restaurant identifier strings |
menus |
array |
Yes | Menu payload array |
callbackUrl |
string|null |
No | URL that JET Connect will call when ingestion completes |
sentToPosSuccess
Confirm that an order was successfully sent to the POS.
$api->sentToPosSuccess(orderId: $orderId);
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId |
string |
Yes | The JET Connect order ID |
sentToPosFailed
Report that sending an order to the POS failed.
use Foodticket\JetConnect\Enums\ErrorCode; $api->sentToPosFailed( orderId: $orderId, errorCode: ErrorCode::TIMEOUT, errorMessage: 'POS did not respond within the timeout window', );
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId |
string |
Yes | The JET Connect order ID |
errorCode |
ErrorCode |
Yes | One of the error codes below |
errorMessage |
string |
Yes | Human-readable description of the failure |
Available ErrorCode values:
| Value | Description |
|---|---|
AUTH_FAILED |
Order authorization was incorrect |
INCORRECT_SETUP |
Configuration details sent with the order are wrong (e.g. store ID) |
IN_USE |
POS is currently in use and cannot take requests |
INACTIVE |
POS is offline and cannot take orders |
MALFORMED_REQUEST |
Order request was malformed (e.g. malformed JSON) |
MENU_ERROR |
Order had incorrect items (not in stock, PLU not in POS) |
NOT_SUPPORTED |
Integrated ordering is not supported at this restaurant |
STORE_CLOSED |
Store is closed and cannot take orders |
TENDER_ERROR |
Tender type sent to the POS is wrong |
TIMEOUT |
Request to the POS timed out |
orderItemModification
Report that one or more items could not be fulfilled, so JET can update the order accordingly.
$api->orderItemModification( orderId: $orderId, modifications: [ [ 'removedItems' => [ ['plu' => 'plu-123', 'missingQuantity' => 1], ['plu' => 'plu-456', 'missingQuantity' => 2], ], ], ], );
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId |
string |
Yes | The JET Connect order ID |
modifications |
array |
Yes | Array of modification objects (see structure below) |
Each modification object:
| Key | Type | Description |
|---|---|---|
removedItems |
array |
Items that could not be fulfilled |
Each removedItems entry:
| Key | Type | Description |
|---|---|---|
plu |
string |
PLU code of the item |
missingQuantity |
int |
Number of units that could not be fulfilled |
deliveryUpdate
Send a delivery tracking update for an order the restaurant delivers with its own couriers. Statuses follow
created → assigned → pickedUp → delivered; JET Connect fills in skipped steps and rejects a status that moves
backwards with a 400.
use Foodticket\JetConnect\Enums\DeliveryStatus; $api->deliveryUpdate( orderId: $orderId, occurredAt: now(), status: DeliveryStatus::ASSIGNED, courierId: $courierUuid, estimatedDeliveryTime: now()->addMinutes(20), // optional );
| Parameter | Type | Required | Description |
|---|---|---|---|
orderId |
string |
Yes | The JET Connect order ID |
occurredAt |
CarbonInterface |
Yes | When the update happened |
status |
DeliveryStatus|null |
No | The delivery job status |
courierId |
string|null |
With ASSIGNED |
Opaque id of the courier, unique across your fleet. Also required with a later status sent before a courier was assigned |
reason |
string|null |
No | Why the delivery was cancelled or rejected; only sent with CANCELLED and REJECTED |
estimatedDeliveryTime |
CarbonInterface|null |
No | When the order is expected to reach the customer |
deliveryReference |
string|null |
No | Identifies one delivery when an order has more than one |
Custom requests
To call any JET Connect endpoint not covered above:
$api->request()->get('/some-endpoint'); $api->request()->post('/some-endpoint', $payload);
Webhooks
To start receiving webhooks from JET Connect, you need to add the following route the App\Providers\RouteServiceProvider file:
$this->routes(function () { // ... Route::jetConnectWebhooks(); });
Set the API key and HMAC secret JET Connect uses for its webhooks. Both are required: without them every webhook is rejected with a 401.
JET_CONNECT_WEBHOOK_API_KEY= JET_CONNECT_WEBHOOK_HMAC_SECRET=
Security Vulnerabilities
If you discover a security vulnerability within this project, please report this by email to developer@foodticket.nl.