> For the complete documentation index, see [llms.txt](https://docs.chord.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chord.co/connect-sources/data-sources/e-commerce-data-ingestion.md).

# E-commerce data ingestion

## E-commerce data ingestion

Chord can ingest data from different e-commerce systems for analysis. Two methods are available:

1. **Chord Ingest** (preferred): a Chord-built system that will pull data from a customer's e-commerce system.
2. **Chord API** (optional): customers can use Chord's REST API to push data from their source system. Reach out to us at <help@chord.co> for more details.

## Chord ingest

Chord Ingest is Chord's solution for customer not using Shopify (e.g. Magento, BigCommerce, SalesForce Commerce Cloud). To get started, simply input the URL for your system and a valid API key into your Chord instance.

![](https://2938842758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F5Oy2IAsu7IvAGAlWgC36%2Fuploads%2Fgit-blob-ed0ac3cfb29f4a0549f1bec17c0a3b89f7af3be7%2Fe-commerce-data-ingestion-1.png?alt=media)

That's it!

### Sample data mapping

Since different e-commerce platforms use different names for equivalent records, the table below shows how source records are mapped to Chord's data model.

Below is an example of a data mapping from Magento, a common e-commerce system, and Chord:

#### Product

| Chord        | Magento                             |
| ------------ | ----------------------------------- |
| Name         | `name`                              |
| Slug         | Combination of the `name` and `id`. |
| SKU          | `sku`                               |
| External ID  | `id`                                |
| Product Type | `type_id`                           |

#### Variant

| Chord       | Magento |
| ----------- | ------- |
| SKU         | `sku`   |
| Price       | `price` |
| External ID | `id`    |

#### Order

| Chord              | Magento                                                                                                                                                                                                                                                            |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Line items         | `order.items[]`                                                                                                                                                                                                                                                    |
| Discount           | `order.items[].discount_*`                                                                                                                                                                                                                                         |
| Tax                | `order.items[].tax_*`                                                                                                                                                                                                                                              |
| Customer           | `order.customer_*`                                                                                                                                                                                                                                                 |
| Billing address    | `order.billing_address`                                                                                                                                                                                                                                            |
| Shipping address   | `order.shipping_address`                                                                                                                                                                                                                                           |
| Number             | `increment_id`                                                                                                                                                                                                                                                     |
| State              | Depends on ...                                                                                                                                                                                                                                                     |
| Payment state      | <p>Depends on <code>total\_due</code>:<br>- If <code>total\_due</code> > 0: <code>balance\_due</code><br>- If <code>total\_due</code> < 0: <code>credit\_owed</code><br>- If <code>total\_due</code> == 0: <code>paid</code><br>- Otherwise: <code>void</code></p> |
| Shipment state     | <p>Depends on <code>status</code>:<br>- <code>pending</code>: <code>pending</code><br>- <code>processing</code>: <code>ready</code><br>- <code>complete</code>: <code>shipped</code></p>                                                                           |
| Email              | `email`                                                                                                                                                                                                                                                            |
| Currency           | `base_currency_code`                                                                                                                                                                                                                                               |
| Item total         | `subtotal`                                                                                                                                                                                                                                                         |
| Total              | `grand_total`                                                                                                                                                                                                                                                      |
| Adjustment total   | `grand_total` - `subtotal`                                                                                                                                                                                                                                         |
| Shipment total     | `shipping_incl_tax`                                                                                                                                                                                                                                                |
| Promo total        | `discount_amount`                                                                                                                                                                                                                                                  |
| Payment total      | `total_paid`                                                                                                                                                                                                                                                       |
| Item count         | `total_item_count`                                                                                                                                                                                                                                                 |
| Channel            | `chord`                                                                                                                                                                                                                                                            |
| Included tax total | `base_subtotal_incl_tax`                                                                                                                                                                                                                                           |
| External ID        | `id`                                                                                                                                                                                                                                                               |

#### Line item

| Chord                | Magento                                |
| -------------------- | -------------------------------------- |
| Quantity             | `qty_ordered`                          |
| Additional tax total | `tax_amount`                           |
| Price                | `price`                                |
| External ID          | `item_id`                              |
| SKU                  | `sku`                                  |
| Adjustment total     | `additional_tax_total` + `promo_total` |
| Slug                 | `name`                                 |
| Promo total          | `discount_amount`                      |

#### Line item discount

| Chord         | Magento                   |
| ------------- | ------------------------- |
| Adjustable ID | `line_item.id`            |
| Amount        | `discount_amount`         |
| Order ID      | `line_item.order.id`      |
| External ID   | "`line_item.id`-discount" |

#### Line item tax

| Chord         | Magento              |
| ------------- | -------------------- |
| External ID   | "`line_item.id`-tax" |
| Adjustable ID | `line_item.id`       |
| Amount        | `tax_amount`         |
| Order ID      | `line_item.order.id` |

#### Payment

| Chord  | Magento                                                              |
| ------ | -------------------------------------------------------------------- |
| Amount | `amount_paid`                                                        |
| State  | If `amount_paid == amount_ordered`, then `paid`; `pending` otherwise |
| Number | "`entity_id`-`method`"                                               |

#### Shipment

| Chord           | Magento                |
| --------------- | ---------------------- |
| Inventory units | `shipment.items[]`     |
| External ID     | `entity_id`            |
| Number          | `entity_id`            |
| State           | `order.shipment_state` |
| Cost            | `order.shipment_total` |
| Shipped At      | `created_at`           |

#### Inventory unit

| Chord       | Magento                                                                                                           |
| ----------- | ----------------------------------------------------------------------------------------------------------------- |
| External ID | "`order_item_id`-`index`"; where `index` is a counter of the number of inventory units listed under the shipment. |
| SKU         | `sku`                                                                                                             |
| Variant ID  | Query the Chord database for the variant by `sku` and use the `id`                                                |

#### User

| Chord | Magento                                    |
| ----- | ------------------------------------------ |
| Name  | "`customer_firstname` `customer_lastname`" |
| Email | `customer_email`                           |

#### Address

| Chord       | Magento                                                                    |
| ----------- | -------------------------------------------------------------------------- |
| City        | `city`                                                                     |
| External ID | `entity_id`                                                                |
| Firstname   | `firstname`                                                                |
| Lastname    | `lastname`                                                                 |
| Address 1   | `street.first`                                                             |
| Address 2   | `street.second`                                                            |
| Zipcode     | `postcode`                                                                 |
| Phone       | `telephone`                                                                |
| State       | Query the Chord database for the `region_code` and return the state ID     |
| Country     | Query the Chord database where `iso: country_id` and return the country ID |

### How it works

When a product is synced, all associated variants are also synced.

When an order is synced, all associated records are also synced:

* Line items
  * Discount
  * Tax
* Shipments
  * Inventory units
* Customer
* Billing address
* Shipping address
* Payments

Chord replicates data 1-1 from the source system, performing the minimum transformations necessary for successful replication.

Chord syncs data daily from a customer's e-commerce system:

1. Product sync: sync all products and variants in the customer's catalogue.
2. Order sync: sync completed orders and associated records updated in the previous 24 hours.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chord.co/connect-sources/data-sources/e-commerce-data-ingestion.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
