# Test & Go Live

In this article, you will test your App Function using the Partner Portal preview panel, then run a full end-to-end test from the merchant dashboard by creating a demo order and triggering a WhatsApp message. Once everything works, you will be able to send a request to publish your app.


## Set your app as the active handler

Before running the end-to-end test, you need to tell the demo store to route WhatsApp messages through your app instead of Salla's default handler.


<Steps>
<Step>
Install your app on a demo store

![SCR-20260413-mbyz.png](https://api.apidog.com/api/v1/projects/451700/resources/375486/image-preview)
</Step>
    
<Step>
Navigate to **Apps** → **Settings** → **Customize**.


![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375495/image-preview)

</Step>
<Step>  
Find the **WhatsApp** channel and select your app as the active handler then click Save.


![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375496/image-preview)
</Step>
</Steps>



## Create a test customer

The customer you create here must have the Twilio-verified WhatsApp sandbox number as their phone number. This is the number you used to send the join message to the Twilio sandbox. Note that WhatsApp messages will only be delivered to verified sandbox numbers during testing.

<Steps>
<Step>
    
In the demo store dashboard, navigate to **All** → **Customers** 
    

![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375526/image-preview)
    
</Step>

<Step>
Click on Create Customer button 
    
![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375528/image-preview)
</Step>
<Step>
Fill in the customer details. In the **Mobile Number** field, enter the verified Twilio sandbox number.



![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375498/image-preview)
</Step>
<Step>    
Save the customer and note the customer ID — you will need it when testing directly through the App Function editor.


![SCR-20260413-mhgo.png](https://api.apidog.com/api/v1/projects/451700/resources/375502/image-preview)
</Step>
</Steps>

## Create a test order

<Steps>
<Step>

Navigate to **Orders** → **All Orders** → **New Order**.


![SCR-20260413-merc.png](https://api.apidog.com/api/v1/projects/451700/resources/375500/image-preview)
</Step>
<Step>
Fill in the order details:
   - **Product** — select any available product alongside its measurments
   - **Customer** — select the customer you just created
   - **Payment method** — Bank Transfer
   - **Shipping** — Choose no shipping required

Then click on **Create Order**.

![SCR-20260413-mfxb.png](https://api.apidog.com/api/v1/projects/451700/resources/375501/image-preview)

</Step>
</Steps>

## Trigger the event

We built an app function intercepts the status change, builds the message payload, and routes it to your App Function by changing the order status, which fires `communication.whatsapp.send`

<Steps>
<Step>
Open the order you just created. You can check all orders related to the demo store from the [All Orders](https://s.salla.sa/orders) tab

![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375531/image-preview)
    
</Step>
<Step>
Change the order status to any status and Apply it on the order

![SCR-20260413-naum.png](https://api.apidog.com/api/v1/projects/451700/resources/375503/image-preview)
    </Step>
    
<Step>
View the success result of sending the message
<Tabs>
  <Tab title="Success - Twillo">
Your App Function will now execute. Within a few seconds, you should receive a WhatsApp message on your verified sandbox number confirming the order status change.


![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375504/image-preview)


  </Tab>
  <Tab title="Success - Webhook">

You will also receive a store event webhook that you subscribed to, which is sent to your webhook URL as follows


![SCR-20260413-nfjq.png](https://api.apidog.com/api/v1/projects/451700/resources/375507/image-preview)
  </Tab>
</Tabs>

    

</Step>
</Steps>
## Test via the Preview Panel

The preview panel lets you run your function against real demo store data before touching the merchant dashboard. It is the fastest way to catch configuration issues early.

<Steps>
    
<Step>
    
In the Partner Portal, open your app and navigate to the function you created.


![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375484/image-preview)
    
</Step>
<Step>
In the preview panel, click **Select Store** and choose your demo store.
</Step>
<Step>
Enter a customer ID in the preview parameters. This must be a customer whose phone number is the Twilio-verified WhatsApp number
</Step>
<Step>
Click **Save and Preview**.

    


![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375485/image-preview)
    
    
The preview panel will show you the above image:

<Accordion title="Details" defaultOpen={false}>
| Output | What it tells you |
|---|---|
| Execution status | Whether the function completed successfully or threw an error |
| Response data | The `sid` and `status` returned by Twilio on success |
| Execution time | How long the function took to run |
| `console.log()` output | Any debug logs you added in your handler |
| Error trace | Full stack trace if the function failed |
</Accordion>

</Step>
</Steps>
## Twillo Troubleshooting

If you did not receive the message, use the table below to identify the cause as detailed by [Twillo](https://www.twilio.com/docs/api/errors).

| Status code | Error message | Likely cause | Fix |
|---|---|---|---|
| **422** | `Missing Twilio credentials in App Settings` | App Settings not filled in on the demo store | Go to Apps → Settings → Customize and enter your Twilio credentials |
| **422** | `Missing recipient or message content in payload` | Customer has no phone number, or payload is malformed | Confirm the test customer has the verified sandbox number saved |
| **503** | `Twilio delivery failed` | Twilio rejected the request | Check that the sandbox number is still verified and the credentials are correct |
| **401/403** | `Unauthorized` | Invalid or expired Auth Token | Re-copy the Auth Token from the Twilio Console and update App Settings |
| **500** | `Internal Server Error` | Unhandled null on `entity` or `meta` | Add optional chaining (`entity?.id`) when accessing those fields |

:::info[Check the function logs]


<Tabs>
  <Tab title="App Function Preview">
If the order status change fired but you are not sure whether the function executed, go back to the Partner Portal function editor and re-run the preview panel with the same customer ID. The execution log will show you exactly what happened and where it failed.


![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375508/image-preview)

  </Tab>
  <Tab title="Twillo Monitor">
You can check Twillo Monitor tab for more details


![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375533/image-preview)

  </Tab>
</Tabs>




:::

## Publish your app

Once the end-to-end test passes and the WhatsApp message arrives on your phone, your app is ready to go live.
<Steps>
<Step>
Return to the Partner Portal and open your app dashboard.
</Step>
<Step>
Click **Start publishing your app** and follow the [standard publication flow](https://salla.dev/blog/standards-salla-apps-publications/).


![image.png](https://api.apidog.com/api/v1/projects/451700/resources/375506/image-preview)
</Step>
</Steps>


<Columns>
  <Column>

:::info[Sandbox vs. live]
All edits made in the function editor are saved in a sandbox environment until you explicitly publish. Any changes you make after publishing follow the same flow | edit, test, publish.
:::
  </Column>
  <Column>


:::check[Existing installs]
Merchants who already have your app installed will receive the updated function automatically once you publish. You do not need to notify them or ask them to reinstall.
:::
    </Column>
</Columns>



## What you have now

- App Function tested and verified via the preview panel
- End-to-end WhatsApp message delivery confirmed from the merchant dashboard
- App published and live for merchants

Your Communication App is fully operational. Merchants who install it and set it as their active WhatsApp handler will have all their WhatsApp messages routed through your Twilio function automatically.

:::note[]
To extend your app to handle SMS or Email as well, read [App Channels Configuration](https://docs.salla.dev/doc-2081234) and add the relevant Supported Features, then add a new function for each channel following the same pattern when [Building App Function](https://docs.salla.dev/apis/doc-2081248).
:::
