# Configure Retail App - REST API

This page explains how to establish REST API integration between Customer v2 and an external service. The API's can be used in multiple flows and can be configured with variable placeholders to allow reuse in multiple scenarios.&#x20;

Follow a step-by-step tutorial to connection.

## Before You Begin <a href="#before-you-begin" id="before-you-begin"></a>

* Confirm you know the **API** you want to connect to and the **authorization requirements** needed perform API calls.&#x20;
* Think about what information returned from the API call is relevant to complete the flow and how to parse it for the user.&#x20;

## Accessing the REST API Configuration <a href="#accessing-the-chat-widget-configuration" id="accessing-the-chat-widget-configuration"></a>

1. Sign in to **iX Hello Customer v2**.
2. In the left navigation menu, go to **Integrations → REST API**.
3. Select **Create connection** or open an existing REST API to edit. The detail page includes:&#x20;
   1. A **header** displaying the Name and the description. Click **edit** to update the base URL and authorization values.&#x20;
   2. A **list view** of configured methods for this API.&#x20;

<table><thead><tr><th width="272">Setting</th><th>Value</th></tr></thead><tbody><tr><td>Name</td><td>RetailAPI</td></tr><tr><td>Description</td><td>Retail Demo API - Customer service for jacket returns and exchanges</td></tr></tbody></table>

{% hint style="info" %}
Customer v2 doesn't support editing the Name and Description of the REST API after creation. Ensure they are correct before saving.
{% endhint %}

4. Click **Save** to create the REST API and continue to the base URL and authorization type.

<table><thead><tr><th width="272">Setting</th><th>Value</th></tr></thead><tbody><tr><td>Base URL</td><td><a href="https://blsmr065q1.execute-api.us-east-1.amazonaws.com/prod/">https://blsmr065q1.execute-api.us-east-1.amazonaws.com/prod/</a></td></tr><tr><td>Authorization Type</td><td>No Authorization</td></tr></tbody></table>

<figure><img src="/files/0yld9dcxnC6JOmiPTbB8" alt=""><figcaption></figcaption></figure>

## Configuring the Method request <a href="#step-1-define-widget-details" id="step-1-define-widget-details"></a>

### Step 1: checkInventoryMethod

Setup of the overarching settings that will be used by all methods

<table><thead><tr><th width="220">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>checkInventory</td></tr><tr><td>Description</td><td>A description to provide further information. </td></tr><tr><td>Request type</td><td>POST</td></tr><tr><td>Method path *</td><td>inventory</td></tr><tr><td>Query String *</td><td>NA</td></tr><tr><td>Request Headers *</td><td><p>Request headers are key-value pairs used to transfer metadata about the request.</p><p>{"Content-Type":"application/json"}</p></td></tr><tr><td>Request Body *</td><td><p>The request body contains the actual data being transferred between the client and the server, in JSON format.</p><p>{"product_name":"{{product_name}}","size":"{{size}}","color":"{{color}}"}</p></td></tr><tr><td>Result Type</td><td>Entry</td></tr><tr><td>Result Path</td><td>NA</td></tr><tr><td>Record Path</td><td>$</td></tr><tr><td>Record Template</td><td>NA</td></tr><tr><td>Record Limit</td><td>10</td></tr><tr><td>Valid Result Template</td><td>NA</td></tr><tr><td>Empty Result Template</td><td>NA</td></tr></tbody></table>

{% hint style="info" %}
Enter a \<space> in a required setting to use the default value of that setting.
{% endhint %}

<figure><img src="/files/NTlK8a7fjI5etwABc3B4" alt=""><figcaption></figcaption></figure>

### Step 2: checkInventoryAllMethod

Setup of the overarching settings that will be used by all methods

<table><thead><tr><th width="220">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>checkInventoryAll</td></tr><tr><td>Description</td><td>A description to provide further information. </td></tr><tr><td>Request type</td><td>POST</td></tr><tr><td>Method path *</td><td>inventory</td></tr><tr><td>Query String *</td><td>NA</td></tr><tr><td>Request Headers *</td><td><p>Request headers are key-value pairs used to transfer metadata about the request.</p><p>{"Content-Type":"application/json"}</p></td></tr><tr><td>Request Body *</td><td><p>The request body contains the actual data being transferred between the client and the server, in JSON format.</p><p>{"product_name":"{{product_name}}"}</p></td></tr><tr><td>Result Type</td><td>Entry</td></tr><tr><td>Result Path</td><td>NA</td></tr><tr><td>Record Path</td><td>$</td></tr><tr><td>Record Template</td><td>NA</td></tr><tr><td>Record Limit</td><td>10</td></tr><tr><td>Valid Result Template</td><td>NA</td></tr><tr><td>Empty Result Template</td><td>NA</td></tr></tbody></table>

<figure><img src="/files/T81rmhgycUGxlPSwn8zj" alt=""><figcaption></figcaption></figure>

### Step 3: generateReturnLabelMethod

Setup of the overarching settings that will be used by all methods

