Integrate Virto orders with external systems via Logic Apps

Suppose, you have a scenario like this:

Each new order in Virto Commerce should be sent to a logistics company using its REST API. Instead of scheduled execution every X minutes, the customer would prefer to have more control over this process. One option could be initiating the synchronization right after the checkout process is completed.

Or, could a grace period be added? So that a customer could change/cancel the order.

The solution

Straightforward to implement in a custom module and Azure Logic Apps:

  1. Create a Logic App for getting the order from Virto Commerce, transforming and sending it to external API;
  2. Create custom Virto Commerce module:
    1. Create Order event handler, subscribe to Order events, and filter the orders with status “New”;
    2. Make an HTTP request to trigger the Logic App;
    3. The (optional) grace period step: create a background job to make the HTTP request after X min. delay, if order wasn’t canceled;
  3. Logic App gets the order by Id and processes it.
    • the Logic App could add the processing info, if any. Or just change status to “Processed”.

Also, check our samples.

1 Like