How to Integrate your POS System with Eat App

Eat App's POS system, and how easy it is to integrate

Here's how our API works: 
 
Any time a ticket is updated, opened or closed you can send us a POST request with the ticket details via our API. Here is a step by step instructions on how to use our API... Documented on this page
 
To send POS tickets via the API, follow these step-by-step instructions:

Step 1: Prepare Your Environment
Ensure you have access to the necessary authentication credentials, specifically an API key (Bearer token), which is required for making requests to the API. Please email joseph@eatapp.co to get access to an API Key for your POS provider

Step 2: Set Up the HTTP Request
You will need to send HTTP POST requests to the API endpoint for creating or updating POS tickets. Use the following endpoint:
https://api.eat-sandbox.co/services/pos/v2/webhooks
 
Step 3: Include Required Headers
Include the following headers in your HTTP request:

Content-Type: application/json
Authorization: Bearer
Replace with your actual Bearer token provided by Eat.
 
Step 4: Construct the JSON Payload
The JSON payload should contain the complete details of the POS ticket. Here’s an example structure of what the payload might look like:

{
  "id": "unique_webhook_id",
  "event_id": "event_specific_id",
  "retries": 0,
  "data_type": "ticket",
  "action": "create",
  "detected_at": 1542793600,
  "triggered_at": 1542793706,
  "version": "2.0",
  "location": {
    "id": "location_id",
    "name": "location_name"
  },
  "ticket": {
    "id": "ticket_id",
    "number": "ticket_number",
    "void": false,
    "open": true,
    "opened_at": 1535548784,
    "closed_at": 1535549384,
    "table": {
      "id": "table_id",
      "number": "table_number"
    },
    "commercial": {
      "guest_count": 4,
      "payment_type": "credit_card",
      "items": 100.00,
      "service_charges_total": 10.00,
      "tax_total": 5.00,
      "total": 115.00
    },
    // Include additional details as necessary...
  }
}

Step 5: Send the Request
Use a tool like cURL, Postman, or your preferred HTTP client to send the POST request with the prepared headers and JSON payload.

Step 6: Handle Responses
Check the response from the server:

200 OK: Indicates that the ticket was successfully processed.
4xx and 5xx: Handle errors according to the error codes provided (e.g., 401 for Unauthorized, 500 for Internal Server Error).
Step 7: Error Handling
Implement appropriate error handling based on the API’s error codes and messages. For example, handle re-authentication if a token expires and consider implementing retries for specific status codes.

Step 8: Rate Limiting
Be aware of the API's rate limit, which is 300 requests per minute. If exceeded, you must handle 429 status codes by waiting and retrying after the lockout period.

This should set you up for integrating with the POS API to create or update tickets in the Eat App table management system, and affiliated guest spend against reservations.