Skip to main content

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.49
  • 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 alternate payment type is configured for. 
    guid = 'guid_example' # str | The Toast POS GUID of the alternative form of payment.

    try:
        # Get an alternative payment type 
        api_response = await api_instance.get_alternate_payment_type_by_id(toast_restaurant_external_id, guid)
        print("The response of AlternatePaymentTypesApi->get_alternate_payment_type_by_id:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AlternatePaymentTypesApi->get_alternate_payment_type_by_id: %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 get_alternate_payment_type_by_id GET /config/v2/alternatePaymentTypes/{guid} Get an alternative payment type
AlternatePaymentTypesApi list_alternate_payment_types GET /config/v2/alternatePaymentTypes Get alternative payment types
AnalyticsApi create_guest_reporting_data_request POST /era/v1/guest/payments/{timeRange} Post a guest reporting data request organized by payment for a specific time range
AnalyticsApi get_guest_reporting_data GET /era/v1/guest/payments/{reportRequestGuid} Get the guest reporting data organized by payment
AuthenticationApi login POST /authentication/v1/authentication/login Get an authentication token
BreakTypesApi get_break_type_by_id GET /config/v2/breakTypes/{guid} Get a break type
BreakTypesApi list_break_types GET /config/v2/breakTypes Get break types
CashDrawersApi get_cash_drawer_by_id GET /config/v2/cashDrawers/{guid} Get a cash drawer
CashDrawersApi list_cash_drawers GET /config/v2/cashDrawers Get cash drawers
DiningOptionsApi get_dining_option_by_id GET /config/v2/diningOptions/{guid} Get a dining option
DiningOptionsApi list_dining_options GET /config/v2/diningOptions Get dining options
DiscountsApi add_check_level_discounts POST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/appliedDiscounts Add check-level discounts
DiscountsApi add_item_level_discounts POST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/selections/{selectionGuid}/appliedDiscounts Add item-level discounts
DiscountsApi get_applicable_discounts POST /orders/v2/applicableDiscounts Get applicable discounts
DiscountsApi get_discount_by_id GET /config/v2/discounts/{guid} Get a discount
DiscountsApi list_discounts GET /config/v2/discounts Get discounts
EmployeesApi add_external_identifier_to_employee POST /labor/v1/employees/{employeeId}/externalId Add an external identifier
EmployeesApi add_or_replace_external_identifier_to_employee PUT /labor/v1/employees/{employeeId}/externalId Add or replace an external identifier
EmployeesApi create_employee POST /labor/v1/employees Add an employee
EmployeesApi delete_employee DELETE /labor/v1/employees/{employeeId} Delete an employee
EmployeesApi get_employee_by_id GET /labor/v1/employees/{employeeId} Get information about one employee
EmployeesApi list_employees GET /labor/v1/employees Get employees
EmployeesApi replace_jobs_list PUT /labor/v1/employees/{employeeId}/jobs Replace a jobs list
EmployeesApi replace_wage_overrides PUT /labor/v1/employees/{employeeId}/wageOverrides Replace wage overrides
EmployeesApi unarchive_employee PUT /labor/v1/employees/{employeeId}/unarchive Unarchive an employee
EmployeesApi update_employee PATCH /labor/v1/employees/{employeeId} Update employee information
JobsApi add_external_identifier_to_job POST /labor/v1/jobs/{jobId}/externalId Add an external identifier
JobsApi add_or_replace_external_identifier_to_job PUT /labor/v1/jobs/{jobId}/externalId Add or replace an external identifier
JobsApi get_job_by_id GET /labor/v1/jobs/{jobId} Get one job
JobsApi list_jobs GET /labor/v1/jobs Get jobs
MenuGroupsApi get_menu_group_by_id GET /config/v2/menuGroups/{guid} Get a menu group
MenuGroupsApi list_menu_groups GET /config/v2/menuGroups Get menu groups
MenuItemsApi get_menu_item_by_id GET /config/v2/menuItems/{guid} Get a menu item
MenuItemsApi list_menu_items GET /config/v2/menuItems Get menu items
MenusV2Api get_menus_metadata GET /menus/v2/metadata Get menu last modified timestamp (V2)
MenusV2Api list_menus GET /menus/v2/menus Get menus (V2)
MenusV3Api get_menus_metadata_v3 GET /menus/v3/metadata Get menu last modified timestamp
MenusV3Api list_menus_v3 GET /menus/v3/menus Get menus
ModifierGroupsApi get_menu_option_group_by_id GET /config/v2/menuOptionGroups/{guid} Get a modifier group
ModifierGroupsApi list_menu_option_groups GET /config/v2/menuOptionGroups Get modifier groups
NoSaleReasonsApi get_no_sale_reason_by_id GET /config/v2/noSaleReasons/{guid} Get a no sale reason
NoSaleReasonsApi list_no_sale_reasons GET /config/v2/noSaleReasons Get no sale reasons
OrdersApi add_items_to_check POST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/selections Add items to a check
OrdersApi calculate_order_prices POST /orders/v2/prices Get order prices
OrdersApi create_order POST /orders/v2/orders Post an order
OrdersApi get_multiple_orders GET /orders/v2/ordersBulk Get multiple orders
OrdersApi get_order_by_guid GET /orders/v2/orders/{guid} Get an order
OrdersApi list_order_identifiers GET /orders/v2/orders Get order identifiers (deprecated)
OrdersApi update_delivery_info PATCH /orders/v2/orders/{orderGuid}/deliveryInfo Update delivery information
OrdersApi void_order POST /orders/v2/orders/{orderGuid}/void Void an order
PaymentsApi add_payments_to_check POST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/payments Post payments
PaymentsApi get_payment_by_guid GET /orders/v2/payments/{guid} Get a payment
PaymentsApi list_payments GET /orders/v2/payments Get payment identifiers
PaymentsApi update_tip_amount PATCH /orders/v2/orders/{orderGuid}/checks/{checkGuid}/payments/{paymentGuid} Update a tip amount
PayoutReasonsApi get_payout_reason_by_id GET /config/v2/payoutReasons/{guid} Get payout reason by GUID
PayoutReasonsApi list_payout_reasons GET /config/v2/payoutReasons Get payout reasons
PreModifierGroupsApi get_pre_modifier_group_by_id GET /config/v2/preModifierGroups/{guid} Get a pre-modifier group
PreModifierGroupsApi list_pre_modifier_groups GET /config/v2/preModifierGroups Get pre modifier groups
PreModifiersApi list_pre_modifiers GET /config/v2/preModifiers Get pre-modifiers
PriceGroupsApi get_price_group_by_id GET /config/v2/priceGroups/{guid} Get price group by GUID
PriceGroupsApi list_price_groups GET /config/v2/priceGroups Get price groups
PrintersApi get_printer_by_id GET /config/v2/printers/{guid} Get a printer
PrintersApi list_printers GET /config/v2/printers Get printers
RestaurantServicesApi get_restaurant_service_by_id GET /config/v2/restaurantServices/{guid} Get restaurant service by GUID
RestaurantServicesApi list_restaurant_services GET /config/v2/restaurantServices Get restaurant services
RestaurantsApi get_restaurant_by_id GET /restaurants/v1/restaurants/{restaurantGUID} Get restaurant configuration information
RestaurantsApi list_restaurants_in_management_group GET /restaurants/v1/groups/{managementGroupGUID}/restaurants Get restaurants in a management group
RevenueCentersApi get_revenue_center_by_id GET /config/v2/revenueCenters/{guid} Get revenue center by GUID
RevenueCentersApi list_revenue_centers GET /config/v2/revenueCenters Get revenue centers
ServiceAreasApi get_service_area_by_id GET /config/v2/serviceAreas/{guid} Get service area by GUID
ServiceAreasApi list_service_areas GET /config/v2/serviceAreas Get service areas
ServiceChargesApi get_service_charge_by_id GET /config/v2/serviceCharges/{guid} Get service charge by GUID
ServiceChargesApi list_service_charges GET /config/v2/serviceCharges Get service charges
ShiftsApi create_shift POST /labor/v1/shifts Create a shift
ShiftsApi delete_shift DELETE /labor/v1/shifts/{shiftId} Delete a shift
ShiftsApi get_shift_by_id GET /labor/v1/shifts/{shiftId} Get a shift
ShiftsApi list_shifts GET /labor/v1/shifts Get shifts
ShiftsApi update_shift PUT /labor/v1/shifts/{shiftId} Update a shift
TablesApi get_table_by_id GET /config/v2/tables/{guid} Get a table
TablesApi list_tables GET /config/v2/tables Get tables
TaxRatesApi get_tax_rate_by_id GET /config/v2/taxRates/{guid} Get tax rate by GUID
TaxRatesApi list_tax_rates GET /config/v2/taxRates Get tax rates
TimeEntriesApi get_time_entry_by_id GET /labor/v1/timeEntries/{timeEntryId} Get one time entry
TimeEntriesApi list_time_entries GET /labor/v1/timeEntries Get time entries
TipWithholdingApi get_tip_withholding GET /config/v2/tipWithholding Get tip withholding configuration
VoidReasonsApi get_void_reason_by_id GET /config/v2/voidReasons/{guid} Get void reason by GUID
VoidReasonsApi list_void_reasons GET /config/v2/voidReasons Get void reasons

Documentation For Models

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

toastapi-1.0.49.tar.gz (213.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

toastapi-1.0.49-py3-none-any.whl (465.9 kB view details)

Uploaded Python 3

File details

Details for the file toastapi-1.0.49.tar.gz.

File metadata

  • Download URL: toastapi-1.0.49.tar.gz
  • Upload date:
  • Size: 213.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for toastapi-1.0.49.tar.gz
Algorithm Hash digest
SHA256 cd1b0c7713277252029377b3e3962d0fafca1cd62c352b3e0ab8c300f78dbb34
MD5 8b2b766927439d5db478d7afec63a8eb
BLAKE2b-256 d3d3657f1d01280688a19e472402ebe89789a2947ea01131a574ed249afc549a

See more details on using hashes here.

File details

Details for the file toastapi-1.0.49-py3-none-any.whl.

File metadata

  • Download URL: toastapi-1.0.49-py3-none-any.whl
  • Upload date:
  • Size: 465.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for toastapi-1.0.49-py3-none-any.whl
Algorithm Hash digest
SHA256 7ef223a0f039f0d2590f03e4e31a9f844a2f45affc1eaaa98318bbbe5471f154
MD5 38b315cdab02f644820167320e225ed4
BLAKE2b-256 87b4da9c99f22e53fe883499e0ffe045188692d7259c7a246a085dac8436cd9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page