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

# Takeat as a data source

> Bring table sessions, payments, financial entries, catalog, stock and received NF-e from Takeat to Nekt.

Takeat is a management platform for restaurants: point of sale, table and counter sessions (comandas), delivery, self-service totems, financial entries, stock and fiscal documents. This connector brings the **table sessions** of your stores with one row per **payment** (amount, change, payment method, the amount expected after the method's fees and the expected settlement date) and per **order line**, plus the **financial entries** (accounts payable and receivable), the **received NF-e**, the **catalog** and the **stock**. It is useful for reconciling sales and receipts with your accounting or ERP system, and for analyzing sales, fees and costs per store.

<Note>
  The connector only reads data. It never creates, changes or cancels anything in Takeat.
</Note>

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

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

### 1. Add account access

The connector uses an **API key** created by the restaurant in Takeat's **AI Builders** portal. To create it:

1. Log in to [AI Builders](https://ai-builders.takeat.app) with the restaurant account. For a network of stores, log in with the network owner account (**Dono de multilojas**) and choose the stores the key can read.
2. Create an API key, give it a name and choose the **Production** environment. Its value starts with `tk_live_`.
3. Grant the read permissions of the data you want: `table-sessions:read` (table sessions, payments and orders), `payment-methods:read`, `financial:read`, `brands:read`, `nfe-received:read`, `products:read`, `complements:read`, `inputs:read` and `intermediaries:read`.
4. Copy the whole key. Takeat shows it only once.

The following configurations are available:

* **API Key**: the key copied above. The connector exchanges it for short-lived access tokens on every run.

* **Start Date**: the earliest date to extract: table sessions started, financial entries due and received NF-e issued on or after this date. We recommend a recent date (for example, the beginning of the current month or year): see the request limit below.

* **Restaurant IDs** (advanced): the ids of the Takeat stores to extract. Leave it empty to extract every store the key gives access to. It is only needed for partner keys that cannot list their stores.

* **Daily Request Limit** (advanced): (Default: 500) how many requests per day Takeat allows this key. Each run only uses what is left of the day. Lower it to leave part of the quota to other integrations that use the same key.

* **Lookback Days** (advanced): (Default: 3) how many days before the last extracted point every run reads again, to pick up table sessions changed after they started (payments, closing, cancellations).

<Warning>
  Takeat limits each API key to **10 requests per minute and 500 per day**, shared with every other integration that uses the same key. Create a key only for Nekt. Each run spends only what is left of the day and stops at a point the next run continues from, so a long history (table sessions, financial entries and NF-e of past months) is loaded over several runs. The sync log says how far each run got.
</Warning>

<Info>
  A key of the **Test** environment (`tk_test_`) is not a sandbox: it reads the restaurant's real data and has the same limits. Use the Production key.
</Info>

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.

<Info>
  Table Session Payments and Table Session Orders come from the same request as Table Sessions, so selecting them costs no extra requests. Each selected stream needs its permission on the API key: the run stops before extracting anything and lists the missing permissions otherwise.
</Info>

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**: Table Sessions, Table Session Payments, Table Session Orders, Financial Entries, Financial Entry Items and Received NF-e support INCREMENTAL, and that is the recommended type for them. The catalog, stock, brands, payment methods and restaurants streams are FULL\_TABLE: they are small and read in full on every run, so your tables always show their current state. Read more about Sync Types [here](https://docs.nekt.com/get-started/core-concepts/types-of-sync).

<Warning>
  Keep the incremental streams as INCREMENTAL. A FULL\_TABLE stream must be read completely before its table is replaced: with a long history, table sessions, financial entries or NF-e do not fit in Takeat's 500 requests per day, and the run stops without writing anything. Payments and orders must use the same sync type as Table Sessions, and Financial Entry Items the same as Financial Entries.
</Warning>

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. Because of Takeat's request limit, schedule it **once or twice a day** (once a day is usually enough for reconciliation). Each run keeps a little room for one more run on the same day, but while a long history is still loading, the first run of the day uses most of the quota.

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).
* **Do not enable an Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)** for this source. A full sync reads all table sessions, financial entries and NF-e since the Start Date before writing them; with a long history it does not fit in Takeat's daily request limit and the run stops without writing anything. The same applies to a full sync triggered manually.

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

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 |
| - | - | - |
| Table Sessions | `table_sessions` | One row per table session (comanda): dine-in, counter, totem and delivery, open and closed, with totals, discounts, service fee, fiscal note (NFC-e) and status timings. |
| Table Session Payments | `table_session_payments` | One row per payment of a table session: amount, change, payment method, the amount expected after the method's fees and the expected settlement date. |
| Table Session Orders | `table_session_orders` | One row per order line of a table session: product, quantity, price, channel and cancellation. |
| Payment Methods | `payment_methods` | Payment methods enabled in each store. |
| Financial Entries | `cash_flows` | Accounts payable and receivable (Financeiro > Lançamentos), paid and open, with supplier, bank account, payment method and linked NF-e. |
| Financial Entry Items | `cash_flow_items` | Items of the financial entries that group several items (purchase invoices and titles). |
| Received NF-e | `received_nfes` | NF-e issued to the store by suppliers, authorized and not canceled, with issuer, total and manifestation. |
| Restaurants | `restaurants` | The stores (restaurants) extracted by this source. |
| Brands | `brands` | Brands of each store, with their trade name and CNPJ, active and inactive. |
| Products | `products` | Products of the catalog with prices, availability, fiscal data and category. |
| Product Categories | `product_categories` | Product categories with their availability per channel. |
| Complements | `complements` | Complements (add-ons) with prices and availability, and the categories that offer them. |
| Complement Categories | `complement_categories` | Complement categories (the questions shown with a product) and their rules. |
| Stock Inputs | `inventory_inputs` | Inputs (raw materials) registered in stock control, with balance, cost and restock levels. |
| Stock Intermediate Products | `inventory_intermediaries` | Intermediate products prepared from inputs, with balance, cost and restock levels. |

## Fields by stream

### Sales and payments

<AccordionGroup>
  <Accordion title="Table Sessions">
    One row per table session (comanda): dine-in, counter, totem and delivery, open and closed, with totals, discounts, service fee, fiscal note (NFC-e) and status timings.

    Table: `table_sessions` · Primary key: `id` · Sync: Incremental (`start_time`)

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat internal id of the table session (not the session number nor the attendance password). |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `session_number` | Integer | Sequence number of the session in the store, as shown to the staff. |
    | `status` | String | Status of the session, e.g. open, closing, completed. |
    | `start_time` | Datetime | When the session started (UTC); the date range filter and the incremental replication key. |
    | `end_time` | Datetime | When the session was closed (UTC). |
    | `completed_at` | Datetime | When the session was completed (UTC). |
    | `accepted_at` | Datetime | When the order was accepted (UTC), from status\_timings. |
    | `ready_at` | Datetime | When the order was ready (UTC), from status\_timings. |
    | `ongoing_at` | Datetime | When the delivery left for the customer (UTC), from status\_timings. |
    | `delivered_at` | Datetime | When the order was delivered (UTC), from status\_timings. |
    | `delivery_canceled_at` | Datetime | When the delivery was canceled (UTC). |
    | `scheduled_to` | Datetime | Date and time the order was scheduled for (UTC). |
    | `is_delivery` | Boolean | Whether the session is a delivery order. |
    | `with_withdrawal` | Boolean | Whether the delivery order is picked up by the customer. |
    | `delivery_by` | String | Who delivers the order. |
    | `table_number` | Integer | Number of the table (or comanda) of the session. |
    | `table_type` | String | Kind of table, e.g. table, command, delivery. |
    | `attendance_password` | String | Attendance password shown to the customer. |
    | `people_at_table` | Number | Number of people at the table. |
    | `total_price` | Number | Sum of the products, with the session discount applied (BRL). |
    | `total_service_price` | Number | total\_price plus the service fee (BRL). |
    | `old_total_price` | Number | total\_price before the discount (BRL). |
    | `discount_percent` | Number | Discount applied to the session, in percent. |
    | `discount_total` | Number | Discount applied to the session (BRL). |
    | `discount_obs` | String | Note entered with the discount. |
    | `merchant_discount` | Number | Discount paid by the store on marketplace orders (BRL). |
    | `has_tax` | Boolean | Whether the service fee is charged. |
    | `delivery_tax_price` | Number | Delivery fee (BRL). |
    | `total_delivery_price` | Number | Total of the delivery order (BRL). |
    | `delivery_fee_discount` | Number | Discount on the delivery fee (BRL). |
    | `ifood_document` | String | Customer document informed on iFood orders. |
    | `details` | String | Notes of the session. |
    | `motoboy_id` | Integer | Courier assigned to the session. |
    | `motoboy` | String (JSON) | Courier assigned to the session: id, name and phone (JSON object). |
    | `nfce_ref` | String | Reference of the consumer fiscal note (NFC-e) issued for the session. |
    | `nfce_status` | String | Status of the NFC-e, e.g. autorizado. |
    | `nfce_type` | String | Type of fiscal document, e.g. nfce. |
    | `nfce_numero` | String | Number of the NFC-e. |
    | `nfce_total_price` | Number | Total of the NFC-e (BRL). |
    | `nfce_created_at` | Datetime | When the NFC-e was issued (UTC). |
    | `nfce_xml` | String | XML of the NFC-e as returned by Takeat (link or content). |
    | `nfce_html` | String | Printable NFC-e as returned by Takeat (link or content). |
    | `payments` | String (JSON) | Payments of the session as returned by Takeat (JSON array); also one row each in table\_session\_payments. |
    | `bills` | String (JSON) | Individual bills of the session with buyer, waiter, order baskets and orders (JSON array); the orders are also one row each in table\_session\_orders. |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Table Session Payments">
    One row per payment of a table session: amount, change, payment method, the amount expected after the method's fees and the expected settlement date. Read from the same response as Table Sessions, with no extra request.

    Table: `table_session_payments` · Primary key: `id` · Sync: Incremental (`session_start_time`)

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat payment id. |
    | `session_id` | Integer | Table session the payment belongs to; join to table\_sessions.id. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `payment_value` | Number | Amount that counts as revenue, change already deducted (BRL). |
    | `original_value` | Number | Amount handed over by the customer (BRL). |
    | `change` | Number | Change given back to the customer (BRL). |
    | `predicted_received_value` | Number | Amount the store expects to receive for this payment, after the fees configured for the method (BRL). |
    | `predicted_received_date` | Datetime | Date the store expects to receive this payment, from the method's settlement settings (UTC). |
    | `created_at` | Datetime | When the payment was registered (UTC). |
    | `payment_method_id` | Integer | Payment method used; join to payment\_methods.id. |
    | `payment_method_name` | String | Name of the payment method, e.g. Visa Crédito. |
    | `payment_method_keyword` | String | Internal keyword of the payment method. |
    | `payment_method_method` | String | Kind of payment, e.g. CASH, CREDIT, DEBIT, PIX. |
    | `payment_method_brand` | String | Card brand of the payment method, when it applies. |
    | `session_start_time` | Datetime | Start of the table session the payment was read from (UTC), used as the incremental replication key. |
    | `session_status` | String | Status of the table session when the payment was read. |
    | `removed_at` | Datetime | Set when the payment was read before but is no longer in its session (e.g. it was reversed); the other columns are then empty. Filter removed\_at IS NULL for the current payments. |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Table Session Orders">
    One row per order line of a table session: product, quantity, price, channel and cancellation. Read from the same response as Table Sessions, with no extra request.

    Table: `table_session_orders` · Primary key: `id` · Sync: Incremental (`session_start_time`)

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat order (line) id. |
    | `session_id` | Integer | Table session of the order; join to table\_sessions.id. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `bill_id` | Integer | Individual bill (conta) of the session the order belongs to. |
    | `order_basket_id` | Integer | Order basket (cesta) the order belongs to. |
    | `basket_code` | String | Code of the order basket shown to the staff, e.g. 613-3676. |
    | `basket_order_status` | String | Status of the order basket, e.g. pending, accepted. |
    | `basket_channel` | String | Channel the basket was ordered through, e.g. pdv, delivery, totem. |
    | `basket_start_time` | Datetime | When the basket was ordered (UTC). |
    | `basket_canceled_at` | Datetime | When the whole basket was canceled (UTC). |
    | `product_id` | Integer | Product ordered; join to products.id. |
    | `product_name` | String | Name of the product ordered. |
    | `amount` | Number | Quantity ordered. |
    | `weight` | Number | Weight sold, for products sold by weight. |
    | `price` | Number | Unit price of the product (BRL). |
    | `total_price` | Number | Total of the order with complements, without the session discount (BRL). |
    | `total_service_price` | Number | total\_price plus the service fee (BRL). |
    | `canceled_at` | Datetime | When the order was canceled (UTC); null for orders not canceled. |
    | `cancel_reason` | String | Reason entered when the order was canceled. |
    | `details` | String | Notes of the order. |
    | `complement_categories` | String (JSON) | Complements chosen, grouped by complement category (JSON array). |
    | `session_start_time` | Datetime | Start of the table session the order was read from (UTC), used as the incremental replication key. |
    | `session_status` | String | Status of the table session when the order was read. |
    | `removed_at` | Datetime | Set when the order was read before but is no longer in its session; the other columns are then empty. Filter removed\_at IS NULL for the current orders (canceled orders keep their row, with canceled\_at). |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Payment Methods">
    Payment methods enabled in each store.

    Table: `payment_methods` · Primary key: `restaurant_id`, `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat payment method id; join to table\_session\_payments.payment\_method\_id. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `name` | String | Name of the payment method as shown in Takeat, e.g. Dinheiro, Visa Crédito. |
    | `method` | String | Kind of payment, e.g. CASH, CREDIT, DEBIT, PIX. |
    | `brand` | String | Card brand of the method, e.g. VISA, when it applies. |
    | `keyword` | String | Internal keyword of the method, e.g. visa\_credito. |
    | `created_at` | Datetime | When the payment method was created (UTC). |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>
</AccordionGroup>

### Financial

<AccordionGroup>
  <Accordion title="Financial Entries">
    Accounts payable and receivable (Financeiro > Lançamentos), paid and open, with supplier, bank account, payment method and linked NF-e. Recent due dates and open entries are read on every run; older months in turn (see Implementation Notes).

    Table: `cash_flows` · Primary key: `restaurant_id`, `id` · Sync: Incremental (`due_date`)

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat id of the financial entry. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `entry_type` | String | standalone, invoice (purchase note with items), invoice\_item, title (grouped title) or title\_entry. |
    | `is_earning` | Boolean | True for receivables (revenue), false for payables (expenses). |
    | `value` | Number | Amount of the entry (BRL); for invoices and titles it is already the sum of their items. |
    | `paid` | Boolean | Whether the entry was paid (expense) or received (revenue). |
    | `paid_at` | Datetime | When the entry was paid or received (UTC). |
    | `due_date` | Date | Due date of the entry; the date range filter of the listing and the replication key. |
    | `competence_date` | Date | Accrual (competence) date of the entry. |
    | `created_at` | Datetime | When the entry was created (UTC). |
    | `description` | String | Description of the entry. |
    | `information` | String | Additional information entered with the entry. |
    | `category` | String | Cost center as 'Category: Subcategory', e.g. Insumos: Alimentos. |
    | `counts_for_result` | Boolean | Whether the entry counts in the cost center (result) analysis. |
    | `provider_id` | Integer | Supplier of the entry. |
    | `provider_name` | String | Name of the supplier. |
    | `provider_cnpj` | String | CNPJ of the supplier. |
    | `provider_deleted` | Boolean | Whether the supplier was deleted in Takeat. |
    | `bank_account_id` | Integer | Bank account of the entry. |
    | `bank_account_name` | String | Name of the bank account. |
    | `payment_method_id` | Integer | Payment method of the entry. |
    | `payment_method_name` | String | Name of the payment method. |
    | `invoice_numero` | String | Number of the purchase invoice (NF-e) linked to the entry. |
    | `invoice_chave_nfe` | String | Access key of the linked NF-e. |
    | `invoice_data_emissao` | Datetime | Issue date of the linked NF-e (UTC). |
    | `items_count` | Integer | Number of items of an invoice or title (rows in cash\_flow\_items). |
    | `items` | String (JSON) | Items of an invoice or title (JSON array); also one row each in cash\_flow\_items. |
    | `removed_at` | Datetime | Set when the entry was read before but is no longer listed by Takeat (deleted); only the key columns and a due date (its own, or the end of the month it was listed in) are kept. Filter removed\_at IS NULL for the current entries. |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Financial Entry Items">
    Items of the financial entries that group several items (purchase invoices and titles).

    Table: `cash_flow_items` · Primary key: `restaurant_id`, `id` · Sync: Incremental (`due_date`)

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat id of the financial entry. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `entry_type` | String | standalone, invoice (purchase note with items), invoice\_item, title (grouped title) or title\_entry. |
    | `is_earning` | Boolean | True for receivables (revenue), false for payables (expenses). |
    | `value` | Number | Amount of the entry (BRL); for invoices and titles it is already the sum of their items. |
    | `paid` | Boolean | Whether the entry was paid (expense) or received (revenue). |
    | `paid_at` | Datetime | When the entry was paid or received (UTC). |
    | `due_date` | Date | Due date of the entry; the date range filter of the listing and the replication key. |
    | `competence_date` | Date | Accrual (competence) date of the entry. |
    | `created_at` | Datetime | When the entry was created (UTC). |
    | `description` | String | Description of the entry. |
    | `information` | String | Additional information entered with the entry. |
    | `category` | String | Cost center as 'Category: Subcategory', e.g. Insumos: Alimentos. |
    | `counts_for_result` | Boolean | Whether the entry counts in the cost center (result) analysis. |
    | `provider_id` | Integer | Supplier of the entry. |
    | `provider_name` | String | Name of the supplier. |
    | `provider_cnpj` | String | CNPJ of the supplier. |
    | `provider_deleted` | Boolean | Whether the supplier was deleted in Takeat. |
    | `bank_account_id` | Integer | Bank account of the entry. |
    | `bank_account_name` | String | Name of the bank account. |
    | `payment_method_id` | Integer | Payment method of the entry. |
    | `payment_method_name` | String | Name of the payment method. |
    | `invoice_numero` | String | Number of the purchase invoice (NF-e) linked to the entry. |
    | `invoice_chave_nfe` | String | Access key of the linked NF-e. |
    | `invoice_data_emissao` | Datetime | Issue date of the linked NF-e (UTC). |
    | `parent_id` | Integer | Financial entry (invoice or title) the item belongs to; join to cash\_flows.id. |
    | `parent_entry_type` | String | entry\_type of the parent entry. |
    | `removed_at` | Datetime | Set when the item was read before but is no longer in its entry (or the entry was deleted); only the key columns, parent\_id and the parent's due date are kept. |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Received NF-e">
    NF-e issued to the store by suppliers, authorized and not canceled, with issuer, total and manifestation. Recent months are read on every run; older months in turn.

    Table: `received_nfes` · Primary key: `restaurant_id`, `id` · Sync: Incremental (`issued_at`)

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat id of the received NF-e (not the fiscal access key). |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `brand_id` | Integer | Brand originally linked to the note; null for old notes without a brand. |
    | `brand` | String (JSON) | Brand linked to the note, or the default brand used to present it (JSON object). |
    | `access_key` | String | 44-digit access key (chave de acesso) of the NF-e. |
    | `number` | String | Number of the NF-e. |
    | `series` | String | Series of the NF-e. |
    | `state` | String | State (UF) of the NF-e. |
    | `type` | String | Type of the fiscal document. |
    | `issuer_name` | String | Name of the supplier that issued the note. |
    | `issuer_document` | String | CNPJ or CPF of the supplier that issued the note. |
    | `total` | Number | Total amount of the note (BRL). |
    | `situation` | String | Fiscal situation of the note, e.g. autorizada. |
    | `complete` | Boolean | Whether the full document is available (not only a summary). |
    | `manifestation_type` | String | Recipient manifestation: null, ciencia, desconhecimento or confirmacao. |
    | `manifested_at` | Datetime | When the manifestation was made (UTC). |
    | `correction_number` | Integer | Sequence of the last correction letter (CC-e). |
    | `correction_text` | String | Text of the last correction letter. |
    | `correction_issued_at` | Datetime | When the last correction letter was issued (UTC). |
    | `canceled_at` | Datetime | When the note was canceled at the tax authority (UTC). |
    | `cancel_reason` | String | Reason of the fiscal cancellation. |
    | `locally_canceled_at` | Datetime | When the note was canceled locally in Takeat (UTC). |
    | `return_reference` | String | Reference of a return note linked to this note. |
    | `reference` | String | Local integration reference of the note. |
    | `url` | String | Link to the note document. |
    | `provider_id` | Integer | Supplier registered in Takeat for the issuer. |
    | `fiscal_version` | Integer | Version of the fiscal document data. |
    | `fiscal_digest` | String | Digest value of the fiscal document. |
    | `fiscal_sped` | String | SPED data of the note as returned by Takeat. |
    | `issued_at` | Datetime | Issue date of the note (UTC); the date range filter of the listing and the replication key. |
    | `processing_at` | Datetime | When the note was processed (UTC). |
    | `created_at` | Datetime | When the note was registered in Takeat (UTC). |
    | `updated_at` | Datetime | When the note was last updated in Takeat (UTC). |
    | `removed_at` | Datetime | Set when the note was read before but Takeat no longer lists it (canceled); only the key columns and the end of the month it was listed in (issued\_at) are kept. Filter removed\_at IS NULL for the current notes. |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>
</AccordionGroup>

### Stores and brands

<AccordionGroup>
  <Accordion title="Restaurants">
    The stores (restaurants) extracted by this source. Every other table has a `restaurant_id` column to join with it.

    Table: `restaurants` · Primary key: `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat store (restaurant) id. Every other table carries it in restaurant\_id. |
    | `fantasy_name` | String | Public (trade) name of the store; empty when the key cannot list its stores. |
  </Accordion>

  <Accordion title="Brands">
    Brands of each store, with their trade name and CNPJ, active and inactive.

    Table: `brands` · Primary key: `restaurant_id`, `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat brand id. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `name` | String | Registered name of the brand. |
    | `fantasy_name` | String | Trade name of the brand. |
    | `cnpj` | String | CNPJ of the brand, as text (leading zeros kept). |
    | `tax_regime` | String | Tax regime of the restaurant that owns the brand, as registered. |
    | `active` | Boolean | Whether the brand is active (inactive, non-deleted brands are listed too). |
    | `is_default` | Boolean | Whether this is the store's default brand. |
    | `image` | String (JSON) | Brand image file (JSON object with id, path and url), or null. |
    | `created_at` | Datetime | When the brand was created (UTC). |
    | `updated_at` | Datetime | When the brand was last updated (UTC). |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>
</AccordionGroup>

### Catalog and stock

<AccordionGroup>
  <Accordion title="Products">
    Products of the catalog with prices, availability, fiscal data and category.

    Table: `products` · Primary key: `restaurant_id`, `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat product id; join to table\_session\_orders.product\_id. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `category_id` | Integer | Product category; join to product\_categories.id. |
    | `category_name` | String | Name of the product category. |
    | `name` | String | Name of the product. |
    | `description` | String | Description of the product. |
    | `price` | Number | Dine-in price (BRL). |
    | `price_promotion` | Number | Dine-in promotional price (BRL), when there is one. |
    | `delivery_price` | Number | Delivery and pickup price (BRL); when empty the dine-in price applies. |
    | `delivery_price_promotion` | Number | Delivery promotional price (BRL), when there is one. |
    | `available` | Boolean | Whether the product is available for dine-in. |
    | `available_in_delivery` | Boolean | Whether the product is available for delivery and pickup. |
    | `use_weight` | Boolean | Whether the product is sold by weight instead of by unit. |
    | `available_multistore` | Boolean | Whether the product is shared with the other stores of a multistore network. |
    | `ean_codes` | Array of strings | EAN (barcode) codes of the product. |
    | `created_at` | Datetime | When the product was created (UTC). |
    | `pdv_codes` | String (JSON) | Codes of the product in point-of-sale integrations (JSON array of code and integration). |
    | `fiscal_ncm` | String | NCM (Mercosur goods classification) of the product. |
    | `fiscal_cfop` | String | CFOP (tax operation code) registered for the product. |
    | `fiscal_cest` | String | CEST (tax substitution code) of the product. |
    | `fiscal_csosn` | String | CSOSN (ICMS situation code, Simples Nacional) of the product. |
    | `fiscal_cst` | String | CST (ICMS situation code, regular regime) of the product. |
    | `fiscal` | String (JSON) | All fiscal attributes of the product as returned by Takeat (JSON object). |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Product Categories">
    Product categories with their availability per channel.

    Table: `product_categories` · Primary key: `restaurant_id`, `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat product category id. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `brand_id` | Integer | Brand the category belongs to; join to brands.id. |
    | `name` | String | Name of the category. |
    | `available` | Boolean | Whether the category is available for dine-in. |
    | `available_in_delivery` | Boolean | Whether the category is available for delivery. |
    | `available_in_self_service` | Boolean | Whether the category is available in self-service (totem). |
    | `available_in_drive_thru` | Boolean | Whether the category is available in drive-thru. |
    | `custom_order` | Integer | Display order of the category. |
    | `preparation_time` | Integer | Preparation time of the category, in minutes. |
    | `is_exclusive` | Boolean | Whether the category is exclusive to this store. |
    | `created_at` | Datetime | When the category was created (UTC). |
    | `updated_at` | Datetime | When the category was last updated (UTC). |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Complements">
    Complements (add-ons) with prices and availability, and the categories that offer them.

    Table: `complements` · Primary key: `restaurant_id`, `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat complement id. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `category_ids` | Array of integers | Complement categories offering this complement; join to complement\_categories.id. |
    | `name` | String | Name of the complement. |
    | `description` | String | Description of the complement. |
    | `price` | Number | Dine-in price (BRL). |
    | `delivery_price` | Number | Delivery and pickup price (BRL); when empty the dine-in price applies. |
    | `limit` | Integer | Maximum quantity of this complement per order. |
    | `available` | Boolean | Whether the complement is available for dine-in. |
    | `available_in_delivery` | Boolean | Whether the complement is available for delivery. |
    | `active_days` | String | Days of the week the complement is offered. |
    | `enable_times` | Boolean | Whether the complement is offered only at set times. |
    | `created_at` | Datetime | When the complement was created (UTC). |
    | `translations` | String (JSON) | Translations of the name and description (JSON object). |
    | `cccs` | String (JSON) | Fiscal and integration attributes of the complement as returned by Takeat (JSON object). |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Complement Categories">
    Complement categories (the questions shown with a product) and their rules.

    Table: `complement_categories` · Primary key: `restaurant_id`, `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat complement category id. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `brand_id` | Integer | Brand the category belongs to; join to brands.id. |
    | `name` | String | Name of the complement category. |
    | `question` | String | Question shown to the customer. |
    | `minimum` | Integer | Minimum number of complements to choose. |
    | `limit` | Integer | Maximum number of complements to choose. |
    | `optional` | Boolean | Whether choosing is optional. |
    | `single_choice` | Boolean | Whether only one complement can be chosen. |
    | `additional` | Boolean | Whether the complements are charged. |
    | `more_expensive_only` | Boolean | Whether only the most expensive complement is charged. |
    | `use_average` | Boolean | Whether the average price of the chosen complements is charged. |
    | `available` | Boolean | Whether the category is available for dine-in. |
    | `available_in_delivery` | Boolean | Whether the category is available for delivery. |
    | `complement_ids` | Array of integers | Complements offered in this category; join to complements.id. |
    | `created_at` | Datetime | When the category was created (UTC). |
    | `updated_at` | Datetime | When the category was last updated (UTC). |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Stock Inputs">
    Inputs (raw materials) registered in stock control, with balance, cost and restock levels.

    Table: `inventory_inputs` · Primary key: `restaurant_id`, `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat id of the input. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `name` | String | Name of the input. |
    | `unidade` | String | Unit of measure used in stock control (free text set by the store, e.g. kg, un). |
    | `quantidade` | Number | Current stock balance, in the unit of measure. |
    | `unitary_price` | Number | Unit cost (BRL per unit of measure). |
    | `total_value` | Number | Total value in stock (BRL). |
    | `minimum_stock` | Number | Minimum stock before the restock alert. |
    | `ideal_stock` | Number | Ideal stock to keep. |
    | `is_master` | Boolean | True when it was created automatically to control the stock of a product. |
    | `is_multistore` | Boolean | Whether it is shared across the stores of a multistore network. |
    | `is_multistore_child` | Boolean | Whether it is the copy of a multistore item in this store. |
    | `yield` | Number | Yield of the recipe (intermediate products). |
    | `recipe` | String | Preparation instructions (intermediate products). |
    | `created_at` | Datetime | When it was created (UTC). |
    | `updated_at` | Datetime | When it was last updated (UTC). |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>

  <Accordion title="Stock Intermediate Products">
    Intermediate products prepared from inputs, with balance, cost and restock levels.

    Table: `inventory_intermediaries` · Primary key: `restaurant_id`, `id` · Sync: Full table

    | Field | Type | Description |
    | :- | :- | :- |
    | `id` | Integer | Takeat id of the intermediate product. |
    | `restaurant_id` | Integer | Takeat store (restaurant) the row was read for; join to restaurants.id. |
    | `name` | String | Name of the intermediate product. |
    | `unidade` | String | Unit of measure used in stock control (free text set by the store, e.g. kg, un). |
    | `quantidade` | Number | Current stock balance, in the unit of measure. |
    | `unitary_price` | Number | Unit cost (BRL per unit of measure). |
    | `total_value` | Number | Total value in stock (BRL). |
    | `minimum_stock` | Number | Minimum stock before the restock alert. |
    | `ideal_stock` | Number | Ideal stock to keep. |
    | `is_master` | Boolean | True when it was created automatically to control the stock of a product. |
    | `is_multistore` | Boolean | Whether it is shared across the stores of a multistore network. |
    | `is_multistore_child` | Boolean | Whether it is the copy of a multistore item in this store. |
    | `yield` | Number | Yield of the recipe (intermediate products). |
    | `recipe` | String | Preparation instructions (intermediate products). |
    | `created_at` | Datetime | When it was created (UTC). |
    | `updated_at` | Datetime | When it was last updated (UTC). |
    | `additional_fields` | String (JSON) | Fields returned by Takeat that have no column of their own, or whose value did not fit its column (JSON object). |
  </Accordion>
</AccordionGroup>

## Implementation Notes

### Data Quality Considerations

* Every table has a `restaurant_id` column with the Takeat store the row belongs to; join it to `restaurants.id`.
* All dates and times are in UTC. Subtract 3 hours for Brasília time.
* Fees of a payment: `payment_value` minus `predicted_received_value`. `predicted_received_date` is the settlement day Takeat expects from the payment method's settings, not a confirmation from the acquirer. Takeat sends this day with a time of day it does not document: compare one value with the Takeat manager before deciding whether to take its day in Brasília time or in UTC.
* Cash payments: `payment_value` is what counts as revenue (change already deducted), `original_value` is what the customer handed over and `change` is the change given back.
* In `table_sessions`, `total_price` and `total_service_price` already include the session discount (`old_total_price` is the value before it). The values of `table_session_orders` do not include the session discount.
* Canceled order lines keep their row with `canceled_at` and `cancel_reason`.
* Rows with `removed_at` filled were read before and are no longer in Takeat (a reversed payment, a deleted financial entry, a canceled NF-e); only their key columns (and a date in the incremental column) are kept. Filter `removed_at IS NULL` to get the current data.
* Each run reads again the table sessions started in the last **Lookback Days** before the previous run. Sessions still open after that are checked one by one until they close, for up to 30 days. Once a week the last 30 days of sessions are read again: a change to an already closed session after the lookback (for example, a payment reversed days later) reaches your tables at that weekly re-read, not before.
* Financial entries: every run reads every entry due in the last 7 and the next 7 days, and every entry still open (due from 92 days before the Start Date to a year ahead). When an open entry is paid, its due date is read again in the same run. The current and previous month are read in full once a day; other months at most once a week, in turn. An edit to an old entry that was already paid (or a deletion) reaches your tables when its month is read again, within about a week once the history is loaded. If a paid entry's due date is moved to another month, it can show as removed until that month is read.
* Received NF-e: the previous and current month are read on every run, older months at most once a week, in turn.
* In `cash_flows`, the `value` of an invoice or title is already the sum of its items in `cash_flow_items`: do not add both. For cost center analysis, use the rows with `counts_for_result` true.
* Fields that Takeat sends and that have no column of their own are kept in `additional_fields` (JSON), so nothing is lost when Takeat adds new fields.

### API Limits & Performance

* Takeat allows 10 requests per minute and 500 per day per API key. The connector waits 6.5 seconds between requests, so a run with a few hundred requests takes **30 to 50 minutes**; once the history is loaded, a daily run usually needs well under 100 requests per store.
* Each run first reads the FULL\_TABLE streams (catalog, stock, brands, payment methods) in full. Then table sessions get what is left after keeping the recurring part of financial entries and NF-e (recent days, open entries, recent months) and room for one more run on the same day.
* With several stores, the stores take turns: the ones most behind go first, and each gets enough for real progress instead of an even split that is too small for any. With many stores and a long history, a store's financial entries or NF-e may be updated every other run while the history loads; the sync log warns when a store waits 3 runs in a row. If a store's table sessions make no progress for 3 runs in a row the log warns, and at 5 runs the run fails, so the problem does not go unnoticed.
* Table sessions are read 100 per request; a store with 300 sessions a day needs about 21 requests per week of history, so a year of history takes several days to load.
* Product technical sheets, NF-e details, the loyalty club clients and the published menu are not extracted.

## Troubleshooting

| Error or symptom | What it means | What to do |
| :- | :- | :- |
| "Takeat rejected the API key" | The key is wrong, was revoked, or was not copied whole. | Create a new Production key in AI Builders and update the source. |
| The run stops listing missing permissions | The API key does not have the read permission of a selected stream. | Create a key with those permissions in AI Builders, or deselect the streams. |
| Warning: a stream reached the request limit of the run, saved up to a date, continues in the next run | The history is loaded over several runs to respect Takeat's daily limit, or the same key is used by another integration. | No action needed while the history loads. If it never catches up, schedule the source less often or use a key dedicated to Nekt. |
| "The run stopped before writing anything" | What is left of the day's 500 requests does not cover the streams that are read in full. | Run again the next day (Takeat does not document when the daily limit resets), schedule fewer runs per day, or set long streams to INCREMENTAL. |
| "Nothing was read in this run" | Earlier runs today, or another integration using the same key, already used the key's daily limit. | No action needed once; after 5 runs in a row the run fails. Use a key dedicated to Nekt and schedule fewer runs. |
| Warning or error: no progress for 3 (or 5) runs in a row | The daily limit runs out before that store's data can be read, run after run. | Schedule the source less often, deselect streams you do not need, use a key dedicated to Nekt, or raise **Daily Request Limit** if Takeat gave the key more requests. |
| "This Takeat API key cannot list the stores it gives access to" | It is a partner key without access to the store list. | Fill **Restaurant IDs** with the ids of the stores. |
| "This Takeat API key cannot read the store id(s)" | A store in **Restaurant IDs** is not covered by the key. | Fix the list, or create a key that includes the store. |
| The run stops saying a listing kept changing | Takeat data changed during the read, twice in a row; nothing partial was loaded. | Run the source again. |

## Skills for agents

<Snippet file="agent-skills-intro.mdx" />

<Card title="Download Takeat skills file" icon="wand-magic-sparkles" href="/sources/takeat.md">
  Takeat connector documentation as plain markdown, for use in AI agent contexts.
</Card>


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