> ## Documentation Index
> Fetch the complete documentation index at: https://reportana.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# find_order_by_number

### Introduction

The `find_order_by_number` function is used to search for orders based on the order number provided by the customer. It is useful for retrieving order data within chatbot automations, for example, allowing you to display information about a specific order. Please note that the system will only retrieve the order associated with the provided order number.

> **Note:** The `find_order_by_number` function works exclusively through Automations, Campaigns, and Advanced Campaigns.

### Example of Use

Example of how to use the `find_order_by_number` function:

```twig theme={null}
{% set data = find_order_by_number(number) %}

{% if data is not empty and data.order is not empty %}
*#{{ data.order.number }}*
{% if data.order.payment_method == 'BOLETO' %}🏷 _Boleto_{% elseif data.order.payment_method == 'CREDIT_CARD' %}💳 _Credit Card_{% elseif data.order.payment_method == 'PIX' %}🤳🏼 _Pix_{% else %}🏷 _Other_{% endif %}

{% if data.order.payment_status == 'PAID' %}✅ _Paid_{% elseif data.order.payment_status == 'PENDING' %}⏳ _Pending_{% else %}❌ _Not paid_{% endif %}

{% if data.order.tracking_numbers_url is not empty %}🚚 {{ data.order.tracking_numbers_url }}{% else %}🚚 _Shipment pending_{% endif %}
{% else %}
No order associated with the number: {{ number }}.
{% endif %}
```

### Output Example of the Code

<img src="https://mintcdn.com/reportana/9HogJxt6BTsd31jh/findOrderByNumberRS-en.png?fit=max&auto=format&n=9HogJxt6BTsd31jh&q=85&s=7c425f0ac1ae78e483e18b4addfcc521" alt="Result of the `find_order_by_number` Filter" width="758" height="637" data-path="findOrderByNumberRS-en.png" />

In the example above, we use the `find_order_by_number` function to search for an order based on the number provided by the customer, which is stored in the `number` variable, returning the order information.
