Sync Restaurant Product Details With Loyalty Management
After you map the restaurant’s product details with Loyalty Management, it’s important to ensure that the details are synced at regular intervals. Sync your restaurant’s menu details with Loyalty Management either in real time by using REST APIs or at specific intervals through File Transfer Protocol (FTP) to ensure that members get the latest product details when they use the Point of Sale (POS) system at restaurants.
- Choose how you want to sync product details.
- To sync through REST APIs, use the Scheduler mule component and implement a scheduler in the flow source. You can trigger a flow at specified intervals based on a fixed frequency or an interval based on the cron expression. See Scheduler Endpoint (Trigger).
- To sync through FTP, use the On New or Updated file connector as the source in the Mule flow. This connector triggers the integration flow when product details are added to a new or an existing file. See Trigger a Flow for a Newly Created or Updated File.
To maintain new and existing files seamlessly, create these folders to store your files for FTP. - Input: Contains the ready to be processed files. - Processed: Contains the successfully processed files. - Error: Contains the files that can’t be processed.
- Retrieve the last updated timestamp from the object store in MuleSoft. This value is null if you’re retrieving the values for the first time.
- Call the API to retrieve products based on the retrieved timestamp from the object store.
- Map the retrieved product details to the desired format for Salesforce by using predefined mappings.
- Use the Salesforce Composite API to sync the data to respective objects.
- After the sync is successful, update the value of the last updated timestamp in the object store. If the sync fails, move the failed records to
{namespace}_LoyaltyOrderPlacementError_c
object.