> For the complete documentation index, see [llms.txt](https://docs.sprinthub.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sprinthub.com/en/strategies/tokens/using-custom-object-tokens.md).

# Using Custom Object Tokens

How to add custom object tokens to WhatsApp API templates.

## Understanding the Custom Object Token

For this demonstration, a custom object was created for **Products**, responsible for storing the products or orders related to a lead. This object includes the fields: **Description**, **First name**, **Unit Value** and **Order ID**.

A lead custom object token is made up of a pair of braces, starting with `customobj=` followed by the **custom object ID** to which you want to refer. Then, use `->` to point to the **desired field alias** within that object.&#x20;

**Example:** `{customobj=6->description}`

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FH0tkBin5yqrbJah7w0Xt%2F1.png?alt=media&amp;token=5fa81b03-c364-4993-b012-71ef3ca90d58" alt=""><figcaption><p><em>Products custom object.</em></p></figcaption></figure>

{% hint style="info" %}
The values used by the tokens always correspond to the most recently saved custom object. In other words, if there are multiple objects, the last recorded one will be considered.
{% endhint %}

## Creating a Meta Template

For this token use case, a **WhatsApp API Utility Template**.\
In the template body, it is possible to insert various dynamic tokens, such as the lead's name and any values stored in custom objects.

At the time of sending, these tokens are automatically replaced with the corresponding data saved in the Lead.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FKEBLVoKHor6CfL599bJy%2F3.png?alt=media&amp;token=c6fdca86-7607-4663-8661-a25848899dec" alt=""><figcaption><p><em>Template creation.</em></p></figcaption></figure>

## Testing Template Sending

Below, you can see two screenshots: the first shows how the message appears in the conversation, already with the tokens replaced by the real values. The second displays all custom product objects linked to the lead, highlighting the most recent one — which is the one used when sending the message.

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2FyyrxZyhEGi4LkHdmCmRj%2F4.png?alt=media&amp;token=2e0e1ae3-c09f-4135-8f47-857b03f178b2" alt=""><figcaption><p><em>Conversation with template sending.</em></p></figcaption></figure>

<figure><img src="https://684109703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9FzUKkagBNy5uQ7AtGNa%2Fuploads%2Fo3PMbdghuLwAchP59yVD%2F5.png?alt=media&amp;token=8f31316e-7edf-46cb-8ad8-42f3c36adc65" alt=""><figcaption><p><em>Product custom objects.</em></p></figcaption></figure>