<table><thead><tr><th width="220">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>generateReturnLabel</td></tr><tr><td>Description</td><td>A description to provide further information. </td></tr><tr><td>Request type</td><td>POST</td></tr><tr><td>Method path *</td><td>return-label</td></tr><tr><td>Query String *</td><td>NA</td></tr><tr><td>Request Headers *</td><td><p>Request headers are key-value pairs used to transfer metadata about the request.</p><p>{"Content-Type":"application/json"}</p></td></tr><tr><td>Request Body *</td><td><p>The request body contains the actual data being transferred between the client and the server, in JSON format.</p><p>{"order_id":"{{order_id}}","item_sku":"{{item_sku}}","customer_email":"{{customer_email}}","return_reason":"{{return_reason}}"}</p></td></tr><tr><td>Result Type</td><td>Entry</td></tr><tr><td>Result Path</td><td>NA</td></tr><tr><td>Record Path</td><td>$</td></tr><tr><td>Record Template</td><td>NA</td></tr><tr><td>Record Limit</td><td>10</td></tr><tr><td>Valid Result Template</td><td>NA</td></tr><tr><td>Empty Result Template</td><td>NA</td></tr></tbody></table>

<figure><img src="/files/mBkuHQJlva4Z2a0oJJ3P" alt=""><figcaption></figcaption></figure>

### Step 4: getUserDataMethod

Setup of the overarching settings that will be used by all methods

<table><thead><tr><th width="220">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>getUserData</td></tr><tr><td>Description</td><td>A description to provide further information. </td></tr><tr><td>Request type</td><td>GET</td></tr><tr><td>Method path *</td><td>user-data</td></tr><tr><td>Query String *</td><td>ani={{ani}}</td></tr><tr><td>Request Headers *</td><td>Request headers are key-value pairs used to transfer metadata about the request.</td></tr><tr><td>Request Body *</td><td><p>The request body contains the actual data being transferred between the client and the server, in JSON format.</p><p>{"order_id":"{{order_id}}","item_sku":"{{item_sku}}","customer_email":"{{customer_email}}","return_reason":"{{return_reason}}"}</p></td></tr><tr><td>Result Type</td><td>Entry</td></tr><tr><td>Result Path</td><td>NA</td></tr><tr><td>Record Path</td><td>$</td></tr><tr><td>Record Template</td><td>NA</td></tr><tr><td>Record Limit</td><td>10</td></tr><tr><td>Valid Result Template</td><td>NA</td></tr><tr><td>Empty Result Template</td><td>NA</td></tr></tbody></table>

<figure><img src="/files/yGQgOy5xwatnin1eQxwe" alt=""><figcaption></figcaption></figure>

### Step 5: processExchangeMethod

Setup of the overarching settings that will be used by all methods

<table><thead><tr><th width="220">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>processExchange</td></tr><tr><td>Description</td><td>A description to provide further information. </td></tr><tr><td>Request type</td><td>POST</td></tr><tr><td>Method path *</td><td>exchange</td></tr><tr><td>Query String *</td><td>NA</td></tr><tr><td>Request Headers *</td><td><p>Request headers are key-value pairs used to transfer metadata about the request.</p><p>{"Content-Type":"application/json"}</p></td></tr><tr><td>Request Body *</td><td><p>The request body contains the actual data being transferred between the client and the server, in JSON format.</p><p>{"order_id":"{{order_id}}","original_item_sku":"{{original_item_sku}}","new_item_sku":"{{new_item_sku}}","customer_id":"{{customer_id}}","customer_email":"{{customer_email}}"}</p></td></tr><tr><td>Result Type</td><td>Entry</td></tr><tr><td>Result Path</td><td>NA</td></tr><tr><td>Record Path</td><td>$</td></tr><tr><td>Record Template</td><td>NA</td></tr><tr><td>Record Limit</td><td>10</td></tr><tr><td>Valid Result Template</td><td>NA</td></tr><tr><td>Empty Result Template</td><td>NA</td></tr></tbody></table>

<figure><img src="/files/Zzb8dEPakO440LvTOUHt" alt=""><figcaption></figcaption></figure>

### Step 6: registerUserMethod

Setup of the overarching settings that will be used by all methods

<table><thead><tr><th width="220">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>registerUser</td></tr><tr><td>Description</td><td>A description to provide further information. </td></tr><tr><td>Request type</td><td>POST</td></tr><tr><td>Method path *</td><td>user-data</td></tr><tr><td>Query String *</td><td>NA</td></tr><tr><td>Request Headers *</td><td><p>Request headers are key-value pairs used to transfer metadata about the request.</p><p>{"Content-Type":"application/json"}</p></td></tr><tr><td>Request Body *</td><td><p>The request body contains the actual data being transferred between the client and the server, in JSON format.</p><p>{"ani":"{{ani}}","name":"{{name}}","email":"{{email}}","loyalty_status":"{{loyalty_status}}"}</p></td></tr><tr><td>Result Type</td><td>Entry</td></tr><tr><td>Result Path</td><td>NA</td></tr><tr><td>Record Path</td><td>$</td></tr><tr><td>Record Template</td><td>NA</td></tr><tr><td>Record Limit</td><td>10</td></tr><tr><td>Valid Result Template</td><td>NA</td></tr><tr><td>Empty Result Template</td><td>NA</td></tr></tbody></table>

