Orders: Sample Use Case & Flow

This article shares a possible use case you could support, as well as a sample flow that could support the use case. This can be a helpful jumping off point as you plan your implementation.

Send an email on successful payment of online orders

You can create an implementation that sends a Wix Inbox confirmation email to customers that a payment was successful.

To listen for successful payments and send a confirmation email to the customer, follow this flow:

  1. Listen to the Payment Event.
  2. When the event is triggered, check for a wixAppId of 1522827f-c56c-a5c9-2ac9-00f9e6ae12d3 (the Wix App ID for Pricing Plans) and extract the wixAppOrderId.
  3. Call Get Order using the wixAppOrderId as the id for the order to retrieve.
  4. Extract the order.buyer.memberId to retrieve the buyer's memberId.
  5. Call Get Member with the memberId and extract the member's loginEmail.
  6. Call Query Email Subscriptions and filter by the email address to confirm that the member has agreed to receive emails from the Wix user.
  7. Call Get or Create Conversation and Send Message to send an email to the buyer.
Did this help?