# Send Invoice Automation

The **Send Invoice automation** allows restaurants using **Petpooja POS** to automatically send invoices to customers via **WhatsApp using Ownchat.**

When a bill is generated in the POS system, the invoice event is triggered and a workflow sends the invoice details directly to the customer.

This automation helps businesses:

* Send invoices instantly
* Reduce manual work
* Improve customer experience
* Collect customer feedback automatically

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

### Overview &#x20;

The **Send Invoice workflow** connects **Petpooja POS billing events** with **Ownchat Flow Builder automation.**

#### Automation Flow &#x20;

Petpooja POS\
&#x20;     ↓\
Invoice Generated\
&#x20;     ↓\
Event Sent to Ownchat\
&#x20;     ↓\
Workflow Triggered\
&#x20;     ↓\
Phone Number Validation\
&#x20;     ↓\
Invoice Sent via WhatsApp\
&#x20;     ↓\
Customer Feedback Request\
&#x20;     ↓\
Feedback Evaluation

### Prerequisites &#x20;

Before configuring the workflow, ensure the following requirements are met.

#### Required Access &#x20;

You must have access to:

* Ownchat account
* Flow Builder
* Integrations module
* Petpooja POS integration

#### POS Requirements &#x20;

The POS system must capture:

* Customer phone number
* Order details
* Invoice data

Without the customer phone number, the invoice message cannot be delivered.

### Accessing Petpooja POS Integration &#x20;

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

1. Log in to **Ownchat**.
2. Navigate to the **left sidebar**.
3. Click **Integrations**.

#### Step 2: Select POS Integration &#x20;

1. Locate **Restaurant Billing & POS Software.**
2. Click the **Petpooja POS application card.**

This opens the **Application Details page.**

### Viewing Available Events &#x20;

Petpooja sends multiple events to Ownchat.

#### Steps &#x20;

1. Click the **Petpooja POS App Card**.
2. Click **Available Events Count**.
3. View the list of available POS events.

Example events:

* Invoice Created
* Order Created
* Order Updated
* Customer Added

### Subscribing to the Invoice Event &#x20;

To enable invoice automation, you must subscribe to the **Invoice Created event.**

Steps &#x20;

1. Locate **Invoice Created Event**.
2. Click **Subscribe**.

If the event is not subscribed:

* Click the **Subscribe button once**
* The event becomes active

Once subscribed, Petpooja will start sending invoice data to Ownchat.

### Creating the Workflow &#x20;

#### Open Flow Builder &#x20;

1. Navigate to **Flow Builder.**
2. Click **Create Workflow.**

The **Create New Workflow** window will appear.

### Build Workflow from Scratch &#x20;

Two options are available:

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

#### Steps &#x20;

1. Select Build from Scratch.
2. Click Get Started.

The workflow builder canvas will open.

### Adding the Trigger Event &#x20;

The trigger event starts the automation when an invoice is generated.

Steps &#x20;

1. Click **Add Trigger.**
2. Select **Petpooja POS Event.**
3. Choose the event:

Invoice Created

### Phone Number Validation &#x20;

Before sending the invoice message, the system must verify whether the customer phone number is valid for WhatsApp messaging.

#### Steps &#x20;

1. Click **Add Action**.
2. Search for **Phone Number Validation.**
3. Select the action.

***

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

Add the customer phone number variable to validate the number.

Example variable:

customer\_phone\_number

### Storing the Validation Response &#x20;

Store the validation result in a **response variable.**

Example:

phone\_validation\_response

This variable stores whether the number is valid for WhatsApp messaging.

### Handling Invalid Phone Numbers &#x20;

Add a condition to check whether the number is valid.

#### Steps &#x20;

1. Add **If Statement** action.
2. Check the validation variable.

Example logic:

phone\_validation\_response = true

If the condition is true, proceed with sending the invoice.

If false, stop the workflow or redirect to another action.

### Sending the Invoice Message &#x20;

Once the number is validated, send the invoice to the customer.

#### Steps &#x20;

1. Add **Send Message action.**
2. Configure the invoice message.

### Selecting Media Type &#x20;

Invoices can be sent as media attachments.

#### Steps &#x20;

1. In the message configuration section
2. Select **Media Type**

Choose:

URL

This allows the invoice to be sent using a link.

### Adding Invoice URL &#x20;

Add the invoice link variable.

Example:

{{invoice\_url}}

### Configuring Fallback URL &#x20;

A fallback URL ensures the invoice can still be accessed if the primary URL fails.

#### Steps &#x20;

1. Locate the **Fallback URL field**
2. Enter the backup invoice link

Example:

{% embed url="<https://yourdomain.com/invoice>" %}

### Adding Customer Feedback &#x20;

After the invoice is sent, you can collect customer feedback.

### Adding Share Feedback Button &#x20;

A **CTA button** allows customers to submit feedback.

#### Steps &#x20;

1. Add **Send Message action**
2. Select **Interactive Message**
3. Add a button

Example button text:

Share Feedback

When the customer clicks this button, the feedback workflow will begin.

### Searching for Actions &#x20;

Flow Builder allows you to quickly find actions.

#### Steps &#x20;

1. Click **Add Action**
2. Use the **Search field**
3. Enter the required action name

Example:

If Statement

### Creating Feedback Logic &#x20;

To process customer responses, add a conditional logic action.

Steps &#x20;

1. Click **Add Action**
2. Select **If Statement**
3. Define logic based on feedback responses.

### Accessing Feedback Response Variables &#x20;

Go to the **Flow Builder feedback response section.**

Copy the **first feedback question variable.**

Example:

feedback\_response.question1

Paste it in the condition field after the dot.

### Configuring Feedback Conditions &#x20;

Configure the following settings.

**Data Type**&#x20;

Select:

Number

**Operator** &#x20;

Choose:

Greater Than or Equal To

**Value** &#x20;

Disable **Dynamic Value.**

Enter:

3

### Applying Logic for All Questions &#x20;

Repeat the same configuration for all feedback questions.

Example conditions:

feedback\_response.question1 >= 3\
feedback\_response.question2 >= 3\
feedback\_response.question3 >= 3

This ensures each response is evaluated correctly.

### Completing the Feedback Workflow &#x20;

After adding all conditions:

1. Click **Add Action**
2. Complete the feedback workflow
3. Save the configuration

Finally:

1. Click **Publish Workflow**

### Testing the Workflow &#x20;

Before going live, test the automation.

#### Steps &#x20;

1. Generate a test invoice in Petpooja POS
2. Add a customer phone number
3. Verify that:

* Invoice message is sent
* Feedback button appears
* Feedback responses are evaluated

### Troubleshooting &#x20;

#### Invoice Message Not Sent &#x20;

Possible reasons:

* Phone number missing
* Phone number validation failed
* Workflow not published

#### Workflow Not Triggering &#x20;

Check:

* Petpooja integration status
* Event subscription
* Trigger configuration

### Best Practices &#x20;

**Always Capture Customer Phone Number**&#x20;

Ensure billing staff capture the customer phone number during checkout.

**Test the Workflow Regularly** &#x20;

Perform periodic test transactions.

**Monitor Feedback Data** &#x20;

Use feedback responses to improve service quality.

***

### Summary &#x20;

The **Send Invoice automation** allows restaurants using **Petpooja POS** to automatically send invoices via WhatsApp using Ownchat.

The workflow:

1. Detects invoice generation
2. Validates the phone number
3. Sends the invoice message
4. Requests customer feedback
5. Evaluates feedback responses

This automation improves operational efficiency and enhances customer communication.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ownchat.app/work-flows/petpooja/send-invoice-automation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
