> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nekt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Conecta Lá as a data source

> Bring the orders, order items, products, stock, prices and catalog data of your store on a Conecta Lá marketplace (such as Privalia) to Nekt.

Conecta Lá is a Brazilian marketplace platform: several marketplaces run their seller center on it, Privalia among them. If you sell on one of these marketplaces, your store has an API on Conecta Lá. This connector brings to the Catalog your store's orders (with payment, shipping and invoice data), the items of each order, your products with their variations (sizes, colors), stock and prices, and the categories and brands of the seller center.

> [!NOTE]
>
> The connector only reads data. It never changes an order, a product, a price or a stock level, and it does not touch the order queue your other integrations (ERP, hub) consume.

## Before you start

The connector authenticates with the credentials of your store's API integration in Conecta Lá. You need:

* The **API URL** of the marketplace where your store sells. Each marketplace on Conecta Lá has its own address, given by Conecta Lá (or by the marketplace) when the integration is enabled. The test environment, for example, is `https://teste.conectala.com.br/app`.
* The **e-mail** of the integration user, the **API key** and the **store code** of your store.
* The **application ID**, if Conecta Lá issued one for your integration.

**1. Ask for the integration to be enabled**

If your store does not have an API integration yet, ask your marketplace's seller support how to enable it. For Privalia, the integration is requested from Conecta Lá: the integrator fills in Conecta Lá's application registration form, and a test environment can be requested by e-mail to the Conecta Lá partnerships team, informing your operation (store). Ask them for the production **API URL** of your marketplace as well.

**2. Copy the API key and the store code**

In the Conecta Lá seller panel, open the side menu and go to **Integração**. Open (or request) the integration and copy its **API key**. The **store code** is shown in your store's profile. Use the e-mail of the user the integration belongs to.

> [!TIP]
>
> The test environment is only available from 7 am to 9 pm (Brasília time). Use the production API URL for the source that feeds your Catalog.

## Configuring Conecta Lá as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Conecta Lá option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

The following configurations are available:

* **API URL**: the base address of your marketplace's Conecta Lá API, for example `https://teste.conectala.com.br/app`. It must start with `https://`; if you paste it with `/Api/V1` at the end, that part is removed.

* **User E-mail**: the e-mail of your store's integration user.

* **API Key**: the API key of your store's integration.

* **Store Code**: the code (ID) of your store in Conecta Lá.

* **Application ID** (advanced): the integration ID issued by Conecta Lá. Fill it only if you received one.

* **Start Date**: orders placed on or after this date are read. Products, variations, categories and brands are always read in full.

* **Lookback Days** (advanced): (Default: 120) each run reads again the orders placed in this many days before the most recent order already read, to update their status. Delivered or cancelled orders are also updated in this period (for example, returns). From 0 to 365.

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis.

> Tip: The stream can be found more easily by typing its name.

**Order Items** and **Product Variations** come in the same answers as **Orders** and **Products**, so they cost no extra requests.

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.

* **Layer**: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
* **Folder**: a folder can be created inside the selected layer to group all tables being created from this new data source.
* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** to all tables at once and make this process faster!
* **Sync Type**: **Orders** and **Order Items** are INCREMENTAL (recommended): each run reads the orders placed since the last run, plus the lookback. The other streams are FULL\_TABLE: Conecta Lá has no filter by update date for products, so the whole catalog is read on every run. Read more about Sync Types [here](https://docs.nekt.com/get-started/core-concepts/types-of-sync).

> [!WARNING]
>
> Keep **Order Items** with the same sync type as **Orders**. If Orders is incremental and Order Items is set to full table, the run stops: the Order Items table would be replaced by the items of recent orders only.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers.md), consider how often you want data to be extracted from this source. Once or a few times a day is enough for most uses.

Optionally, you can define some additional settings:

* Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource [here](https://docs.nekt.com/get-started/core-concepts/resource-control).
* Determine when to execute an [Additional Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync).

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

> [!WARNING]
>
> For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.

> [!NOTE]
>
> Each run first checks the API URL and the credentials, and makes one small request to each list the selected streams read, so a wrong address, credential or missing permission stops the run before any table is written. Each stream is read completely before any of its data is sent to your Catalog, so a run that fails while reading does not change that table. If a list changes while it is read in a way that could leave rows out, it is read again; if that keeps happening, the run stops instead of saving an incomplete table. New orders that arrive during the read do not stop the run.

## How the data is organized

* **Orders** has one row per order, with its status, amounts, shipping, invoice and customer data. The most used values are columns; the full blocks (`shipping`, `payments`, `items`, `invoice`, `customer`, `billing_address`, `historic`) are kept as JSON text.
* Order statuses keep changing after the order is placed. Each run reads again every order placed in the lookback period (120 days by default), including delivered and cancelled ones. Older orders that were still open (not delivered or cancelled) are also refreshed one by one until they are delivered or cancelled, for up to 180 days after they were placed. After that, an order keeps the last status read; a full sync reads every order again.
* `created_at` and the other timestamps are converted from Brasília time to UTC.
* **Order Items** has one row per item of each order, identified by the order code and the item's position in the order.
* **Products** has one row per product with its stock and prices; **Product Variations** has one row per variation (size, color) with its own SKU, stock and prices.
* **Categories** and **Brands** are the lists of the seller center; **Store** has one row with your store's data.

## Troubleshooting

| What the run log says | What to do |
| :- | :- |
| The API URL of this source does not lead to a Conecta La API | Check the address: it is the API address of your marketplace on Conecta Lá (for example `https://<host>/app`), not the address of the seller panel or of the marketplace's store. |
| Conecta La answered 'not found' to a request of this source with an unexpected message | Check the store code and the API URL. If they are right, contact Nekt support. |
| Conecta La refused the credentials of this source | Check the user e-mail, the API key and the store code (and the application ID, if you have one) in **Integração** in the seller panel, and that the API URL is the one of the marketplace where your store sells. |
| Conecta La denied access to part of the data of this source (403) | Ask Conecta Lá to enable your store's API for orders and products. |
| Conecta La's list of orders (or products) kept changing or skipping pages | Run the sync again later. If it repeats, contact Nekt support. |
| Conecta La is limiting the number of requests | No action needed: the run waits and retries, so it takes longer. |

# Streams and Fields

## Available streams

The table below lists every stream, its **slug** (the exact identifier to pass when creating the source via API) and a short description.

| Stream | Slug | Description |
| - | - | - |
| Orders | `orders` | Orders of the store, with status, amounts, shipping, invoice and customer data. |
| Order Items | `order_items` | One row per item of each order. |
| Products | `products` | Products of the store, with stock, prices, brand and categories. |
| Product Variations | `product_variations` | Variations of each product (size, color), with their own SKU, stock and prices. |
| Categories | `categories` | Categories of the seller center. |
| Brands | `brands` | Brands available in the seller center. |
| Store | `store` | Data of the store of the credentials. |

Amounts are decimals in BRL. Timestamps are in UTC. Lists of objects are JSON text.

> [!NOTE]
>
> The connector was built from Conecta Lá's API documentation; the first runs confirm details the documentation does not cover, such as the time zone of the timestamps.

## Fields by stream

> **Orders**
>
> Table: `orders` · Primary key: `code` · Sync: Incremental (`created_at`), the lookback period re-read on every run
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `code` | String | Order code in Conecta La (unique per seller center); primary key |
> | `marketplace_number` | String | Order number in the marketplace where the sale happened |
> | `system_marketplace_code` | String | Code of the marketplace (sales channel system) where the order was placed |
> | `sales_channel` | String | Sales channel identifier of the order |
> | `sales_model` | String | Sales model of the order, when the marketplace informs it |
> | `created_at` | Datetime | Date and time the order was placed (converted to UTC from Brasilia time); used as the incremental replication key |
> | `store_code` | String | Code of the seller store in Conecta La |
> | `company_code` | String | Code of the seller company in Conecta La |
> | `status_code` | Integer | Order status code (1 awaiting payment, 3 awaiting invoice, 5 in transit, 6 delivered, 95-97 cancelled, among others) |
> | `status_label` | String | Order status name as shown by Conecta La |
> | `status_sync` | String | Synchronization status of the order with the seller's integration (for example SYNCED or NOT\_SYNCED) |
> | `is_incomplete` | Boolean | Whether Conecta La flags the order as incomplete |
> | `commission_returned` | Boolean | Whether the marketplace commission of the order was returned |
> | `commission_returned_date` | Datetime | When the marketplace commission was returned (UTC) |
> | `gross_amount` | Decimal | Gross amount of the order (products plus freight), in BRL |
> | `net_amount` | Decimal | Net amount of the order, in BRL |
> | `payment_seller_amount` | Decimal | Amount due to the seller for the order, in BRL |
> | `discount` | Decimal | Discount applied to the order, in BRL |
> | `service_charge` | Decimal | Service charge of the order, in BRL |
> | `total_products` | Decimal | Total value of the products of the order, in BRL |
> | `qty_parcels` | Integer | Number of installments of the payment |
> | `date_payment` | Datetime | Date and time the order was paid (UTC) |
> | `campaign_commission` | Decimal | Commission related to marketplace campaigns, in BRL (campaing\_comission in the API) |
> | `marketplace_refund` | Decimal | Amount refunded by the marketplace, in BRL |
> | `logistic_by` | String | Who handles the logistics of the order (for example seller or marketplace) |
> | `shipping_cost` | Decimal | Freight charged to the customer, in BRL |
> | `seller_shipping_cost` | Decimal | Freight cost borne by the seller, in BRL |
> | `shipping_carrier` | String | Shipping carrier of the order |
> | `shipping_service_method` | String | Shipping service or method (for example PAC) |
> | `tracking_code` | String | Tracking code of the shipment |
> | `shipped_date` | Datetime | Date and time the order was shipped (UTC) |
> | `delivered_date` | Datetime | Date and time the order was delivered (UTC) |
> | `estimated_delivery` | Date | Estimated delivery date |
> | `cross_docking_deadline` | Date | Deadline for the seller to dispatch the order |
> | `invoice_number` | String | Number of the invoice (NF-e) of the order |
> | `invoice_series` | String | Series of the invoice (NF-e) of the order |
> | `invoice_key` | String | Access key of the invoice (NF-e) of the order |
> | `invoice_value` | Decimal | Value of the invoice of the order, in BRL |
> | `invoice_date` | Datetime | Issue date and time of the invoice (UTC) |
> | `customer_id` | String | Identifier of the customer in Conecta La |
> | `customer_name` | String | Name of the customer |
> | `customer_person_type` | String | Customer type: pf (individual) or pj (company) |
> | `shipping` | String (JSON) | Full shipping block of the order: carrier, service, dates, labels, delivery address and tracking status (JSON object) |
> | `payments` | String (JSON) | Full payment block of the order: amounts, commissions and installments (JSON object) |
> | `items` | String (JSON) | Items of the order as returned by the API (JSON array); also available row by row in the order\_items stream |
> | `invoice` | String (JSON) | Invoice (NF-e) data of the order (JSON object) |
> | `customer` | String (JSON) | Customer data of the order: name, documents, e-mail and phones (JSON object) |
> | `billing_address` | String (JSON) | Billing address of the order (JSON object) |
> | `historic` | String (JSON) | Status history of the order, with the date of each status (JSON array) |

> **Order Items**
>
> Table: `order_items` · Primary key: `order_code`, `item_index` · Sync: Incremental (`order_created_at`), together with Orders
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `order_code` | String | Code of the order the item belongs to (orders.code) |
> | `item_index` | Integer | Position of the item in the order (0 for the first item); part of the primary key |
> | `order_created_at` | Datetime | Date and time the order was placed (UTC); used as the incremental replication key |
> | `product_id` | String | Identifier of the product in Conecta La |
> | `sku` | String | SKU of the product sold |
> | `sku_variation` | String | SKU of the variation sold, when the product has variations |
> | `variant_order` | String | Position of the variation inside the product, when the product has variations |
> | `sku_integration` | String | SKU of the item in the seller's integration |
> | `sku_marketplace` | String | SKU of the item in the marketplace |
> | `remote_store_id` | String | Store code of the item in Conecta La |
> | `name` | String | Name of the product sold |
> | `qty` | Decimal | Quantity sold |
> | `unity` | String | Unit of the quantity (for example Un) |
> | `original_price` | Decimal | Unit price before discounts, in BRL |
> | `total_price` | Decimal | Total price of the item, in BRL |
> | `discount` | Decimal | Discount on the item, in BRL |
> | `freight_service_fee` | Decimal | Freight service fee charged on the item, in BRL |
> | `product_fee` | Decimal | Fee charged on the product, in BRL |
> | `gross_weight` | Decimal | Gross weight of the item |
> | `width` | Decimal | Width of the item |
> | `height` | Decimal | Height of the item |
> | `depth` | Decimal | Depth of the item |
> | `measured_unit` | String | Unit of the dimensions (for example cm) |
> | `commission_hierarchy_value` | Decimal | Commission value applied to the item by the commission hierarchy |
> | `commission_hierarchy_level` | String | Level of the commission hierarchy applied to the item |
> | `commission_hierarchy_id` | String | Identifier of the commission hierarchy rule applied to the item |
> | `campaigns` | String (JSON) | Marketplace campaigns applied to the item (JSON array) |
> | `returns` | String (JSON) | Returns registered for the item (JSON array; 'return' in the API) |

> **Products**
>
> Table: `products` · Primary key: `product_id` · Sync: Full table
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `product_id` | String | Identifier of the product in Conecta La; primary key |
> | `sku` | String | SKU of the product in the seller's catalog |
> | `store_id` | String | Code of the seller store in Conecta La |
> | `product_catalog_id` | String | Identifier of the catalog product, when the product belongs to a marketplace catalog |
> | `name` | String | Product name |
> | `description` | String | Product description (HTML) |
> | `status` | String | Product status: enabled or disabled |
> | `qty` | Decimal | Stock quantity of the product (sum of its variations when it has them) |
> | `price` | Decimal | Selling price, in BRL |
> | `list_price` | Decimal | List price (price before discount), in BRL |
> | `brand` | String | Brand (manufacturer) of the product |
> | `ean` | String | EAN (barcode) of the product |
> | `ncm` | String | NCM (Mercosur tax classification) code of the product |
> | `manufacturer_code` | String | Manufacturer's code of the product |
> | `warranty` | Integer | Warranty of the product, in months |
> | `origin` | Integer | Tax origin code of the product (0 national, 1 imported, etc.) |
> | `operating_term` | Integer | Handling time of the product, in days, when informed |
> | `items_per_package` | Integer | Number of items per package |
> | `weight_gross` | Decimal | Gross (packed) weight, in kg |
> | `weight_liquid` | Decimal | Net weight, in kg |
> | `height` | Decimal | Packed height, in cm |
> | `width` | Decimal | Packed width, in cm |
> | `length` | Decimal | Packed length, in cm |
> | `height_liquid` | Decimal | Unpacked height, in cm |
> | `width_liquid` | Decimal | Unpacked width, in cm |
> | `length_liquid` | Decimal | Unpacked length, in cm |
> | `stock_updated_at` | Datetime | When the stock was last updated (UTC), when the API informs it |
> | `variation_count` | Integer | Number of variations of the product (rows in product\_variations) |
> | `categories` | String (JSON) | Categories of the product, with code and name (JSON array) |
> | `images` | String (JSON) | Image URLs of the product (JSON array) |
> | `variations` | String (JSON) | Variations of the product as returned by the API (JSON array); also available row by row in product\_variations |
> | `variation_attributes` | String (JSON) | Attributes that define the variations of the product (JSON array) |
> | `published_marketplace` | String (JSON) | Marketplaces where the product is published, with its id in each (JSON object) |
> | `marketplace_offer_links` | String (JSON) | Links to the product's offers in each marketplace (JSON array) |
> | `price_values` | String (JSON) | Catalog pricing data (discount, maximum discount, suggested price), when the product belongs to a catalog (JSON array; 'values' in the API) |
> | `vtex_ref_id` | String (JSON) | VTEX reference ids of the product, for catalog products (JSON array) |
> | `vtex_sku_id` | String (JSON) | VTEX SKU ids of the product, for catalog products (JSON array) |

> **Product Variations**
>
> Table: `product_variations` · Primary key: `product_id`, `variant_id` · Sync: Full table, together with Products
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `product_id` | String | Identifier of the parent product (products.product\_id) |
> | `variant_id` | String | Identifier of the variation in Conecta La |
> | `sku` | String | SKU of the variation |
> | `ean` | String | EAN (barcode) of the variation |
> | `qty` | Decimal | Stock quantity of the variation |
> | `price` | Decimal | Selling price of the variation, in BRL |
> | `list_price` | Decimal | List price (price before discount) of the variation, in BRL |
> | `attributes` | String (JSON) | Values that define the variation, such as size and color, merged into one object (JSON object) |
> | `images` | String (JSON) | Image URLs of the variation (JSON array) |
> | `published_marketplace` | String (JSON) | Marketplaces where the variation is published, with its id in each (JSON object) |

> **Categories**
>
> Table: `categories` · Primary key: `code` · Sync: Full table
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `code` | String | Category code; primary key |
> | `name` | String | Full category path (for example 'COZINHA > PANELAS') |
> | `status` | String | Category status: enabled or disabled |
> | `update_date` | Datetime | When the category was last updated (UTC) |
> | `volume_code` | String | Code of the product type (volume) of the category |
> | `volume_name` | String | Name of the product type (volume) of the category |

> **Brands**
>
> Table: `brands` · Primary key: `code` · Sync: Full table
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `code` | String | Brand code; primary key |
> | `name` | String | Brand name |

> **Store**
>
> Table: `store` · Primary key: `store_key` · Sync: Full table
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `store_key` | String | Store code used by this source (x-store-key); primary key |
> | `code` | String | Code returned by Conecta La with the store data |
> | `fantasy_name` | String | Trade name of the store |
> | `company_name` | String | Legal name of the store's company |
> | `identification` | String | Identification document (CNPJ) of the store |
> | `created_at` | Datetime | When the store was created in Conecta La (UTC) |
> | `raw` | String (JSON) | Every field returned for the store (JSON object) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.