### Install Dependencies and Run Dev Server Source: https://dev.joinposter.com/docs/v3/pos/start Installs project dependencies using npm and starts the development server. Assumes Node.js and npm are installed. ```bash npm install npm run dev ``` -------------------------------- ### Poster API Request Examples (JavaScript & PHP) Source: https://dev.joinposter.com/docs/v3/start/request Demonstrates how to send POST and GET requests to the Poster API. Includes a JavaScript example for updating a product and a PHP function for generic request handling, showcasing GET requests for client groups. ```javascript https://joinposter.com/api/menu.updateProduct?token=687409:4164553abf6a031302898da7800b59fb { "id": 142, "product_name": "Пончик", "menu_category_id": 0, "workshop": 1, "weight_flag": 0, "color": "red", "different_spots_prices": 0, "modifications": 0, "cost": 2000, "price": 3000, "visible": 1, "fiscal_code": 1234567890 } ``` ```php ``` ```json url = https://joinposter.com/api/access.getEmployees ?token=687409:4164553abf6a031302898da7800b59fb; ``` -------------------------------- ### Device Discovery HTTP GET Request Example Source: https://dev.joinposter.com/docs/v3/device/start Illustrates the HTTP GET request format used for device discovery within the local network. The response from the device should adhere to specific status codes (200 or 404 with JSON/tag) for successful integration. ```HTTP GET _192.168.1.123:2224_ ``` -------------------------------- ### Get Application Info - PHP Source: https://dev.joinposter.com/docs/v3/web/application/getInfo Example of how to retrieve application information using a GET request in PHP. This snippet demonstrates constructing the URL and sending the request. ```php ``` -------------------------------- ### Poster API: Get Client Groups Request Examples Source: https://dev.joinposter.com/docs/v3/web/clients/getGroups Demonstrates how to construct the API request to fetch client groups using JavaScript and PHP. Both examples include the base URL and a placeholder for the API token. ```javascript const url = 'https://joinposter.com/api/clients.getGroups ?token=687409:4164553abf6a031302898da7800b59fb' ``` ```php ``` -------------------------------- ### Device Integration Setup Source: https://dev.joinposter.com/docs/v3/device/start_id=%D0%9D%D0%B0%D1%87%D0%B0%D0%BB%D0%BE-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B Instructions for enabling and setting up device integration within the JoinPoster application settings. ```APIDOC ## Setup Guide ### Enable POS and Device Platforms To work with devices, enable the **POS platform** and **Device platform** toggles in your application's settings. ### Connect Device at the Register To test the **Device platform**, you need to open the register on an iOS, Android, or Desktop application. Device search is performed via Ethernet, so the register and the external device must be on the same local network. To connect your device, go to **Settings → Devices → Other Hardware → Your Application → Connect Device**. ``` -------------------------------- ### Install Dependencies Source: https://dev.joinposter.com/docs/v3/pos/start_id=%D0%9D%D0%B0%D1%87%D0%B0%D0%BB%D0%BE-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B Installs all necessary project dependencies using npm. This command is essential after cloning the repository. ```bash npm install ``` -------------------------------- ### POS Platform Dev/Prod Switcher Source: https://dev.joinposter.com/docs/v3/start/faq_id=%D0%90%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F-%D0%B8-%D0%B4%D0%BE%D1%81%D1%82%D1%83%D0%BF Steps to enable the Dev/Prod switcher for the POS platform. ```APIDOC ## POS Platform Dev/Prod Switcher ### Description To enable the Dev/Prod switcher on your POS cashier: 1. Activate the **POS platform** toggle in your application's settings. 2. In your developer account, add the Poster account (where the switcher is missing) to the list of developers. 3. Connect your integration within the Poster account via the **Poster App Directory**. ``` -------------------------------- ### Get Application Info - JavaScript Source: https://dev.joinposter.com/docs/v3/web/application/getInfo Example of how to retrieve application information using a GET request in JavaScript. Requires a valid API token. ```javascript const url = 'https://joinposter.com/api/application.getInfo ?token=687409:4164553abf6a031302898da7800b59fb'; ``` -------------------------------- ### Get Order Sources (PHP) Source: https://dev.joinposter.com/docs/v3/web/settings/getOrderSources Example of how to fetch order source properties using PHP by making an HTTP GET request to the Poster API. ```php ``` -------------------------------- ### Device Discovery and Connection Source: https://dev.joinposter.com/docs/v3/device/start_id=%D0%9A%D0%B0%D0%BA-%D0%BF%D0%BE%D0%B4%D0%BA%D0%BB%D1%8E%D1%87%D0%B8%D1%82%D1%8C-%D1%83%D1%81%D1%82%D1%80%D0%BE%D0%B9%D1%81%D1%82%D0%B2%D0%BE-%D0%BD%D0%B0-%D0%BA%D0%B0%D1%81%D1%81%D0%B5 This section details how to enable device platform features and connect devices through the POS application or custom integrations. ```APIDOC ## Getting Started To work with devices, enable the **POS platform** and **Device platform** toggles in your application settings. ### How to Connect a Device at the Checkout To test the **Device platform**, you need to open the checkout on an iOS, Android, or Desktop application. Device discovery is performed via Ethernet, so the checkout and the external device must be on the same local network. To connect your device, go to **Settings → Devices → Other Hardware → Your Application → Connect Device**. ### Connecting a Device via Integration Discovery works on a specific port. To specify this port, email us at contact@joinposter.com so we can change it for your application. This can be any port except 2222 and 2223, which are used for our technical needs. The application checks all devices on the local network by sending an HTTP GET request, for example: _192.168.1.123:2224_. To pass the device's IP address to your integration, the response must match one of the following: * Status code 200 * Status code 404 with a tag * Status code 404 with any JSON inside ``` -------------------------------- ### PHP: Get Manual Waste Details Source: https://dev.joinposter.com/docs/v3/web/storage/getWaste Example of making an HTTP GET request to the storage.getWaste API endpoint to retrieve detailed information about a specific manual write-off. Requires a valid API token and the waste_id. ```php ``` -------------------------------- ### OAuth Authorization Setup Source: https://dev.joinposter.com/docs/v3/start/faq Information on setting up OAuth authorization. ```APIDOC ## How to set up OAuth authorization? Watch our webinar with the answer to this question. We also have a detailed text-based guide. ``` -------------------------------- ### Get Specific Product Information Source: https://dev.joinposter.com/docs/v3/market/guidelines/e-commerce Fetches detailed information about a specific product using its ID. This is typically used in conjunction with product webhooks to get updated product details when changes occur in Poster. ```http GET /api/v1/menu/getProduct?product_id={id} ``` -------------------------------- ### Device Discovery via HTTP GET Request Source: https://dev.joinposter.com/docs/v3/device/start_id=%D0%9D%D0%B0%D1%87%D0%B0%D0%BB%D0%BE-%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D1%8B Demonstrates how the JoinPoster application discovers devices on the local network by sending an HTTP GET request to a device's IP address and port. The response from the device must conform to specific status codes (200 or 404 with JSON) for successful integration. ```HTTP GET 192.168.1.123:2224 ``` -------------------------------- ### JSON: Example Response for menu.getProduct (Product) Source: https://dev.joinposter.com/docs/v3/web/menu/getProduct An example JSON response structure for the menu.getProduct API call when requesting product properties. It includes details like name, price, category, and spots. ```json { "response":{ "barcode":"", "category_name":"Свежевыжатые соки", "unit":"", "cost":"1880", "cost_netto":"1567", "fiscal":"0", "hidden":"0", "menu_category_id":"16", "workshop":"4", "nodiscount":"0", "photo":"/upload/4/menu/product_1403094607_140.jpg", "product_code":"", "product_id":"140", "product_name":"Апельсиновый", "sort_order":"1", "tax_id":"0", "product_tax_id":"0", "type":"3", "weight_flag":"0", "color":"white", "spots":[ { "spot_id":"1", "price":"40000", "profit":"38120", "profit_netto":"31767", "visible":"1" }, { "spot_id":"2", "price":"40000", "profit":"38120", "profit_netto":"31767", "visible":"1" } ], "sources":[ { "id":"1", "name":"Easy Eats", "price":"18500", "visible":"1" }, { "id":"2", "name":"Sonic Eats", "price":"20500", "visible":"1" } ], "ingredient_id":"10", "cooking_time": "1201", "fiscal_code": "1234567890", "out":"0" } } ``` -------------------------------- ### POS Platform Integration Setup Source: https://dev.joinposter.com/docs/v3/start/faq_id=_14-%D0%A1%D0%BA%D0%BE%D0%BB%D1%8C%D0%BA%D0%BE-%D0%B2%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%B8-%D0%B2%D0%B0%D0%BB%D0%B8%D0%B4%D0%B5%D0%BD-%D1%82%D0%BE%D0%BA%D0%B5%D0%BD Integrate your application into a Poster account via the 'Poster App Catalog' after enabling the POS platform features and whitelisting the account. ```APIDOC ## POS Platform Integration ### Description Connecting your application to a Poster account for POS platform functionality. ### Integration Method Connect your integration through the **Poster App Catalog** within the Poster account. ``` -------------------------------- ### Create Employee Request Examples (JavaScript, PHP) Source: https://dev.joinposter.com/docs/v3/web/access/createEmployee_id=http-post-%D0%B7%D0%B0%D0%BF%D1%80%D0%BE%D1%81 Demonstrates how to create a new employee using the access.createEmployee API endpoint in JavaScript and PHP. It includes sample request data and the API endpoint URL with a token. ```javascript const url = 'https://joinposter.com/api/access.createEmployee ?token=687409:4164553abf6a031302898da7800b59fb'; const employee = { name: 'Олена Гончаренко', user_type: 2, pos_pass: '', login: 'heleh.gonchar@test.com', pass: 'aZntaeVP9h', }; ``` ```php 'Елена Гончаренко', 'user_type' => 2, 'pos_pass' => '', 'login' => 'heleh.gonchar@test.com', 'pass' => 'aZntaeVP9h', ]; $data = sendRequest($url, 'post', $employee); ?> ``` -------------------------------- ### Get Warehouse Properties (PHP) Source: https://dev.joinposter.com/docs/v3/web/storage/getStorage Example of how to fetch warehouse properties using the Poster API. It demonstrates constructing the GET request URL with necessary parameters like token and storage_id, and includes a placeholder for sending the request. ```php ``` -------------------------------- ### POS Platform Dev/Prod Switcher Source: https://dev.joinposter.com/docs/v3/start/faq_id=_12-%D0%9A%D0%B0%D0%BA-%D0%B8-%D0%B3%D0%B4%D0%B5-%D1%8F-%D0%BC%D0%BE%D0%B3%D1%83-%D0%BF%D_346c1e_D0%B5%D0%BB%D1%8C%D0%BD%D0%BE%D0%B5-%D0%BF%D1%80%D0%B8%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5 Troubleshooting steps for when the Dev/Prod switcher is missing on the POS. ```APIDOC ## POS Platform Dev/Prod Switcher ### Description Steps to resolve the issue where the Dev/Prod switcher is not visible on the POS. ### Troubleshooting Steps: 1. **Enable POS Platform:** Ensure the **POS Platform** switch is enabled in your application's settings. 2. **Add Developer Account:** In your developer account, add the Poster account (where the POS is located) to the list of developers who are not seeing the Dev/Prod switcher. 3. **Connect Integration:** Connect your integration within the Poster account via the **Poster App Marketplace**. ### Method N/A (Informational) ### Endpoint N/A ### Parameters None ### Request Example None ### Response None ``` -------------------------------- ### Get All Storages (PHP Example) Source: https://dev.joinposter.com/docs/v3/web/storage/getStorages_id=storagegetstorages-%D0%9F%D0%BE%D0%BB%D1%83%D1%87%D0%B8%D1%82%D1%8C-%D0%B2%D1%81%D0%B5-%D1%81%D0%BA%D0%BB%D0%B0%D0%B4%D1%8B Example of how to make an HTTP GET request to the storage.getStorages endpoint using PHP to retrieve all available storage locations. This code demonstrates constructing the URL with an API token and sending the request. ```php **, this will open the platform settings window. 4. In the platform settings window, switch the application to **Development** mode. ``` -------------------------------- ### JSON: Example Response for menu.getProduct (Recipe/Tech Card) Source: https://dev.joinposter.com/docs/v3/web/menu/getProduct An example JSON response for the menu.getProduct API call when requesting recipe or technical card properties. Includes ingredients, cooking times, and cost details. ```json { "response":{ "barcode":"123456", "category_name":"Коктейли", "unit":"kg", "cost":"444", "cost_netto":"370", "fiscal":"0", "menu_category_id":"39", "workshop":"1", "nodiscount":"0", "photo":"/upload/pos_cdb_4/menu/product_1439375876_175.jpg", "product_code":"", "product_id":"175", "product_name":"Manhattan Jack", "sort_order":"999", "tax_id":"0", "product_tax_id":"0", "type":"2", "weight_flag":"0", "color":"white", "spots":[ { "spot_id":"1", "price":"60000", "profit":"59556", "profit_netto":"49630", "visible":"1" }, { "spot_id":"2", "price":"60000", "profit":"59556", "profit_netto":"49630", "visible":"1" } ], "sources":[ { "id":"1", "name":"Easy Eats", "price":"18500", "visible":"1" }, { "id":"2", "name":"Sonic Eats", "price":"20500", "visible":"1" } ], "ingredient_id":"0", "fiscal_code": "1234567890", "out":97, "product_production_description":"", "ingredients":[ { "structure_id":"52", "ingredient_id":"92", "pr_in_clear":"0", "pr_in_cook":"0", "pr_in_fry":"0", "pr_in_stew":"0", "pr_in_bake":"0", "structure_unit":"l", "structure_type":"1", "structure_brutto":30, "structure_netto":30, "structure_lock":"1", "structure_selfprice":"102", "structure_selfprice_netto":"85", "ingredient_name":"Красный вермут", "ingredient_unit":"l", "ingredient_weight":"0", "ingredients_losses_clear":"0", "ingredients_losses_cook":"0", "ingredients_losses_fry":"0", "ingredients_losses_stew":"0", "ingredients_losses_bake":"0" }, { "structure_id":"53", "ingredient_id":"91", "pr_in_clear":"0", "pr_in_cook":"0", "pr_in_fry":"0", "pr_in_stew":"0", "pr_in_bake":"0", "structure_unit":"l", "structure_type":"1", "structure_brutto":60, "structure_netto":60, "structure_lock":"1", "structure_selfprice":"313", "structure_selfprice_netto":"261", "ingredient_name":"Jack Daniels", "ingredient_unit":"l", "ingredient_weight":"0", "ingredients_losses_clear":"0", "ingredients_losses_cook":"0", "ingredients_losses_fry":"0", "ingredients_losses_stew":"0", "ingredients_losses_bake":"0" } ] } } ``` -------------------------------- ### POS Platform Integration Source: https://dev.joinposter.com/docs/v3/start/faq_id=_23-%D0%9F%D0%BE%D1%87%D0%B5%D0%BC%D1%83-%D1%83-%D0%BC%D0%B5%D0%BD%D1%8F-%D0%BD%D0%B0-%D0_52eb9d_%B5%D1%82-%D0%BF%D0%B5%D1%80%D0%B5%D0%BA%D0%BB%D1%8E%D1%87%D0%B0%D1%82%D0%B5%D0%BB%D1%8F-devprod Details on enabling and utilizing the POS platform features, including developer account setup and application integration. ```APIDOC ## Why don't I have a Dev/Prod switch on my cash register? 1. Enable the **POS platform** switch in your application settings. 2. In your developer account, add the Poster account to the list of developers for which you don't see the Dev/Prod switch on the cash register. 3. Connect your integration in the Poster account through the **Poster App Catalog**. ``` -------------------------------- ### POS Platform Dev/Prod Switcher Source: https://dev.joinposter.com/docs/v3/start/faq_id=_13-%D0%9A%D0%B0%D0%BA-%D0%BD%D0%B0%D1%81%D1%82%D1%80%D0%BE%D0%B8%D1%82%D1%8C-oauth-%D0%B0%D0%B2%D1%82%D0%BE%D1%80%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8E Guidance on enabling the Dev/Prod switcher for the POS platform. ```APIDOC ## POS Platform Dev/Prod Switcher ### Description To enable the Dev/Prod switcher on your POS, follow these steps: 1. Enable the **POS platform** switch in your application's settings. 2. In your developer account, add the Poster account where you are not seeing the Dev/Prod switcher to the list of developers. 3. Connect your integration in the Poster account via the **Poster App Catalog**. ### Method N/A ### Endpoint N/A ### Parameters None ### Request Example None ### Response None ``` -------------------------------- ### Poster API: Get Ingredients Response Example (JSON) Source: https://dev.joinposter.com/docs/v3/web/menu/getIngredients Provides an example of the JSON response received when calling the menu.getIngredients API method. It outlines the structure of the ingredient data, including IDs, names, stock levels, and units. ```json { "response":[ { "ingredient_id":"91", "ingredient_name":"Jack Daniels", "ingredient_barcode": "", "category_id":"3", "ingredient_left":"443.45000", "limit_value":"0", "time_notif":"0", "ingredient_unit":"l", "ingredient_weight":0, "ingredients_losses_clear":"0", "ingredients_losses_cook":"0", "ingredients_losses_fry":"0", "ingredients_losses_stew":"0", "ingredients_losses_bake":"0", "ingredients_type":"1", "partial_write_off":"0" }, { "ingredient_id":"73", "ingredient_name":"Авокадо", "ingredient_barcode": "", "category_id":"0", "ingredient_left":"22.00000", "limit_value":"0", "time_notif":"0", "ingredient_unit":"kg", "ingredient_weight":0, "ingredients_losses_clear":"11", "ingredients_losses_cook":"0", "ingredients_losses_fry":"0", "ingredients_losses_stew":"0", "ingredients_losses_bake":"0", "ingredients_type":"1", "partial_write_off":"0" }, { "ingredient_id":"74", "ingredient_name":"Айсберг с-т", "ingredient_barcode": "", "category_id":"0", "ingredient_left":"379.09000", "limit_value":"0", "time_notif":"0", "ingredient_unit":"kg", "ingredient_weight":0, "ingredients_losses_clear":"10", "ingredients_losses_cook":"0", "ingredients_losses_fry":"0", "ingredients_losses_stew":"0", "ingredients_losses_bake":"0", "ingredients_type":"1", "partial_write_off":"0" } ] } ``` -------------------------------- ### OAuth Authorization Source: https://dev.joinposter.com/docs/v3/start/faq_id=_14-%D0%A1%D0%BA%D0%BE%D0%BB%D1%8C%D0%BA%D0%BE-%D0%B2%D1%80%D0%B5%D0%BC%D0%B5%D0%BD%D0%B8-%D0%B2%D0%B0%D0%BB%D0%B8%D0%B4%D0%B5%D0%BD-%D1%82%D0%BE%D0%BA%D0%B5%D0%BD Detailed instructions and a webinar are available for setting up OAuth authorization to obtain tokens from multiple clients. ```APIDOC ## OAuth Authorization Setup ### Description Guide to setting up OAuth authorization for obtaining tokens from multiple clients. ### Method N/A (Refer to external resources) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response N/A ### Additional Information Refer to the provided webinar and detailed text instructions for setup. ``` -------------------------------- ### Get Clients List (PHP) Source: https://dev.joinposter.com/docs/v3/web/clients/getClients Example of how to fetch a list of clients using the Poster API in PHP. It constructs the URL with necessary parameters like token, num, and offset, and uses a sendRequest function to get the data. ```php