> ## 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.

# Lixlog as a data source

> Bring data from Lixlog to Nekt.

Lixlog is a Brazilian freight and logistics platform. It quotes shipping across multiple carriers, books the collection at your warehouse and tracks the delivery through to the addressee. This connector brings that whole operation into your catalog: the shipments and their delivery status, the carrier tracking events, the collection requests, and the full history of freight quotes with every carrier option that was offered.

## Configuring Lixlog 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 Lixlog option from the list of connectors.

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

### 1. Add account access

You'll need the API token of your Lixlog account. Generate it in the Lixlog panel; it starts with `flx_`.

The following configurations are available:

* **API token**: The API token of your Lixlog account. It is stored encrypted and is sent to Lixlog as a bearer token.

* **Initial sync date**: (Advanced) The starting point for orders, pickups and freight quote history. Products, warehouses and carriers are always read in full. When left empty, orders and pickups load their entire history and freight quotes load the last 90 days.

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. You can select entire groups of streams or pick specific ones.

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

<Note>
  Lixlog only exposes tracking events one shipment at a time, so the **Order Trackings** stream makes one request per order. On accounts with a large order history the extraction takes considerably longer with this stream selected. Leave it unselected if you do not need the carrier's event-by-event history.
</Note>

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**: you can choose between INCREMENTAL and FULL\_TABLE.
  * Incremental: every time the extraction happens, we'll get only the new data - which is good if, for example, you want to keep every record ever fetched.
  * Full table: every time the extraction happens, we'll get the current state of the data - which is good if, for example, you don't want to have deleted data in your catalog.

<Note>
  Orders and pickups change over their lifetime — an order created today is delivered days later — so INCREMENTAL keeps them up to date by their last update timestamp. Freight quotes are never edited after the fact, so their history only ever grows. Products, warehouses and carriers are small reference tables and are read in full on every run.
</Note>

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), consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).

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)**. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.

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.</Warning>

# Streams and Fields

## Available streams

| Stream          | Slug              | Sync        | Description                                                                                     |
| --------------- | ----------------- | ----------- | ----------------------------------------------------------------------------------------------- |
| Orders          | `orders`          | Incremental | Shipments registered in Lixlog, with carrier, warehouse, addressee, invoice and delivery status |
| Order Trackings | `order_trackings` | Full table  | Carrier tracking events for each order                                                          |
| Pickups         | `pickups`         | Incremental | Collection requests placed with the carriers                                                    |
| Quotation Logs  | `quotation_logs`  | Incremental | Freight quotes answered, with every carrier option offered                                      |
| Products        | `products`        | Full table  | Products with the weight and dimensions freight is priced from                                  |
| Warehouses      | `warehouses`      | Full table  | Shipping origins registered in the account                                                      |
| Carriers        | `carriers`        | Full table  | Carriers available to the account                                                               |

<Note>
  Some columns hold structured data that is stored as a JSON string — for example the items of an order, the packages of a product, or the carrier options of a quote. Use your warehouse's JSON functions to expand them in a Query or Notebook.
</Note>

## Fields by stream

Below you'll find all available data streams from Lixlog and their corresponding fields:

