You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

toastapi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

toastapi

Toast API

1.0.4
pipPyPI
Maintainers
1

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.4
  • 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

ClassMethodHTTP requestDescription
AlternatePaymentTypesApialternate_payment_types_getGET /config/v2/alternatePaymentTypesGet alternative payment types
AlternatePaymentTypesApialternate_payment_types_guid_getGET /config/v2/alternatePaymentTypes/{guid}Get an alternative payment type
AuthenticationApiauthentication_login_postPOST /authentication/v1/authentication/loginGet an authentication token
BreakTypesApibreak_types_getGET /config/v2/breakTypesGet break types
BreakTypesApibreak_types_guid_getGET /config/v2/breakTypes/{guid}Get a break type
CashDrawersApicash_drawers_getGET /config/v2/cashDrawersGet cash drawers
CashDrawersApicash_drawers_guid_getGET /config/v2/cashDrawers/{guid}Get a cash drawer
DiningOptionsApidining_options_getGET /config/v2/diningOptionsGet dining options
DiningOptionsApidining_options_guid_getGET /config/v2/diningOptions/{guid}Get a dining option
DiscountsApiapplicable_discounts_postPOST /orders/v2/applicableDiscountsGet applicable discounts
DiscountsApiorders_checks_applied_discounts_postPOST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/appliedDiscountsAdd check-level discounts
DiscountsApiorders_checks_selections_applied_discounts_postPOST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/selections/{selectionGuid}/appliedDiscountsAdd item-level discounts
EmployeesApiemployees_employee_id_deleteDELETE /labor/v1/employees/{employeeId}Delete an employee
EmployeesApiemployees_employee_id_external_id_postPOST /labor/v1/employees/{employeeId}/externalIdAdd an external identifier
EmployeesApiemployees_employee_id_external_id_putPUT /labor/v1/employees/{employeeId}/externalIdAdd or replace an external identifier
EmployeesApiemployees_employee_id_getGET /labor/v1/employees/{employeeId}Get information about one employee
EmployeesApiemployees_employee_id_jobs_putPUT /labor/v1/employees/{employeeId}/jobsReplace a jobs list
EmployeesApiemployees_employee_id_patchPATCH /labor/v1/employees/{employeeId}Update employee information
EmployeesApiemployees_employee_id_unarchive_putPUT /labor/v1/employees/{employeeId}/unarchiveUnarchive an employee
EmployeesApiemployees_employee_id_wage_overrides_putPUT /labor/v1/employees/{employeeId}/wageOverridesReplace wage overrides
EmployeesApiemployees_getGET /labor/v1/employeesGet employees
EmployeesApiemployees_postPOST /labor/v1/employeesAdd an employee
JobsApijobs_getGET /labor/v1/jobsGet jobs
JobsApijobs_job_id_external_id_postPOST /labor/v1/jobs/{jobId}/externalIdAdd an external identifier
JobsApijobs_job_id_external_id_putPUT /labor/v1/jobs/{jobId}/externalIdAdd or replace an external identifier
JobsApijobs_job_id_getGET /labor/v1/jobs/{jobId}Get one job
MenuGroupsApimenu_groups_getGET /config/v2/menuGroupsGet menu groups
MenuGroupsApimenu_groups_guid_getGET /config/v2/menuGroups/{guid}Get a menu group
MenuItemsApimenu_items_getGET /config/v2/menuItemsGet menu items
MenuItemsApimenu_items_guid_getGET /config/v2/menuItems/{guid}Get a menu item
MenusV2Apimenus_v2_getGET /menus/v2/menusGet menus (V2)
MenusV2Apimenus_v2_metadata_getGET /menus/v2/metadataGet menu last modified timestamp (V2)
MenusV3Apimenus_v3_getGET /menus/v3/menusGet menus
MenusV3Apimenus_v3_metadata_getGET /menus/v3/metadataGet menu last modified timestamp
NoSaleReasonsApino_sale_reasons_getGET /config/v2/noSaleReasonsGet no sale reasons
NoSaleReasonsApino_sale_reasons_guid_getGET /config/v2/noSaleReasons/{guid}Get a no sale reason
OrdersApiorders_bulk_getGET /orders/v2/ordersBulkGet multiple orders
OrdersApiorders_getGET /orders/v2/ordersGet order identifiers (deprecated)
OrdersApiorders_guid_getGET /orders/v2/orders/{guid}Get an order
OrdersApiorders_order_guid_checks_check_guid_selections_postPOST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/selectionsAdd items to a check
OrdersApiorders_order_guid_delivery_info_patchPATCH /orders/v2/orders/{orderGuid}/deliveryInfoUpdate delivery information
OrdersApiorders_postPOST /orders/v2/ordersPost an order
OrdersApiprices_postPOST /orders/v2/pricesGet order prices
OrdersApivoid_orderPOST /orders/v2/orders/{orderGuid}/voidVoid an order
PaymentsApiorders_checks_payments_postPOST /orders/v2/orders/{orderGuid}/checks/{checkGuid}/paymentsPost payments
PaymentsApiorders_order_guid_checks_check_guid_payments_payment_guid_patchPATCH /orders/v2/orders/{orderGuid}/checks/{checkGuid}/payments/{paymentGuid}Update a tip amount
PaymentsApipayments_getGET /orders/v2/paymentsGet payment identifiers
PaymentsApipayments_guid_getGET /orders/v2/payments/{guid}Get a payment
PayoutReasonsApipayout_reasons_getGET /config/v2/payoutReasonsGet payout reasons
PayoutReasonsApipayout_reasons_guid_getGET /config/v2/payoutReasons/{guid}Get payout reason by GUID
PreModifierGroupsApipre_modifier_groups_getGET /config/v2/preModifierGroupsGet pre modifier groups
PreModifierGroupsApipre_modifier_groups_guid_getGET /config/v2/preModifierGroups/{guid}Get a pre-modifier group
PreModifiersApipre_modifiers_getGET /config/v2/preModifiersGet pre-modifiers
PriceGroupsApiprice_groups_getGET /config/v2/priceGroupsGet price groups
PriceGroupsApiprice_groups_guid_getGET /config/v2/priceGroups/{guid}Get price group by GUID
PrintersApiprinters_getGET /config/v2/printersGet printers
PrintersApiprinters_guid_getGET /config/v2/printers/{guid}Get a printer
RestaurantServicesApirestaurant_services_getGET /config/v2/restaurantServicesGet restaurant services
RestaurantServicesApirestaurant_services_guid_getGET /config/v2/restaurantServices/{guid}Get restaurant service by GUID
RestaurantsApigroups_management_group_guid_restaurants_getGET /restaurants/v1/groups/{managementGroupGUID}/restaurantsGet restaurants in a management group
RestaurantsApirestaurants_restaurant_guid_getGET /restaurants/v1/restaurants/{restaurantGUID}Get restaurant configuration information
RevenueCentersApirevenue_centers_getGET /config/v2/revenueCentersGet revenue centers
RevenueCentersApirevenue_centers_guid_getGET /config/v2/revenueCenters/{guid}Get revenue center by GUID
ServiceAreasApiservice_areas_getGET /config/v2/serviceAreasGet service areas
ServiceAreasApiservice_areas_guid_getGET /config/v2/serviceAreas/{guid}Get service area by GUID
ServiceChargesApiservice_charges_getGET /config/v2/serviceChargesGet service charges
ServiceChargesApiservice_charges_guid_getGET /config/v2/serviceCharges/{guid}Get service charge by GUID
ShiftsApishifts_getGET /labor/v1/shiftsGet shifts
ShiftsApishifts_postPOST /labor/v1/shiftsCreate a shift
ShiftsApishifts_shift_id_deleteDELETE /labor/v1/shifts/{shiftId}Delete a shift
ShiftsApishifts_shift_id_getGET /labor/v1/shifts/{shiftId}Get a shift
ShiftsApishifts_shift_id_putPUT /labor/v1/shifts/{shiftId}Update a shift
TablesApitables_getGET /config/v2/tablesGet tables
TablesApitables_guid_getGET /config/v2/tables/{guid}Get a table
TaxRatesApitax_rates_getGET /config/v2/taxRatesGet tax rates
TaxRatesApitax_rates_guid_getGET /config/v2/taxRates/{guid}Get tax rate by GUID
TimeEntriesApitime_entries_getGET /labor/v1/timeEntriesGet time entries
TimeEntriesApitime_entries_time_entry_id_getGET /labor/v1/timeEntries/{timeEntryId}Get one time entry
TipWithholdingApitip_withholding_getGET /config/v2/tipWithholdingGet tip withholding configuration
VoidReasonsApivoid_reasons_getGET /config/v2/voidReasonsGet void reasons
VoidReasonsApivoid_reasons_guid_getGET /config/v2/voidReasons/{guid}Get void reason by GUID

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

Keywords

OpenAPI

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts