Via Composer
$ composer require lfrichter/omnivore
If you do not run Laravel 5.5 (or higher), then add in config/app.php:
- service provider:
lfrichter\omnivore\omnivoreServiceProvider::class,
- facade to aliases:
'Omnivore' => lfrichter\omnivore\Facades\omnivore::class,
Place these values into your .ENV
OMNIVORE_API_URL=
OMNIVORE_API_KEY=
OMNIVORE_LOCATION_ID=
ES_FROM=
ES_SIZE=
Interact with tickets of claimed locations from the POS.
$ticketList = Omnivore::tickets()->ticketList($locationId);
$ticketOpen = Omnivore::tickets()->ticketOpen($locationId, $content);
To open a new ticket you'll need the following:
- a valid employee id for the Location — we'll use EMPLOYEEID
- a valid order type id for the Location — we'll use ORDERTYPEID
- a valid revenue center id for the Location — we'll use REVENUECENTERID
- a valid table id for the Location — we'll use TABLEID
{
"employee": "EMPLOYEEID",
"order_type": "ORDERTYPEID",
"revenue_center": "REVENUECENTERID",
"table": "TABLEID",
"guest_count": 1,
"name": "New Ticket",
"auto_send": true
}
You should get a 201 CREATED HTTP response to let you know your ticket has been added. You'll also get the ticket id field in the response which you need to add menu items or make payments.
Did you notice the auto_send field we used when we opened the ticket? It determines whether new menu items are sent to the kitchen immediately, or if they're held until the ticket is paid. By default it's true which means as soon as you add a menu item to the ticket it will be made by the restaurant. If you set it to false nothing will be made until the ticket is paid in full and closed.
$ticketRetrieve = Omnivore::tickets()->ticketRetrieve($locationId, $ticketId);
$ticketVoid = Omnivore::tickets()->ticketVoid($locationId, $ticketId);
$ticketDiscountList = Omnivore::tickets()->ticketDiscountList($locationId, $ticketId);
$ticketDiscountApply = Omnivore::tickets()->ticketDiscountApply($locationId, $ticketId, $discount, $value);
$ticketDiscountRetrieve = Omnivore::tickets()->ticketDiscountRetrieve($locationId, $ticketId, $ticketDiscountId);
$ticketItemList = Omnivore::tickets()->ticketItemList($locationId, $ticketId);
You'll get a list of menu items each with two important pieces of information:
- the menu item
id
- the list of acceptable
price_levels
for the item
$ticketItemAdd = Omnivore::tickets()->ticketItemAdd($locationId, $ticketId, $content);
For this example pick an item that looks tasty and note its id
then choose an arbitrary price_levels
element and note its id
as well. We'll refer to them as MENUITEMID and PRICELEVELID respectively. Now, let's place an order on the ticket from earlier.
{
"menu_item": "MENUITEMID",
"quantity": 1,
"price_level": "PRICELEVELID",
"comment": "Get in my belly!",
"modifiers": []
}
Let's say you've picked out a menu item, looked up its modifier groups, and figured out which modifiers you want to apply. You've noted all the modifier id values and the id for the appropriate price_level on each one. That's a lot, but now you're ready to place a personalized order.
{
"menu_item": "MENUITEMID",
"quantity": 1,
"price_level": "PRICELEVELID",
"comment": "Get in my belly!",
"modifiers": [
{
"modifier": "MODIFIERID",
"quantity": 1,
"price_level": "PRICELEVELID",
"comment": "on the side"
},
{
"modifier": "MODIFIERID",
"quantity": 1,
"price_level": "PRICELEVELID",
"comment": "extra"
}
]
}
$ticketItemRetrieve = Omnivore::tickets()->ticketItemRetrieve($locationId, $ticketId, $ticketItemId);
$ticketItemVoid = Omnivore::tickets()->ticketItemVoid($locationId, $ticketId, $ticketItemId)
$ticketItemModifierList = Omnivore::tickets()->ticketItemModifierList($locationId, $ticketId, $ticketItemId)
$ticketItemModifierRetrieve = Omnivore::tickets()->ticketItemModifierRetrieve($locationId, $ticketId, $ticketItemId, $ticketItemModifierId)
$ticketItemDiscountList = Omnivore::tickets()->ticketItemDiscountList($locationId, $ticketId, $ticketItemId)
$ticketItemDiscountRetrieve = Omnivore::tickets()->ticketItemDiscountRetrieve($locationId, $ticketId, $ticketItemId, $ticketItemDiscountId)
$paymentList = Omnivore::tickets()->paymentList($locationId, $ticketId)
$paymentRetrieve = Omnivore::tickets()->paymentRetrieve($locationId, $ticketId, $paymentId)
$paymentCardNotPresent = Omnivore::tickets()->paymentCardNotPresent($locationId, $ticketId, $content)
{
"type": "card_not_present",
"amount": 500,
"tip": 100,
"card_info": {
"exp_month": 1,
"exp_year": 2025,
"cvc2": 123,
"number": "4111111111111111"
}
}
$paymentCardPresent = Omnivore::tickets()->paymentCardPresent($locationId, $ticketId, $content)
{
"type": "card_present",
"amount": 500,
"tip": 100,
"card_info": {
"data": "%B4111111111111111^SCHMOE /JOE^180710100695000000?"
}
}
$payment3rdParty = Omnivore::tickets()->payment3rdParty($locationId, $ticketId, $content)
{
"type": "3rd_party",
"amount": 500,
"tip": 100,
"tender_type": TENDERTYPEID,
"payment_source": "put your transaction reference here"
}
$paymentGiftCard = Omnivore::tickets()->paymentGiftCard($locationId, $ticketId, $content)
{
"type": "gift_card",
"amount": 500,
"tip": 100,
"card_info": {
"number": "1111111111111111"
}
}
$paymentCash = Omnivore::tickets()->paymentCash($locationId, $ticketId, $content)
Interact with tables of claimed locations from the POS.
$tableList = Omnivore::tables()->tableList($locationId)
$tableRetrieve = Omnivore::tables()->tableRetrieve($locationId, $tableId)
Interact with general labeled actions of claimed locations from the POS.
$locations = Omnivore::general()->locationList();
$locationRetrieve = Omnivore::general()->locationRetrieve($locationId)
$employeeList = Omnivore::general()->employeeList($locationId)
$employeeRetrieve = Omnivore::general()->employeeRetrieve($locationId, $employeeId)
$orderTypeList = Omnivore::general()->orderTypeList($locationId)
$orderTypeRetrieve = Omnivore::general()->orderTypeRetrieve($locationId, $orderTypeId)
$tenderTypeList = Omnivore::general()->tenderTypeList($locationId)
$tenderTypeRetrieve = Omnivore::general()->tenderTypeRetrieve($locationId, $tenderTypeId)
$revenueCenterList = Omnivore::general()->revenueCenterList($locationId)
$revenueCenterRetrieve = Omnivore::general()->revenueCenterRetrieve($locationId, $revenueCenterId)
$discountList = Omnivore::general()->discountList($locationId)
$discountRetrieve = Omnivore::general()->discountRetrieve($locationId, $discountId)
$menu = Omnivore::general()->menu($locationId)
$categoryList = Omnivore::general()->categoryList($locationId)
$categoryRetrieve = Omnivore::general()->categoryRetrieve($locationId, $categoryId)
$menuItemList = Omnivore::general()->menuItemList($locationId)
$menuItemRetrieve = Omnivore::general()->menuItemRetrieve($locationId, $menuItemId)
$modifierList = Omnivore::general()->modifierList($locationId)
$modifierRetrieve = Omnivore::general()->modifierRetrieve($locationId, $modifierId)
$modifierGroupList = Omnivore::general()->modifierGroupList($locationId, $menuItemId)
$modifierGroupRetrieve = Omnivore::general()->modifierGroupRetrieve($locationId, $menuItemId, $modifierGroupId)
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
- Luis Fernando Richter
- This package was based in Onivore from Andreas Beasley
license. Please see the license file for more information.