openapi: 3.2.0 info: title: Analytics Guest API description: "The analytics API provides an enterprise reporting and analytics service, \nand includes operations that retrieve information for all restaurants, or a\nsubset of restaurants, in a management group, create requests for reporting data, \nand retrieve the reporting data.\n\nThe types of reporting data include:\n* Aggregated sales reporting data covering sales and labor information.\n* Check reporting data providing information for each check.\n* Labor reporting data providing information for employees and jobs that are paid hourly.\n* Menu reporting data providing information for menu entities as they relate to sales.\n* Payout reporting data providing information for payouts organized either by settled date, payments, or sales date.\n* Guest reporting data providing information for guest's payment cards organized by payments.\n" version: 1.0.0 contact: name: Toast developer support servers: - url: https://toast-api-server/era/v1 tags: - name: Guest description: The analytics API endpoint for guest reporting data organized by payment. paths: /guest/payments/{timeRange}: post: summary: Post a guest reporting data request organized by payment for a specific time range description: "Creates a guest reporting data organized by payment request for a specific time range.\n\nSpecify the time range with the `timeRange` path parameter.\n\nSpecify whether to include data from inactive restaurants using the `onlyInactiveRestaurants` query parameter.\n\nSpecify the `startDate` and `endDate` for the guest data in the message body.\n\nInclude information about which restaurants to include or exclude with the \n`restaurantIds` and `excludedRestaurantIds` properties.\n" operationId: postGuestReportPaymentDateSpecificTimeRange parameters: - name: timeRange description: 'The specific time range that you are requesting reporting data for. Valid values: * `day` - The request covers a one day time range. * `week` - The request covers a time range of seven days or fewer. ' in: path required: true schema: type: string enum: - day - week - name: onlyInactiveRestaurants description: "Specifies whether the data is for inactive restaurants only. Active restaurant data is \nreturned by default.\n\nValid values:\n\n* `true` - The data retrieved is for inactive restaurants only.\n\n* `false` - The data retrieved is for active restaurants only.\n" in: query required: false schema: type: boolean requestBody: content: application/json: schema: $ref: '#/components/schemas/GuestPaymentsReportingDataRequest' description: 'A JSON object containing the starting and ending dates for the reporting data request and included or excluded restaurants. ' required: true responses: '200': description: The `reportRequestGuid` used to retrieve the reporting data. content: application/json: schema: $ref: '#/components/schemas/ReportRequestGuid' '400': description: The request contains invalid information. content: application/json: schema: $ref: '#/components/schemas/ErrorMessage' '500': description: 'An unexpected internal error occurred. The `requestId` attached to this error can be referenced by the Toast support team. ' security: - oauth2: - enterprise-metrics:read tags: - Guest /guest/payments/{reportRequestGuid}: get: summary: Get the guest reporting data organized by payment description: 'Returns the guest data organized by payment for the reporting data request. Specify the `reportRequestGuid` for the reporting data. ' operationId: getGuestByPaymentDateReportingData parameters: - name: reportRequestGuid description: The Toast platform identifier for the reporting data request. in: path required: true schema: type: string responses: '200': description: The reporting data. content: application/json: schema: $ref: '#/components/schemas/GuestPaymentsReportingData' '202': description: The Toast platform is in the process of gathering the reporting data. Try the request again at a later time. content: application/json: schema: $ref: '#/components/schemas/ReportingDataInProgress' '404': description: An unexpected error occurred. Refer to the `message` attached to this error for more information. content: application/json: schema: $ref: '#/components/schemas/ErrorMessage' '409': description: The Toast platform was unable to process the request. Request a new `reportRequestGuid` and try again. '500': description: 'An unexpected internal error occurred. The `requestId` attached to this error can be referenced by the Toast support team. ' '504': description: The Toast platform was unable to process the request because internal services took too long to process, resulting in a timeout. security: - oauth2: - enterprise-metrics:read tags: - Guest components: schemas: ReportRequestGuid: description: The Toast platform assigned identifier used to identify a specific analytics reporting data request. format: UUID type: string ErrorMessage: type: object description: Information about an unsuccessful REST request. properties: status: description: The HTTP status code. format: integer type: number code: description: The service-specific result code. format: integer type: number message: description: A brief message describing the error. type: string messageKey: description: Reserved for future use. type: string fieldName: description: Reserved for future use. type: string link: description: The URL of a Toast page that provides more information about the error. format: URL type: string requestId: description: The identifier of the HTTP request that generated the error. format: UUID type: string developerMessage: description: Optional, technical information to help a developer investigate the cause of the error. type: string errors: description: A list of JSON `ErrorMessage` objects. items: type: string type: array canRetry: description: Reserved for future use. type: string ReportingDataInProgress: description: The Toast platform is in the process of gathering the reporting data. Try the request again at a later time. type: object properties: message: description: A brief message describing that the reporting data is still in progress and to try again at a later time. format: string type: string reportStatus: description: Reflects the in progress status of the reporting data using the IN_PROGRESS value. format: text type: string reportRequestGuid: description: The Toast platform assigned identifier used to identify a specific analytics reporting data request. format: UUID type: string GuestPaymentsReportingDataRequest: description: "Information about what the guest data organized by payment covers and how it is presented. This includes \nthe starting and ending dates of the time range and the included or excluded restaurants.\n" type: object properties: startDate: description: 'The starting date of the time range for the reporting data. Specify the date in the format YYYYMMDD. For example, `20220824`. ' format: integer type: number endDate: description: 'The ending date of the time range for the reporting data. Specify the date in the format YYYYMMDD. For example, `20220824`. ' format: integer type: number restaurantIds: description: "The `restaurantGuid` values of specific restaurants in the management group to include in the \nreporting data. If used, only the data for listed restaurants in the management group \nthat are identified by `restaurantGuid` is included. If left blank, all restaurants are included \nby default.\n" items: format: uuid type: string type: array excludedRestaurantIds: description: "The `restaurantGuid` values of specific restaurants in the management group to exclude from the \nreporting data. If used, the data for listed restaurants in the management group \nthat are identified by `restaurantGuid` is excluded. If left blank, all restaurants are included \nby default.\n" items: format: UUID type: string type: array required: - restaurantIds - excludedRestaurantIds - startDate - endDate GuestPaymentsReportingData: description: The guest reporting data organized by payment. type: object properties: restaurantGuid: description: 'The identifier assigned by the Toast platform used to identify a restaurant location. ' format: UUID type: string restaurantName: description: 'The restaurant’s name. ' format: string type: string restaurantLocationName: description: 'The restaurant’s location name. ' format: string type: string restaurantLocationCode: description: 'The restaurant’s location code. ' format: string type: string paymentDate: description: 'The date when the payment was processed. ' format: integer type: string orderGuid: description: 'The identifier assigned by the Toast platform used to identify an order. ' format: UUID type: string paymentGuid: description: 'The identifier assigned by the Toast platform used to identify the payment. ' format: UUID type: string cardFingerprint: description: 'The identifier assigned by the Toast platform used to identify a guest''s payment card. ' format: UUID type: string cardLast4Digits: description: 'The last four digits of the guest''s payment card. ' type: - string - 'null' cardType: description: 'The brand or network of the guest''s payment card. Example values: * `VISA` * `MASTERCARD` * `AMERICAN_EXPRESS` * `DISCOVER` ' type: - string - 'null' paymentAccountReference: description: 'The Payment Account Reference (PAR) assigned by the card network to identify the underlying card account across different payment tokens and processors. PAR is a 29-character alphanumeric identifier that is independent of the payment facilitator or gateway, making it suitable for linking Toast-processed payments with non-Toast payments (e.g. Olo) for the same cardholder. Currently only available for payment processing companies that support PAR (Worldpay and Chase). Returns `null` for payments processed by a payment processing company that does not support PAR, or for payments processed before PAR data collection was enabled. PAR data is only available for payments processed after July 30, 2026. ' type: - string - 'null' example: VI01Z28RKA1EBL470G9XYG90R5D3E securitySchemes: oauth2: description: "Access to Toast APIs, specific endpoints, \nand specific API endpoint operations is \ncontrolled by the scopes that are associated \nwith your API account. \n\nA full reference for Toast API scopes and \ntheir capabilities can be found in the\n[_Toast Developer Guide_](https://doc.toasttab.com/doc/devguide/apiScopes.html).\n" type: oauth2 flows: clientCredentials: tokenUrl: https://toast-api-server/authentication/v1/authentication/login scopes: enterprise-metrics:read: 'Allows reading from the analytics API. ' x-components: {}