> For the complete documentation index, see [llms.txt](https://help.daasity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.daasity.com/core-concepts/data-integrations/setup-guides/digital-integrations/loop-returns/integration-specifications.md).

# Integration Specifications

## Integration Overview

Loop Returns is a Shopify SaaS platform that enables merchants to simplify the returns process and encourage customers to turn returns into exchanges by offering 4 ways to return: exchange, shop now, store credit, or refund.

The Daasity Loop Returns integration extracts returns, return lines, and exchange lines from Loop Returns which allows the merchant to link their Shopify data to their Return data and better analyze their returns and the performance of the product with return data included.

## Integration Availability

This integration is available for:

* Enterprise
* Growth

## API Endpoints

The Daasity Loop Returns integration is built based on this [Loop Returns API documentation](https://docs.loopreturns.com/reference/introduction).  The following endpoints are used by Daasity to replicate data from Loop:

* [Returns](https://docs.loopreturns.com/reference/detailed-returns-list)

## Entity Relationship Diagram (ERD)

[Click here to view the ERD for the Daasity Loop Returns integration](https://lucid.app/documents/embedded/367f2d69-9c99-4ea4-a7bf-53ca638a48ad) illustrating the different tables and keys to join across tables.

## Loop Returns Schema

The Daasity Loop extractor creates these tables using the endpoints and replication methods listed. The data is mapped from the source API endpoint to the table based on the mapping logic outlined in each table.

* [Returns](#returns)
* [Return Lines](#return-lines)
* [Exchange Lines](#exchange-lines)

### **Returns**

* Endpoint: [Returns](https://docs.loopreturns.com/reference/detailed-returns-list)
* Update Method: UPSERT
* Table Name: \[`loop_returns.returns`]

| JSON Element               | Database Column           |
| -------------------------- | ------------------------- |
| id                         | return\_id                |
| state                      | return\_state             |
| created\_at                | created\_at               |
| updated\_at                | updated\_at               |
| total                      | total                     |
| order\_id                  | order\_id                 |
| order\_name                | order\_code               |
| provider\_order\_id        | shopify\_order\_id        |
| order\_number              | order\_number             |
| customer                   | email                     |
| currency                   | currency                  |
| return\_product\_total     | return\_product\_total    |
| return\_discount\_total    | return\_discount\_total   |
| return\_tax\_total         | return\_tax\_total        |
| return\_total              | return\_total             |
| return\_credit\_total      | return\_credit\_total     |
| exchange\_product\_total   | exchange\_product\_total  |
| exchange\_discount\_total  | exchange\_discount\_total |
| exchange\_tax\_total       | exchange\_tax\_total      |
| exchange\_total            | exchange\_total           |
| exchange\_credit\_total    | exchange\_credit\_total   |
| gift\_card                 | gift\_card                |
| handling\_fee              | handling\_fee             |
| refund                     | refund                    |
| upsell                     | upsell                    |
| carrier                    | carrier                   |
| tracking\_number           | tracking\_number          |
| label\_status              | label\_status             |
| label\_updated\_at         | label\_updated\_at        |
| MD5(id + *\_*\_source\_id) | \_\_sync\_key             |

### **Return Lines**

* Endpoint: [Returns](https://docs.loopreturns.com/reference/detailed-returns-list)
* Update Method: UPSERT
* Table Name: \[`loop_returns.return_lines`]

| JSON Element                              | Database Column        |
| ----------------------------------------- | ---------------------- |
| MD5(id + ':' + line\_item\_id)            | return\_line\_id       |
| id                                        | return\_id             |
| order\_name                               | order\_code            |
| provider\_order\_id                       | shopify\_order\_id     |
| product\_id                               | product\_id            |
| variant\_id                               | variant\_id            |
| sku                                       | sku                    |
| title                                     | title                  |
| price                                     | price                  |
| discount                                  | discount               |
| tax                                       | tax                    |
| refund                                    | refund                 |
| returned\_at                              | returned\_at           |
| parent\_return\_reason                    | parent\_return\_reason |
| barcode                                   | barcode                |
| MD5(id + line\_item\_id + \_\_source\_id) | \_\_sync\_key          |

### **Exchange Lines**

* Endpoint: [Returns](https://docs.loopreturns.com/reference/detailed-returns-list)
* Update Method: UPSERT
* Table Name: \[`loop_returns.exchange_lines`]

| JSON Element                                  | Database Column    |
| --------------------------------------------- | ------------------ |
| MD5(id + exchange\_id)                        | exchange\_line\_id |
| id                                            | return\_id         |
| exchange\_id                                  | exchange\_id       |
| order\_name                                   | order\_code        |
| product\_id                                   | product\_id        |
| variant\_id                                   | variant\_id        |
| sku                                           | sku                |
| type                                          | type               |
| title                                         | title              |
| price                                         | price              |
| discount                                      | discount           |
| tax                                           | tax                |
| total                                         | total              |
| MD5(id + exchange\_line\_id + \_\_source\_id) | \_\_sync\_key      |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.daasity.com/core-concepts/data-integrations/setup-guides/digital-integrations/loop-returns/integration-specifications.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
