Toast API
Project description
toasttab
Authentication API
The authentication API returns an authentication token that you can present when your integration client software uses other Toast APIs. For more information about authentication, see the Toast Developer Guide.
Menus API
Returns information about a restaurant's menus.
Important: Ordering integrations should use menus API V3. Other integration types should continue to use menus API V2 until further notice. See <a href="https://doc.toasttab.com/doc/devguide/apiComparingMenusAPIV2AndV3.html\">Comparing menus API V2 and V3 for more information.
Orders API
The orders API includes operations that create, update, and retrieve information about restaurant guest orders.
Information on orders includes the checks, items ordered, prices, payments, discounts, and customer data.
You can create a new order. The orders API includes an operation to retrieve the order prices before you POST the order.
You can add items to an existing check.
The orders API also allows you to retrieve payment information for the order and add a credit card payment to the order. You cannot update an existing payment, but you can update the tip amount.
For delivery orders, you can update the delivery information.
You can retrieve the applicable discounts for an order, and then add a discount to a menu item selection or a check.
The orders API supports email addresses that:
- Are up to 53 characters long.
- Start with the email prefix, ends with the email domain name, where the prefix and domain are separated by an @.
- Use the following supported characters:
- a-z
- A-Z
- 0-9
- _ (underscore)
- International characters are not supported
Labor API
Toast labor API is a set of REST web services that you can use to manage the employees, jobs, and shifts for your restaurant. The labor API is intended for software engineers, managers, and technical staff who are responsible for integrating third-party systems with the Toast platform.
Restaurants API
Returns information about the configuration of restaurant.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.18
- Generator version: 7.14.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python 3.9+
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)
Then import the package:
import toastapi
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import toastapi
Tests
Execute pytest to run the tests.
Getting Started
Please follow the installation procedure and then run the following:
import toastapi
from toastapi.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://ws-sandbox-api.eng.toasttab.com
# See configuration.py for a list of all supported configuration parameters.
configuration = toastapi.Configuration(
host = "https://ws-sandbox-api.eng.toasttab.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
configuration.access_token = os.environ["ACCESS_TOKEN"]
# Enter a context with an instance of the API client
async with toastapi.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = toastapi.AlternatePaymentTypesApi(api_client)
toast_restaurant_external_id = 'toast_restaurant_external_id_example' # str | The Toast POS GUID of the restaurant that the configuration applies to.
page_token = 'page_token_example' # str | A string that identifies the set of data objects that the endpoint will return in its response data. You can use this parameter to retrieve one page of response data. You get the value that you supply in the `pageToken` parameter from the `Toast-Next-Page-Token` header field value of a previous request to the endpoint. For more information, see <a href=\"https://doc.toasttab.com/doc/devguide/apiResponseDataPagination.html\">Paginating response data</a>. (optional)
last_modified = '2013-10-20T19:20:30+01:00' # datetime | Limits the return data to objects created or modified after a specific date and time. For example: `2024-06-20T00:00:00.000%2B0000`. (optional)
try:
# Get alternative payment types
api_response = await api_instance.alternate_payment_types_get(toast_restaurant_external_id, page_token=page_token, last_modified=last_modified)
print("The response of AlternatePaymentTypesApi->alternate_payment_types_get:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling AlternatePaymentTypesApi->alternate_payment_types_get: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://ws-sandbox-api.eng.toasttab.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AlternatePaymentTypesApi | alternate_payment_types_get | GET /config/v2/alternatePaymentTypes | Get alternative payment types |
| AlternatePaymentTypesApi | alternate_payment_types_guid_get | GET /config/v2/alternatePaymentTypes/{guid} | Get an alternative payment type |
| AuthenticationApi | authentication_login_post | POST /authentication/v1/authentication/login | Get an authentication token |
| BreakTypesApi | break_types_get | GET /config/v2/breakTypes | Get break types |
| BreakTypesApi | break_types_guid_get | GET /config/v2/breakTypes/{guid} | Get a break type |
| CashDrawersApi | cash_drawers_get | GET /config/v2/cashDrawers | Get cash drawers |
| CashDrawersApi | cash_drawers_guid_get | GET /config/v2/cashDrawers/{guid} | Get a cash drawer |
| DiningOptionsApi | dining_options_get | GET /config/v2/diningOptions | Get dining options |
| DiningOptionsApi | dining_options_guid_get | GET /config/v2/diningOptions/{guid} | Get a dining option |
| DiscountsApi | applicable_discounts_post | POST /orders/v2/applicableDiscounts | Get applicable discounts |
| DiscountsApi | discounts_get | GET /config/v2/discounts | Get discounts |
| DiscountsApi | discounts_guid_get | GET /config/v2/discounts/{guid} | Get a discount |
| DiscountsApi | orders_checks_applied_discounts_post | POST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/appliedDiscounts | Add check-level discounts |
| DiscountsApi | orders_checks_selections_applied_discounts_post | POST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/selections/{selectionGuid}/appliedDiscounts | Add item-level discounts |
| EmployeesApi | employees_employee_id_delete | DELETE /labor/v1/employees/{employeeId} | Delete an employee |
| EmployeesApi | employees_employee_id_external_id_post | POST /labor/v1/employees/{employeeId}/externalId | Add an external identifier |
| EmployeesApi | employees_employee_id_external_id_put | PUT /labor/v1/employees/{employeeId}/externalId | Add or replace an external identifier |
| EmployeesApi | employees_employee_id_get | GET /labor/v1/employees/{employeeId} | Get information about one employee |
| EmployeesApi | employees_employee_id_jobs_put | PUT /labor/v1/employees/{employeeId}/jobs | Replace a jobs list |
| EmployeesApi | employees_employee_id_patch | PATCH /labor/v1/employees/{employeeId} | Update employee information |
| EmployeesApi | employees_employee_id_unarchive_put | PUT /labor/v1/employees/{employeeId}/unarchive | Unarchive an employee |
| EmployeesApi | employees_employee_id_wage_overrides_put | PUT /labor/v1/employees/{employeeId}/wageOverrides | Replace wage overrides |
| EmployeesApi | employees_get | GET /labor/v1/employees | Get employees |
| EmployeesApi | employees_post | POST /labor/v1/employees | Add an employee |
| JobsApi | jobs_get | GET /labor/v1/jobs | Get jobs |
| JobsApi | jobs_job_id_external_id_post | POST /labor/v1/jobs/{jobId}/externalId | Add an external identifier |
| JobsApi | jobs_job_id_external_id_put | PUT /labor/v1/jobs/{jobId}/externalId | Add or replace an external identifier |
| JobsApi | jobs_job_id_get | GET /labor/v1/jobs/{jobId} | Get one job |
| MenuGroupsApi | menu_groups_get | GET /config/v2/menuGroups | Get menu groups |
| MenuGroupsApi | menu_groups_guid_get | GET /config/v2/menuGroups/{guid} | Get a menu group |
| MenuItemsApi | menu_items_get | GET /config/v2/menuItems | Get menu items |
| MenuItemsApi | menu_items_guid_get | GET /config/v2/menuItems/{guid} | Get a menu item |
| MenusV2Api | menus_v2_get | GET /menus/v2/menus | Get menus (V2) |
| MenusV2Api | menus_v2_metadata_get | GET /menus/v2/metadata | Get menu last modified timestamp (V2) |
| MenusV3Api | menus_v3_get | GET /menus/v3/menus | Get menus |
| MenusV3Api | menus_v3_metadata_get | GET /menus/v3/metadata | Get menu last modified timestamp |
| NoSaleReasonsApi | no_sale_reasons_get | GET /config/v2/noSaleReasons | Get no sale reasons |
| NoSaleReasonsApi | no_sale_reasons_guid_get | GET /config/v2/noSaleReasons/{guid} | Get a no sale reason |
| OrdersApi | orders_bulk_get | GET /orders/v2/ordersBulk | Get multiple orders |
| OrdersApi | orders_get | GET /orders/v2/orders | Get order identifiers (deprecated) |
| OrdersApi | orders_guid_get | GET /orders/v2/orders/{guid} | Get an order |
| OrdersApi | orders_order_guid_checks_check_guid_selections_post | POST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/selections | Add items to a check |
| OrdersApi | orders_order_guid_delivery_info_patch | PATCH /orders/v2/orders/{orderGuid}/deliveryInfo | Update delivery information |
| OrdersApi | orders_post | POST /orders/v2/orders | Post an order |
| OrdersApi | prices_post | POST /orders/v2/prices | Get order prices |
| OrdersApi | void_order | POST /orders/v2/orders/{orderGuid}/void | Void an order |
| PaymentsApi | orders_checks_payments_post | POST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/payments | Post payments |
| PaymentsApi | orders_order_guid_checks_check_guid_payments_payment_guid_patch | PATCH /orders/v2/orders/{orderGuid}/checks/{checkGuid}/payments/{paymentGuid} | Update a tip amount |
| PaymentsApi | payments_get | GET /orders/v2/payments | Get payment identifiers |
| PaymentsApi | payments_guid_get | GET /orders/v2/payments/{guid} | Get a payment |
| PayoutReasonsApi | payout_reasons_get | GET /config/v2/payoutReasons | Get payout reasons |
| PayoutReasonsApi | payout_reasons_guid_get | GET /config/v2/payoutReasons/{guid} | Get payout reason by GUID |
| PreModifierGroupsApi | pre_modifier_groups_get | GET /config/v2/preModifierGroups | Get pre modifier groups |
| PreModifierGroupsApi | pre_modifier_groups_guid_get | GET /config/v2/preModifierGroups/{guid} | Get a pre-modifier group |
| PreModifiersApi | pre_modifiers_get | GET /config/v2/preModifiers | Get pre-modifiers |
| PriceGroupsApi | price_groups_get | GET /config/v2/priceGroups | Get price groups |
| PriceGroupsApi | price_groups_guid_get | GET /config/v2/priceGroups/{guid} | Get price group by GUID |
| PrintersApi | printers_get | GET /config/v2/printers | Get printers |
| PrintersApi | printers_guid_get | GET /config/v2/printers/{guid} | Get a printer |
| RestaurantServicesApi | restaurant_services_get | GET /config/v2/restaurantServices | Get restaurant services |
| RestaurantServicesApi | restaurant_services_guid_get | GET /config/v2/restaurantServices/{guid} | Get restaurant service by GUID |
| RestaurantsApi | groups_management_group_guid_restaurants_get | GET /restaurants/v1/groups/{managementGroupGUID}/restaurants | Get restaurants in a management group |
| RestaurantsApi | restaurants_restaurant_guid_get | GET /restaurants/v1/restaurants/{restaurantGUID} | Get restaurant configuration information |
| RevenueCentersApi | revenue_centers_get | GET /config/v2/revenueCenters | Get revenue centers |
| RevenueCentersApi | revenue_centers_guid_get | GET /config/v2/revenueCenters/{guid} | Get revenue center by GUID |
| ServiceAreasApi | service_areas_get | GET /config/v2/serviceAreas | Get service areas |
| ServiceAreasApi | service_areas_guid_get | GET /config/v2/serviceAreas/{guid} | Get service area by GUID |
| ServiceChargesApi | service_charges_get | GET /config/v2/serviceCharges | Get service charges |
| ServiceChargesApi | service_charges_guid_get | GET /config/v2/serviceCharges/{guid} | Get service charge by GUID |
| ShiftsApi | shifts_get | GET /labor/v1/shifts | Get shifts |
| ShiftsApi | shifts_post | POST /labor/v1/shifts | Create a shift |
| ShiftsApi | shifts_shift_id_delete | DELETE /labor/v1/shifts/{shiftId} | Delete a shift |
| ShiftsApi | shifts_shift_id_get | GET /labor/v1/shifts/{shiftId} | Get a shift |
| ShiftsApi | shifts_shift_id_put | PUT /labor/v1/shifts/{shiftId} | Update a shift |
| TablesApi | tables_get | GET /config/v2/tables | Get tables |
| TablesApi | tables_guid_get | GET /config/v2/tables/{guid} | Get a table |
| TaxRatesApi | tax_rates_get | GET /config/v2/taxRates | Get tax rates |
| TaxRatesApi | tax_rates_guid_get | GET /config/v2/taxRates/{guid} | Get tax rate by GUID |
| TimeEntriesApi | time_entries_get | GET /labor/v1/timeEntries | Get time entries |
| TimeEntriesApi | time_entries_time_entry_id_get | GET /labor/v1/timeEntries/{timeEntryId} | Get one time entry |
| TipWithholdingApi | tip_withholding_get | GET /config/v2/tipWithholding | Get tip withholding configuration |
| VoidReasonsApi | void_reasons_get | GET /config/v2/voidReasons | Get void reasons |
| VoidReasonsApi | void_reasons_guid_get | GET /config/v2/voidReasons/{guid} | Get void reason by GUID |
Documentation For Models
- AlternatePaymentType
- ApplicableDiscount
- ApplicableDiscountsRequest
- AppliedDiscount
- AppliedDiscountReason
- AppliedDiscountTrigger
- AppliedLoyaltyInfo
- AppliedPackagingInfo
- AppliedPackagingItem
- AppliedServiceCharge
- AppliedTaxRate
- AuthenticationRequest
- AuthenticationResponse
- AuthenticationToken
- BreakType
- CashDrawer
- Check
- ConfigReference
- CurbsidePickupInfo
- Customer
- DaySchedule
- Delivery
- DeliveryInfo
- DeliveryPaymentOptions
- DeliveryServiceInfo
- Device
- DiningOption
- Discount
- Employee
- ErrorMessage
- ExternalReference
- General
- GiftCardInfo
- Hours
- Image
- ItemTag
- Job
- JobWageOverride
- Location
- LoyaltyDetails
- MarketplaceFacilitatorTaxInfo
- Menu
- MenuGroup
- MenuItem
- Metadata
- ModifierGroup
- ModifierOption
- ModifierOptionTaxInfo
- NoSaleReason
- OnlineOrdering
- Order
- OrderResponse
- OrdersOrderGuidDeliveryInfoPatchRequest
- Payment
- PaymentOptions
- PayoutReason
- Portion
- PreModifier
- PreModifierGroup
- PrepTimes
- PriceGroup
- Printer
- Refund
- RefundDetails
- Restaurant
- RestaurantBasic
- RestaurantInfo
- RestaurantService
- RevenueCenter
- SalesCategory
- Schedules
- Selection
- Service
- ServiceArea
- ServiceCharge
- ServiceChargeCriteria
- Shift
- Table
- TakeoutPaymentOptions
- TaxRate
- TimeEntry
- TimeEntryBreak
- TipWithholding
- ToastReference
- URLs
- UpdatePaymentRequest
- Visibility
- VoidInformation
- VoidOrderRequest
- VoidOrderRequestSelections
- VoidReason
- WeekSchedule
Documentation For Authorization
Authentication schemes defined for the API:
oauth2
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes:
- restaurants:read: Allows reading from the restaurants API.
- labor:read: Allows reading from the labor API.
- orders:read: Allows reading from the orders API.
- orders:write: Allows writing to the orders API.
- payments:read: Allows reading from the payments API.
- payments:write: Allows writing to the payments API.
- discounts:read: Allows reading from the discounts API.
- discounts:write: Allows writing to the discounts API.
- menus.channel:read: Allows reading from the menus API.
- menus:read: Allows reading from menus API V2.
- config:read: Allows reading from the configuration API.
Author
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toastapi-1.0.18.tar.gz.
File metadata
- Download URL: toastapi-1.0.18.tar.gz
- Upload date:
- Size: 194.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77f7ce1278c7845cb7e95015ae3053a104bd188879c8333bfa89a7cba093b30d
|
|
| MD5 |
e0b5c0adb6671be7ce5e2617493d14eb
|
|
| BLAKE2b-256 |
a80eb1341da9e387ef9140115666ff29df700a4c5451628ca51c4750704a77b7
|
File details
Details for the file toastapi-1.0.18-py3-none-any.whl.
File metadata
- Download URL: toastapi-1.0.18-py3-none-any.whl
- Upload date:
- Size: 402.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a6c700b89ab713e9c1fbaea2ee8129ffbb00cf399a8398e81784025b339d668
|
|
| MD5 |
1810462b0cb1503acca9f6bc66cadf58
|
|
| BLAKE2b-256 |
67faaf178ceda1eba930a42f07c117e935fc14d2a088721a3974cdae322bafe5
|