> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Example Flows

## Article: Example Flows

## Article Link: https://dev.wix.com/docs/api-reference/business-solutions/pricing-plans/orders/example-flows.md

## Article Content:

# 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](https://support.wix.com/en/article/wix-inbox-an-overview) 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](https://dev.wix.com/docs/rest/business-management/payments/cashier/cashier-pay/payment-event/payment.md).
1. 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`.
1. Call [Get Order](https://dev.wix.com/docs/rest/business-solutions/pricing-plans/pricing-plans/orders/member-orders-service-get-order.md) using the `wixAppOrderId` as the `id` for the order to retrieve.
1. Extract the `order.buyer.memberId` to retrieve the buyer's `memberId`.
1. Call [Get Member](https://dev.wix.com/docs/api-reference/crm/members-contacts/members/member-management/members/get-member.md) with the `memberId` and extract the member's `loginEmail`.
1. Call [Query Email Subscriptions](https://dev.wix.com/docs/api-reference/crm/communication/email-subscriptions/query-email-subscriptions.md) and filter by the email address to confirm that the member has agreed to receive emails from the Wix user.
1. Use [Get or Create Conversation](https://dev.wix.com/docs/api-reference/crm/communication/inbox/conversations/get-or-create-conversation.md) and [Send Message](https://dev.wix.com/docs/api-reference/crm/communication/inbox/messages/send-message.md) to send an email to the buyer.