<figure><img src="/files/00VAlvkyCGZjOo0u5Aa1" alt=""><figcaption></figcaption></figure>

### Step 7: sendConfirmationMethod

Setup of the overarching settings that will be used by all methods

<table><thead><tr><th width="220">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>sendConfirmation</td></tr><tr><td>Description</td><td>A description to provide further information. </td></tr><tr><td>Request type</td><td>POST</td></tr><tr><td>Method path *</td><td>sms</td></tr><tr><td>Query String *</td><td>NA</td></tr><tr><td>Request Headers *</td><td><p>Request headers are key-value pairs used to transfer metadata about the request.</p><p>{"Content-Type":"application/json"}</p></td></tr><tr><td>Request Body *</td><td><p>The request body contains the actual data being transferred between the client and the server, in JSON format.</p><p>{"phone_number":"{{phone_number}}","message_type":"confirmation","content":{"confirmation_number":"{{confirmation_number}}"}}</p></td></tr><tr><td>Result Type</td><td>Entry</td></tr><tr><td>Result Path</td><td>NA</td></tr><tr><td>Record Path</td><td>$</td></tr><tr><td>Record Template</td><td>NA</td></tr><tr><td>Record Limit</td><td>10</td></tr><tr><td>Valid Result Template</td><td>NA</td></tr><tr><td>Empty Result Template</td><td>NA</td></tr></tbody></table>

<figure><img src="/files/1YxAjD66hvRv7VpPIIse" alt=""><figcaption></figcaption></figure>

### Step 8: sendProductLinkMethod

Setup of the overarching settings that will be used by all methods

<table><thead><tr><th width="220">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>sendProductLink</td></tr><tr><td>Description</td><td>A description to provide further information. </td></tr><tr><td>Request type</td><td>POST</td></tr><tr><td>Method path *</td><td>sms</td></tr><tr><td>Query String *</td><td>NA</td></tr><tr><td>Request Headers *</td><td><p>Request headers are key-value pairs used to transfer metadata about the request.</p><p>{"Content-Type":"application/json"}</p></td></tr><tr><td>Request Body *</td><td><p>The request body contains the actual data being transferred between the client and the server, in JSON format.</p><p>{"phone_number":"{{phone_number}}","message_type":"product_link","content":{"product_url":"{{product_url}}"}}</p></td></tr><tr><td>Result Type</td><td>Entry</td></tr><tr><td>Result Path</td><td>NA</td></tr><tr><td>Record Path</td><td>$</td></tr><tr><td>Record Template</td><td>NA</td></tr><tr><td>Record Limit</td><td>10</td></tr><tr><td>Valid Result Template</td><td>NA</td></tr><tr><td>Empty Result Template</td><td>NA</td></tr></tbody></table>

<figure><img src="/files/SD6SBHPQ9fke7EEVkeZm" alt=""><figcaption></figcaption></figure>

### Step 9: sendSMSMethod

Setup of the overarching settings that will be used by all methods

<table><thead><tr><th width="220">Setting</th><th>Description</th></tr></thead><tbody><tr><td>Name</td><td>sendSMS</td></tr><tr><td>Description</td><td>A description to provide further information. </td></tr><tr><td>Request type</td><td>POST</td></tr><tr><td>Method path *</td><td>sms</td></tr><tr><td>Query String *</td><td>NA</td></tr><tr><td>Request Headers *</td><td><p>Request headers are key-value pairs used to transfer metadata about the request.</p><p>{"Content-Type":"application/json"}</p></td></tr><tr><td>Request Body *</td><td><p>The request body contains the actual data being transferred between the client and the server, in JSON format.</p><p>{"phone_number":"{{phone_number}}","message_type":"{{message_type}}","content":{"product_url":"{{product_url}}","confirmation_number":"{{confirmation_number}}","message":"{{message}}"}}</p></td></tr><tr><td>Result Type</td><td>Entry</td></tr><tr><td>Result Path</td><td>NA</td></tr><tr><td>Record Path</td><td>$</td></tr><tr><td>Record Template</td><td>NA</td></tr><tr><td>Record Limit</td><td>10</td></tr><tr><td>Valid Result Template</td><td>NA</td></tr><tr><td>Empty Result Template</td><td>NA</td></tr></tbody></table>

<figure><img src="/files/KGZSyIvHWhbolbNGvduD" alt=""><figcaption></figcaption></figure>

## Next Steps <a href="#next-steps" id="next-steps"></a>

Once you’ve configured and saved your REST API configuration, they can be selected and configured in an [API call node](/ixhc2/flows/flow-editor/api-call.md).&#x20;

Follow the [vNext Retail Bot](https://app.gitbook.com/o/-M8Qw0HjmL3rDRYUXBX0/s/Fe4cpY1jy0FJ4kgC7wSx/~/edit/~/changes/243/general/tutorials/vnext-retail-bot) tutorial to setup a REST API configuration in preparation for a Retail Bot.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ixhello.com/ixhc2/general/tutorials/configure-retail-app-rest-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