<AccordionGroup>
  <Accordion title="Orders">
    The central table of the connector: one row per shipment.

    **Key Fields:**

    * `id` - Unique identifier of the order in Lixlog
    * `reference` - Order identifier in your own system
    * `tracking_code` - Tracking code Lixlog assigned to the order, used to join the Order Trackings stream
    * `carrier_tracking_code` - Tracking code the carrier assigned to the shipment
    * `status` - Current delivery status, such as `initial`, `available_for_pickup`, `in_transit`, `out_for_delivery`, `delivered`, `failure` or `cancelled`

    **Delivery timeline:**

    * `leadtime` - Number of days the carrier committed to for this delivery
    * `pickuped_at` - When the carrier collected the order at the warehouse
    * `out_for_delivery_at` - When the order went out for its final delivery attempt
    * `delivered_at` - When the order was delivered to the addressee
    * `archived_at` - When the order was archived in Lixlog
    * `created_at` - When the order was created in Lixlog
    * `updated_at` - When the order was last updated (incremental replication key)

    **Carrier and origin:**

    * `carrier_id` - Identifier of the carrier moving this order, joins the Carriers stream
    * `carrier_name` - Legal name of the carrier
    * `carrier_federal_tax` - CNPJ of the carrier
    * `warehouse_id` - Identifier of the warehouse the order ships from, joins the Warehouses stream
    * `warehouse_name` - Name of the warehouse the order ships from
    * `selected_rate_id` - Identifier of the freight rate chosen for this order

    **Addressee:**

    * `addressee_name` - Name of the person or company receiving the shipment
    * `addressee_email` - Email address of the addressee
    * `addressee_phone` - Phone number of the addressee
    * `addressee_federal_tax` - CPF or CNPJ of the addressee
    * `addressee_street` - Street name of the delivery address
    * `addressee_number` - Street number of the delivery address
    * `addressee_complement` - Additional address information, such as unit or floor
    * `addressee_neighborhood` - Neighborhood of the delivery address
    * `addressee_city` - City of the delivery address
    * `addressee_state` - State of the delivery address, as a two-letter code
    * `addressee_zip` - Postal code (CEP) of the delivery address
    * `addressee_residential` - Whether the address is residential, which some carriers price differently
    * `addressee_id` - Identifier of the address record in Lixlog
    * `addressee_created_at` - When the address was created in Lixlog
    * `addressee_updated_at` - When the address was last updated in Lixlog

    **Invoice:**

    * `invoice_id` - Identifier of the invoice (nota fiscal) attached to the order
    * `invoice_number` - Number of the invoice
    * `invoice_serie` - Series of the invoice
    * `invoice_key` - Access key (chave de acesso) of the electronic invoice
    * `supplier_invoice_id` - Identifier of the supplier's invoice, when the order carries one

    **Account:**

    * `company_id` - Identifier of the Lixlog account the order belongs to
    * `created_by_id` - Identifier of the Lixlog user who created the order
    * `review_id` - Identifier of the delivery review left for this order
    * `link_tracking` - Public URL where the addressee can follow the delivery

    **Nested data (JSON strings):**

    * `items` - Products shipped in this order: reference (SKU), price, weight, volume, quantity and package dimensions
    * `warehouse_address` - Full address of the warehouse the order ships from
  </Accordion>

  <Accordion title="Order Trackings">
    Tracking events reported by the carrier for each order. One row per event.

    **Key Fields:**

    * `order_id` - Identifier of the order this event belongs to, joins the Orders stream
    * `tracking_code` - Lixlog tracking code the event was reported against
    * `id` - Unique identifier of the tracking event
    * `status` - Delivery status this event puts the shipment in: `in_transit`, `out_for_delivery`, `delivered` or `failure`

    **Event detail:**

    * `title` - Short title of the event
    * `message` - Full description of what happened to the shipment
    * `code` - Event code reported by the carrier, when the carrier sends one
    * `city` - City where the event was recorded
    * `state` - State where the event was recorded
    * `occurred_at` - When the event happened
    * `delivery_date` - Delivery date the carrier reported with this event
    * `created_at` - When Lixlog recorded the event
  </Accordion>

  <Accordion title="Pickups">
    Collection requests placed with the carriers, one row per request.

    **Key Fields:**

    * `id` - Unique identifier of the pickup in Lixlog
    * `status` - Current status of the request, such as `initial`, `accepted`, `cancelled` or `finished`
    * `pickup_date` - Date and time scheduled with the carrier for the collection
    * `carrier_pickup_code` - Code the carrier assigned to this request
    * `note` - Free-text note sent to the carrier with the request

    **Lifecycle:**

    * `accepted_at` - When the carrier accepted the request
    * `performed_at` - When the carrier actually performed the collection
    * `finished_at` - When the collection was closed in Lixlog
    * `canceled_at` - When the request was cancelled
    * `created_at` - When the request was created in Lixlog
    * `updated_at` - When the request was last updated (incremental replication key)

    **Carrier and origin:**

    * `carrier_id` - Identifier of the carrier asked to collect, joins the Carriers stream
    * `carrier_name` - Legal name of the carrier
    * `carrier_federal_tax` - CNPJ of the carrier
    * `warehouse_id` - Identifier of the warehouse the collection happens at, joins the Warehouses stream
    * `warehouse_name` - Name of the warehouse the collection happens at

    **Carrier integration:**

    * `integration_status` - Outcome of the automated request Lixlog sent to the carrier's own system
    * `company_id` - Identifier of the Lixlog account the pickup belongs to
    * `created_by_id` - Identifier of the Lixlog user who requested the collection
    * `link_public_url` - Public URL the carrier uses to see and confirm this collection

    **Nested data (JSON strings):**

    * `integration_request` - Payload Lixlog sent to the carrier's system to book the collection
    * `integration_response` - Response the carrier's system returned for the booking
    * `warehouse_address` - Full address of the warehouse the collection happens at
  </Accordion>

  <Accordion title="Quotation Logs">
    Every freight quote Lixlog answered, with all the carrier options it returned. This is the freight-pricing history: what a shipment could have cost, next to what it did cost in the Orders stream.

    **Key Fields:**

    * `id` - Unique identifier of the quote request, and its incremental replication key
    * `channel` - Sales channel the quote was requested from, when the caller identified one
    * `zip_from` - Origin postal code (CEP) the freight was quoted from
    * `zip_to` - Destination postal code (CEP) the freight was quoted to

    **Quote summary:**

    * `quoted_options_count` - Number of carrier options returned. Zero means no carrier could serve the route, which is the signal to look for coverage gaps
    * `min_freight_value` - Cheapest final freight price among the options returned

    **Nested data (JSON strings):**

    * `request` - What was asked to be quoted. Its `parcels` array carries one entry per package with the declared price, weight, dimensions, quantity and product reference
    * `response` - Every carrier option returned: the final freight price, Lixlog's own cost, the delivery estimate in days, the cubed weight, the carrier (id, code and service) and the freight rules applied
  </Accordion>

  <Accordion title="Products">
    Products registered in Lixlog, with the measurements freight is priced from. This is the table to check when a shipment is quoted heavier or bulkier than expected.

    **Key Fields:**

    * `id` - Unique identifier of the product in Lixlog
    * `reference` - Product code (SKU) in your own system
    * `description` - Description of the product

    **Freight measurements:**

    * `price` - Declared value of one unit, used to insure the shipment
    * `weight` - Weight of one unit, in kilograms
    * `volume` - Total volume of the product's packages, in cubic meters
    * `deadline` - Extra days this product adds to the delivery deadline of an order

    **Timestamps:**

    * `created_at` - When the product was created in Lixlog
    * `updated_at` - When the product was last updated

    **Nested data (JSON strings):**

    * `volumes` - Packages the product ships in, with the height, length and width in meters and the quantity of identical packages
  </Accordion>

  <Accordion title="Warehouses">
    Shipping origins registered in the account.

    **Key Fields:**

    * `id` - Unique identifier of the warehouse in Lixlog
    * `name` - Name of the warehouse
    * `description` - Description of the warehouse
    * `zip` - Postal code (CEP) freight is quoted from for this warehouse
    * `default` - Whether this is the warehouse used when an order does not name one

    **Address:**

    * `address_street` - Street name of the warehouse address
    * `address_number` - Street number of the warehouse address
    * `address_complement` - Additional address information
    * `address_neighborhood` - Neighborhood of the warehouse address
    * `address_city` - City of the warehouse address
    * `address_state` - State of the warehouse address, as a two-letter code
    * `address_zip` - Postal code (CEP) of the warehouse address
    * `address_name` - Contact name at the warehouse
    * `address_email` - Contact email at the warehouse
    * `address_phone` - Contact phone at the warehouse
    * `address_federal_tax` - CPF or CNPJ registered for the warehouse contact
    * `address_residential` - Whether the address is residential
    * `address_id` - Identifier of the address record in Lixlog
    * `address_created_at` - When the address was created in Lixlog
    * `address_updated_at` - When the address was last updated in Lixlog

    **Timestamps:**

    * `created_at` - When the warehouse was created in Lixlog
    * `updated_at` - When the warehouse was last updated
  </Accordion>

  <Accordion title="Carriers">
    Carriers available to the account.

    **Key Fields:**

    * `id` - Unique identifier of the carrier in Lixlog
    * `name` - Legal name of the carrier
    * `display_name` - Short name of the carrier as shown in the Lixlog panel
    * `code` - Lixlog code of the carrier. It is the value that appears as the carrier code in the freight quotes of the Quotation Logs stream

    **Registration:**

    * `tms` - Transport management system Lixlog integrates with to reach this carrier
    * `federal_tax` - CNPJ of the carrier
    * `state_tax` - State tax registration of the carrier
    * `phone` - Contact phone number of the carrier

    **Timestamps:**

    * `created_at` - When the carrier was added in Lixlog
    * `updated_at` - When the carrier was last updated
  </Accordion>
</AccordionGroup>
