> 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/petpooja/send-invoice.md). Agents can also search and read this documentation through its [MCP server](https://docs.ownchat.app/~gitbook/mcp).

# Send Invoice

The **Send Invoice** 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**.

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

#### 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.**

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

### 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

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

### 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.

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

### Creating the Workflow &#x20;

#### Open Flow Builder &#x20;

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

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

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

### 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.

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

### Configure Petpooja in Workflow &#x20;

* Select Petpooja from Apps
* Select the connection name from the dropdown
* Select event from dropdown
* Enter variable name as response
* Click Update

### Phone Number Validation &#x20;

Before sending the invoice, the system validates the customer’s phone number.

#### Steps &#x20;

* Click Add Action
* Drag output dot → create next action
* Search and select Phone Number Validation<br>

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

* Enter action name: Gather the customer phone number
* Click Add Variable
* Select:
* {{response.properties.Customer.phone}}

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

* Store response in variable: Validated\_number
* Click Add Action

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

### Send Template Message (If Number is Valid) &#x20;

* Add action → Template Message
* Enter action name:\
  Get the feedback through this template message<br>

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

#### Configure Fields &#x20;

* Add variable: {{Validated\_number}}
* Add customer name variable:\
  response.properties.customer.name

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

#### Template Selection &#x20;

* Select approved template:\
  invoice\_with\_feedback\_form\_method\_01

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

#### Template Includes &#x20;

* Order ID
* Bill amount
* Feedback CTA button

Additional Configuration &#x20;

* Check Time: 24 hours<br>

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

* Media Type: URL
* Media URL:
* Add variable → response.invoiceUrl
* Fallback URL: Enter website URL

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

#### Body Configuration &#x20;

* Add variables where required
* Fallback value: NA
* Select:\
  properties.Order.total

#### Store Feedback Response &#x20;

* Create variable: Feedback\_1
* Click Add Action<br>

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

### Handling Invalid Phone Numbers &#x20;

If validation fails:

* Select Session Message

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

* Enter action name:\
  If the mobile number get failed

#### Configure &#x20;

* Enter fallback contact number
* Enter customer name<br>

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

* Message:
* Your mobile number is not validated. Please re-enter the number.
* Click Add Action

### Feedback Capture (CTA Trigger) &#x20;

* When customer clicks Share Feedback
* Feedback form opens in Flow Builder
* Responses are captured automatically

### Feedback Evaluation Using IF Statement &#x20;

#### Add IF Condition &#x20;

* Search and select IF Statement<br>

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

* Enter action name

#### Condition Logic &#x20;

* Use AND condition (all must be true)<br>

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

#### Configure Conditions &#x20;

For each question:

* Key: Feedback\_1.\<question>

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

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

* Data Type: Number
* Operator: Greater than or equal to
* Disable dynamic value
* Value: 3

Repeat for all feedback questions.

#### Outcome  <br>

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

* All conditions TRUE → Positive feedback
* Any condition FALSE → Negative feedback

### Positive Feedback Flow  <br>

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

* Add Session Message
* Rename: Positive Message

#### Configure &#x20;

* Contact:
* Validated\_number.phoneNo
* Customer Name:
* response.properties.Customer.name<br>

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

* Enter positive message
* Click Add Action

### Negative Feedback Flow &#x20;

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

* Add Session Message
* Rename: Negative Message

#### Configure &#x20;

* Contact:
* Validated\_number.phoneNo
* Customer Name:
* response.properties.Customer.name<br>

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

* Enter empathetic message
* Click Add Action

### Publish Workflow &#x20;

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

* Click Publish
* Close workflow screen

#### Final Status  <br>

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

* Workflow appears as Active in workflow list

### Workflow Logic Summary &#x20;

* Invoice generated → workflow triggered
* Phone number validated
* Invoice sent via WhatsApp
* Feedback collected via template
* Feedback evaluated using IF conditions
* Positive / Negative responses handled separately

### Final Outcome &#x20;

After completing this setup, your workflow will:

* Automatically send invoices via WhatsApp
* Validate customer contact details
* Collect structured feedback
* Respond intelligently to customer sentiment
* Reduce manual effort and improve efficiency
