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

# Variables

> Which variables fill automatically, and which you must send through the API.

Variables are names in an agent's script, like `{{customer_name}}`, that get swapped for real values on each call. You can write them as `{{name}}` or `{name}`.

## Who fills them

> [card] Scalysis dialer
>
> Calls started from the dashboard, a campaign upload or an automation. The variables below are **filled automatically** from the order.

> [card] Your API calls
>
> Calls you send with the API. **Nothing is filled automatically.** Send a value for every variable the script uses, in the request body.

## Sending variables through the API

The same names work. A few come from standard fields; send everything else under its own name.

| In the script | Send in the API as |
| - | - |
| `{{customer_name}}` | `customerName` |
| `{{customer_phone}}` | `customerPhone` |
| `{{customer_email}}` | `customerEmail` |
| `{{delivery_address}}` or `{{customer_address}}` | `customerAddress` |
| `{{order_number}}` | `orderNumber` |
| `{{order_total}}` | `totalPrice` |
| `{{currency}}` | `currency` |
| `{{order_status}}` | `orderStatus` |
| `{{order_notes}}` | `orderNotes` |
| `{{product_name}}` | `productName` |
| Anything else, like `{{brand_name}}` or `{{awb}}` | The same name: `brand_name`, `awb` |

```json theme={null}
{
  "scriptId": 2207,
  "customerPhone": "+911234567899",
  "customerName": "Rahul",
  "totalPrice": "1299",
  "brand_name": "Demo Store",
  "awb": "AWB123456789"
}
```

If one is missing, the call is not placed and the error lists it, like `Missing required script variables: brand_name`.

## Filled by the Scalysis dialer

The rest of this page applies only to calls the Scalysis dialer starts.

**Customer**

* `{{customer_name}}`: the customer's name
* `{{customer_phone}}` (also works as `{{phone_number}}`): their phone number
* `{{customer_email}}`: their email
* `{{delivery_address}}` (also works as `{{customer_address}}`): their full delivery address
* `{{city}}`: their city
* `{{customer_tags}}`: their tags
* `{{isrepeatcustomer}}`: true if they have ordered before, otherwise false
* `{{repeat_order_count}}`: how many times they have ordered
* `{{repeat_order_dates}}`: the dates of those past orders
* `{{order_history}}`: their last 10 orders, with date, days ago and items

**Order**

* `{{order_number}}`: the order number, like #1234
* `{{order_id}}`: the order ID
* `{{order_total}}`: the order value (also works as `{{order_amount}}`)
* `{{currency}}`: the currency, like INR
* `{{order_date}}`: the order date, in a form the agent can say out loud
* `{{order_status}}`: the order status
* `{{payment_mode}}`: paid, pending or refunded
* `{{order_notes}}`: the order notes
* `{{order_tags}}`: the order tags
* `{{discount_code}}`: the discount codes used

**Products**

* `{{product_name}}`: a summary of the products
* `{{product_detail}}`: every item, with its size, quantity and price
* `{{product_sku}}`: the first item's SKU
* `{{product_quantity}}`: the first item's quantity
* `{{product_skustock}}`: each cart item with all its sizes, and whether each is in stock

**Shipping**

* `{{shipping_method}}`: the shipping method
* `{{awb}}`: the tracking number
* `{{tracking_status}}`: the latest shipment status
* `{{delivery_date}}`: when it was delivered

**Cart**

* `{{cart_url}}`: the abandoned cart link

**Filled by the calling system itself**

* `{{caller_number}}` and `{{called_number}}`: the two phone numbers on the call
* `{{current_time}}` and `{{current_weekday}}`: the time and day of the call

For outbound calls (we call the customer):

* Customer's phone: `{{customer_phone}}`, which also works as `{{phone_number}}` or `{{called_number}}`
* AI agent's phone: `{{caller_number}}`

For inbound calls (the customer calls us), the last two swap:

* Customer's phone: `{{caller_number}}`
* AI agent's phone: `{{called_number}}`

If you're unsure, use `{{customer_phone}}` for the customer on outbound calls, since it always holds the customer's number.

**Not filled automatically.** These need to be sent with the call, for example from a spreadsheet column, or typed into the script:

* `{{brand_name}}` or `{{store_name}}`
* `{{agent_name}}`
* `{{discount_percent}}`
* `{{checkout_link}}`
* `{{payment_link}}`
* Any other name you make up

A variable only gets filled if that order actually has the data. For example, `{{awb}}` stays blank until the order has shipped.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.