> For the complete documentation index, see [llms.txt](https://docs.ownchat.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ownchat.app/work-flows/whatsapp-payment/payment-paid.md).

# Payment Paid

{% embed url="<https://app.supademo.com/demo/cmmga7tf359vcnr99ezuey367?utm_source=link>" %}

This workflow allows businesses to automate actions when a **payment is successfully completed** through a payment gateway such as **Razorpay, Petpooja, or other connected payment services.**

When a payment is marked as **Paid**, the workflow triggers automation in **Ownchat Flow Builder**, allowing businesses to:

* Update order status
* Trigger WhatsApp commerce notifications
* Automate payment confirmation workflows

### Overview &#x20;

The **Payment Paid workflow** is triggered when the payment gateway sends the **payment.paid event.**

The workflow processes the payment response and updates the corresponding order status in the system.

#### Workflow Automation Flow &#x20;

Payment Gateway\
&#x20;     ↓\
Payment Paid Event Triggered\
&#x20;     ↓\
Ownchat Receives Event\
&#x20;     ↓\
Workflow Triggered\
&#x20;     ↓\
Order Status Updated\
&#x20;     ↓\
WhatsApp Commerce Notification Sent

### Accessing Workflow Builder &#x20;

#### Step 1: Open Workflows &#x20;

1. Log in to **Ownchat**.
2. Navigate to the **Workflows** section from the dashboard.
3. Use the **search bar** if needed to locate specific workflows.

You will see existing workflows such as:

* Send Invoice
* Send Status Petpooja
* WhatsApp Payment Configurations
* Shopify Order Paid

### Configuring WhatsApp Payment Settings &#x20;

Before creating the workflow, configure the payment settings.

#### Step 1: Open Payment Configurations &#x20;

1. Navigate to **Commerce**.
2. Select **Payments**.
3. Click **Payment Links**.

#### Step 2: Select WhatsApp Payment Configurations &#x20;

1. Click **WhatsApp – Payment Configurations**.

This section allows configuration of payment-related events and integrations.

### Viewing Payment Events &#x20;

Inside the configuration screen you will see:

* Connection Name
* Available Events
* Subscribed Events

#### Step 1: View Available Events &#x20;

1. Locate the **Available Events** column.
2. Click the **Available Events number.**

This will open the list of events available for the payment integration.

### Subscribing to Payment Event &#x20;

You must subscribe to the **Payment Paid event**.

#### Event &#x20;

Payment Paid

#### Event Description &#x20;

Triggered when the payment is successfully completed.

Once subscribed, the system will send this event to **Ownchat workflows.**

### Creating a New Workflow &#x20;

#### Step 1: Open Workflow Builder &#x20;

1. Navigate to **Workflows**.
2. Click **Create New Flow**.

This opens the **Create New Workflow** screen.

### Creating the Workflow &#x20;

Two options are available:

* **Build from Scratch**
* **Use a Template**

#### Step 1: Select Build from Scratch &#x20;

Choose:

Build from Scratch

This allows you to configure custom automation logic.

#### Step 2: Enter Flow Details &#x20;

Enter the workflow information.

**Flow Name**&#x20;

Example:

Payment Paid

**Description** &#x20;

Provide a description for the workflow.

#### Step 3: Create Workflow &#x20;

Click:

Create

The workflow canvas will open.

### Selecting the Application &#x20;

After creating the workflow, configure the application that sends the payment event.

#### Step 1: Choose App &#x20;

Click **Choose App**.

Available applications include:

* WooCommerce
* Stripe
* Petpooja
* Razorpay
* Shopify
* Webhook
* Zoho Subscriptions
* Zoho Bookings
* Calendly
* Google Sheets
* MoEngage

### Configuring the Payment Integration &#x20;

#### Step 1: Select the Connection &#x20;

Choose the connected payment account.

Example:

Connection: Test

#### Step 2: Select Event &#x20;

Choose the event from the dropdown.

payment.paid

This event is triggered when the payment is successfully completed.

### Adding Response Variable &#x20;

Store the response received from the payment gateway.

#### Variable Name &#x20;

response

This variable stores payment event data received from the payment provider.

### Step 3: Update Configuration &#x20;

Click:

Update

This saves the trigger configuration.

### Workflow Trigger Node &#x20;

Once configured, the workflow will display the trigger node.

**Trigger** &#x20;

payment.paid

This indicates the workflow starts when the **payment.paid event** is received.

### **Adding Next Action** &#x20;

After the trigger is configured, you can add the next action.

Click:

Add Node

This allows adding conditions or actions.

### Configuring Actions &#x20;

Actions define what happens after the payment is completed.

### Update Order Status Action &#x20;

Add the **Update Order Status** action.

This action updates the order status after the payment is successfully completed.

#### Step 1: Configure Action Name &#x20;

Example:

Order Status for Payment

#### Step 2: Set Order Status &#x20;

Select the appropriate order status.

Example statuses may include:

* Processing
* Paid
* Confirmed

#### Step 3: Configure Payment Status &#x20;

Set the payment status.

Example:

Paid

### Adding Order ID Variable &#x20;

The system needs the **Order ID** to update the order.

#### Step 1: Add Variable &#x20;

Click:

Add Variable

Select the order ID from the payment response.

Example:

response.order\_id

This allows the workflow to dynamically update the correct order.

### Sending Session Message for Successful Payment &#x20;

If the payment status is **Success**, configure a session message to notify the customer.

#### **Steps** &#x20;

1. Enter the session message text:

Payment received

2. Enter the **Customer Contact Number.**

#### Adding Customer Phone Number Variable &#x20;

1. Click **Add Variable.**
2. Select the **Phone Number variable.**
3. Insert it into the **Customer Contact Number field.**

#### Adding Customer Name Variable &#x20;

1. Click **Add Variable.**
2. Select the **Customer Name variable**.
3. Insert it into the **Customer Name field.**

#### Configure Message Text &#x20;

Enter the message content in the **message field**.

Example:

Hi {{customer\_name}}, your payment has been successfully received. Thank you for your purchase.

#### Save the Action &#x20;

Click:

Add Action

This saves the session message configuration.

### Adding Session Message for Failed Payment &#x20;

If the payment fails, configure a message to notify the customer.

Steps &#x20;

1. Search for **Session Message** in the search bar.
2. Select **Session Message** action.

#### Configure Action &#x20;

**Action Name**&#x20;

Enter a descriptive name for the action.

Example:

Payment Failed Notification

**Customer Contact Number** &#x20;

1. Click **Add Variable.**
2. Insert the **customer phone number variable.**

**Customer Name** &#x20;

Enter the **customer name variable.**

**Message Text** &#x20;

Enter the message text.

Example:

Hi {{customer\_name}}, unfortunately your payment was not successful. Please try again or contact support.

**Save Action** &#x20;

Click:

Add Action

This completes the failed payment message configuration.

**Searching for Actions**&#x20;

To quickly add actions:

1. Use the **search bar.**
2. Enter the node or action name.
3. Select from the filtered results.

#### Workflow Activation &#x20;

After closing the configuration screen and returning to the workflow list:

The workflow appears in an **Active state**.

### Checking the Workflow &#x20;

Before publishing the workflow, verify the flow configuration.

#### Flow Builder Sections &#x20;

The workflow builder includes:

* Summary
* Flow Builder
* History

These sections help review workflow changes.

### Publishing the Workflow &#x20;

After completing configuration:

Click:

Publish

Example workflow status:

Payment Paid – Published

The workflow will now run automatically whenever the **payment.paid event** is triggered.

### Testing the Workflow &#x20;

Before using the workflow in production, test the automation.

#### Steps &#x20;

1. Create a **test payment.**
2. Complete the payment successfully.
3. Confirm that:

* The **payment.paid event triggers**
* The **workflow runs**
* The **order status updates**

### Troubleshooting &#x20;

#### Workflow Not Triggering &#x20;

Possible reasons:

* Payment event not subscribed
* Integration not connected
* Incorrect event selected

#### Order Status Not Updating &#x20;

Check:

* Order ID variable configuration
* Payment response variable mapping
* Action configuration

### Best Practices &#x20;

#### Always Use Response Variables &#x20;

Store payment data in variables such as:

response

This helps dynamically map order data.

#### Verify Payment Events &#x20;

Ensure the correct event is selected:

payment.paid

#### Test Before Publishing &#x20;

Run test payments before activating the workflow.

### Summary &#x20;

The **WhatsApp Payment – Payment Paid workflow** allows Ownchat to automatically process completed payments and update order status.

The automation works as follows:

1. Payment gateway sends **payment.paid event**
2. Ownchat workflow is triggered
3. Payment response is stored in a variable
4. Order status is updated automatically
5. WhatsApp commerce notifications can be triggered

This automation ensures efficient **payment tracking and order management.**
