> For the complete documentation index, see [llms.txt](https://docs.getmesa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.getmesa.com/connect/loop-returns.md).

# Loop Returns

## Connection <a href="#connect" id="connect"></a>

When you're setting up your first workflow with Loop Returns, you will need to create a [Connection](https://docs.getmesa.com/going-further/credentials) in order to connect MESA with Loop Returns.

<figure><img src="/files/ItqF6gftbn8OXx7VRwTF" alt="Screenshot of the MESA Loop Returns Connection setup, entering an API key to connect MESA with Loop Returns. Spotlight the Add Connection form."><figcaption></figcaption></figure>

You can locate your API key by clicking Returns management > Tools & integrations > Developer tools on the Loop Returns Dashboard.

<figure><img src="/files/4BA8Ax5FCQA6pqRWbh6x" alt="Screenshot of the Loop Returns Dashboard, navigate to Returns management then Tools and integrations then Developer tools. Spotlight the Developer tools option."><figcaption></figcaption></figure>

The API keys will be at the bottom of this page. Copy and paste that into your workflow and click on Add Connection. Then, you are all set!

<figure><img src="/files/hPpRr6rppm0oYaSb0bwH" alt="Screenshot of the Loop Returns Developer tools page with the API keys section at the bottom. Spotlight the API key value to copy."><figcaption></figcaption></figure>

## Configure <a href="#configuring" id="configuring"></a>

### Loop Returns Triggers (Creating a Webhook) <a href="#triggers" id="triggers"></a>

When starting a workflow with a Loop Returns Trigger, [MESA will require you to create a Webhook before the workflow works successfully.](https://docs.loopreturns.com)

<figure><img src="/files/ZWsg47nin2SfLwtPK5hR" alt="Screenshot of the MESA workflow builder with a Loop Returns Trigger step, showing the requirement to create a webhook in Loop Returns. Spotlight the Webhook URL field."><figcaption></figcaption></figure>

1\. To create a Webhook, click on Returns management on the Loop Returns Dashboard.

<figure><img src="/files/EpfwbkX1FXUDbAQzzOZI" alt="Screenshot of the Loop Returns Dashboard for creating a webhook. Spotlight the Returns management option."><figcaption></figcaption></figure>

2\. Next, click Developer tools under Tools & integrations.

<figure><img src="/files/26tgc7PLUCh7OtUuIEbH" alt="Screenshot of the Loop Returns Developer tools page under Tools and integrations. Spotlight the Create webhook button."><figcaption></figcaption></figure>

3\. Click on Create webhook.

4\. Under the Add Webhook pop-up, you'll see Event, Response and URL fields. Set these per the instructions below.

#### **Event**

Add events as follows for each MESA Trigger.

* **Loop Returns Created or Updated** Trigger: Select Return created and Return updated. You will need to create 2 webhooks in Loop Returns for both Return created and Return updated and with the same copied URL. If you only create one webhook, MESA will not be able to trigger the workflow appropriately.
* **Loop Returns Label Created or Updated** Trigger: Label created and Label updated. You will need to create 2 webhooks in Loop Returns for both Label created and Label updated and with the same copied URL. If you only create one webhook, MESA will not be able to trigger the workflow appropriately.
* **Loop Returns Restock Requested** Trigger: Create one webhook for Restock requested.

#### **Response**

Response for each MESA Trigger.

* **Loop Returns Created or Updated** Trigger: Return
* **Loop Returns Label Created or Updated** Trigger: Label
* **Loop Returns Restock Requested** Trigger: Restock

#### **URL**

From your MESA workflow, copy the Webhook URL seen in the Trigger's field (save the workflow if you do not see an URL in the field and refresh the page). Paste in the URL into the URL Field.

<figure><img src="/files/AFra0HmgfVkRp0BQWjTx" alt="Screenshot of the Loop Returns Add Webhook pop-up showing the Event, Response and URL fields. Spotlight the URL field where the MESA Webhook URL is pasted."><figcaption></figcaption></figure>

5\. Click Add.

6\. Afterwards, locate your newly created webhook and click on the Event label (e.g. Return created) which is highlighted in blue.

<figure><img src="/files/pHVrScfdo6Q9aMrwXSw5" alt="Screenshot of the Loop Returns webhooks list showing the newly created inactive webhook. Spotlight the blue Event label link, for example Return created."><figcaption></figcaption></figure>

7\. Click on Activate to activate the webhook and then click Save.

<figure><img src="/files/CxdbH53Xiiq9p0mGu8AU" alt="Screenshot of the Loop Returns webhook details page. Spotlight the Activate button next to Save."><figcaption></figcaption></figure>

Great job, you have just created your Loop Returns webhook!

### Obtaining information about a specific Whitelist (Allowlist) or Blacklist <a href="#obtain" id="obtain"></a>

In order to retrieve or obtain information about a specific whitelist or blacklist, you will need to locate the blacklist or whitelist ID. This can normally be found via the Loop Returns List Blacklist or Loop Returns List Whitelist action and with some other steps.

In your workflow, add a Loop Returns List Blacklist or Loop Returns List Whitelist action and followed by a [Loop](/tools/loop.md). In the Loop, you can select the [provided variable](/workflow-builder/fields/variables.md) that represents the Whitelist or Blacklist List Data.

<figure><img src="/files/q3EOVi7YmnRodcXd204K" alt="Screenshot of the MESA workflow builder with a Loop Returns List Whitelist action followed by a Loop step. Spotlight the variable selection in the Loop step for the Whitelist List Data."><figcaption></figcaption></figure>

Within the [Loop](/tools/loop.md), you can include a [Filter](/tools/filter.md). In the [Filter](/tools/filter.md), you can specify the whitelist or blacklist to obtain data for. In this example, we used the Loop Value [variable](/workflow-builder/fields/variables.md) which represents the Order or Email of the whitelist.

<figure><img src="/files/UzhVfkPxQGeQRtU9le3y" alt="Screenshot of the MESA Loop step Filter configuration for specifying the whitelist or blacklist to obtain data for. Spotlight the Loop Value variable field."><figcaption></figcaption></figure>

Lastly, add in a Loop Returns Whitelist Retrieve or Loop Returns Blacklist Retrieve Step and then [add the variable from the Loop Step](/workflow-builder/fields/variables.md) that represents the ID of the whitelist or blacklist.

<figure><img src="/files/RxF2PQdBbhysZpuXmLgf" alt="Screenshot of the MESA workflow builder with a Loop Returns Whitelist Retrieve step. Spotlight the ID field populated with the variable from the Loop step."><figcaption></figcaption></figure>

Your workflow should look like this now. The steps' titles were edited to make the workflow more detailed and organized.

<figure><img src="/files/wYjR8nsMFOSkJnfj0V69" alt="Screenshot of the completed MESA Loop Returns workflow in the builder with renamed steps. Show the full workflow builder canvas."><figcaption></figcaption></figure>

## Technical Notes <a href="#create" id="create"></a>

### Create an order in Loop Returns <a href="#create" id="create"></a>

To create an order in Loop Returns, you will need to fill out all three required fields in the Step Configuration.

* **Designation:** Your store ID. It is a unique Loop ID number associated with your store. You can reach out to Loop Returns' support at <support@loopreturns.com> to find out what your store ID is.
* **Name:** The Shopify order number (e.g. 1001)
* **Zip:** The shipping zip code attached to the order

{% hint style="info" %}
**Note**: In order to create an order, you will need to be on a Loop Plus plan.
{% endhint %}
