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

# Tuna as a data source

> Bring data from Tuna to Nekt.

Tuna is a payment and merchant operations platform. With this connector, you can extract statement, transaction, and merchant-level balance data into your Catalog for reconciliation, monitoring, and financial analysis.

<img height="50" src="https://mintcdn.com/nekt/ACccwuqhDqzX14tV/assets/logo/logo-tuna.jpeg?fit=max&auto=format&n=ACccwuqhDqzX14tV&q=85&s=e063c35d4966a848e2c0322d2bb2e008" data-path="assets/logo/logo-tuna.jpeg" />

## Configuring Tuna 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 Tuna 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:

* **Account Name**: Tuna account identifier used to build the API base URL.
* **App Token**: API token used for authentication.
* **Merchant ID**: Merchant identifier used to filter merchant-level data.
* **Start Date**: The earliest date from which records are synced.

Check Tuna's documentation to confirm the exact values for these credentials.

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.

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 extraction returns only new or updated records based on the stream cursor.
  * Full table: every extraction returns the current state of the selected stream.

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

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

<AccordionGroup>
  <Accordion title="Merchant Statement">
    Stream for statement-level financial entries from the merchant account.

    **Key Fields:**

    * `id` - Unique identifier for the statement record
    * `transaction_date` - Timestamp used as the incremental cursor
    * `date` - Statement entry date
    * `order_id` - Related order identifier
    * `type` - Statement entry type
    * `description` - Description of the statement entry
    * `status_payout` - Current payout status
    * `schedule_date` - Scheduled payout date
    * `capture_date` - Payment capture timestamp

    **Amounts and Payment Method:**

    * `amount` - Entry amount
    * `seller_amount` - Seller amount
    * `sign` - Credit/debit direction
    * `payment_method_type_id` - Payment method type identifier
    * `payment_method_type_name` - Payment method type name
  </Accordion>

  <Accordion title="Merchant Transactions">
    Stream for transaction-level payment activity and processing details.

    **Key Fields:**

    * `payment_id` - Unique identifier for the payment
    * `partner_unique_id` - Partner-provided identifier
    * `customer_email` - Customer email
    * `payment_date` - Payment date
    * `payment_date_time` - Timestamp used as the incremental cursor
    * `payment_status` - Current payment status
    * `payment_method_type` - Payment method classification

    **Amounts and Totals:**

    * `amount` - Payment amount
    * `total_count` - Total records returned by the API
    * `total_amount` - Total amount returned by the API response

    **Card and Method Metadata:**

    * `payment_method_type_id` - Payment method type identifier
    * `card_brand_id` - Card brand identifier
    * `card_brand_name` - Card brand name
  </Accordion>

  <Accordion title="Merchant Summary">
    Stream for merchant balance and payout status snapshots.

    **Key Fields:**

    * `merchant_id` - Merchant identifier (also stream primary key)
    * `intransit_amount` - Amount currently in transit
    * `pending_balance` - Pending balance
    * `available_balance` - Available balance
    * `can_withdraw` - Whether withdrawals are allowed
    * `merchant_blocked` - Whether the merchant is blocked
    * `payout_in_process` - Whether a payout is currently in process

    **Payout Rules and Flags:**

    * `accumulates_receivables` - Whether receivables are accumulated
    * `pay_on_weekend` - Whether payout on weekends is allowed
    * `automatic_pay_on_weekend` - Whether weekend payout is automatic
    * `payout_error_today` - Whether a payout error occurred today
    * `payout_fee` - Standard payout fee
    * `payout_fee_withdraw` - Withdrawal payout fee
    * `payout_fee_weekend` - Weekend payout fee
  </Accordion>
</AccordionGroup>

## Skills for agents

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

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