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

# Getnet as a data source

> Bring payment links, their orders, and what was paid on them from Getnet to Nekt.

Getnet is a payment acquirer. Its Payment Link API lets merchants create shareable payment URLs and follow the orders shoppers place through them. The Nekt connector extracts your payment links, the orders created on each link, and the payment details of every paid order into your Catalog, so you can reconcile what was sold through links with the rest of your data.

## Before you start

You need the **Client ID** and **Client Secret** of your Getnet API credentials. Getnet sends them by e-mail when the API is enabled for your account; if you did not receive them, ask Getnet support.

Getnet has two APIs for payment links, and your credentials belong to one of them:

| API platform | When to choose it |
| - | - |
| **Global Getnet** (default) | Credentials issued for the Payment Link API documented at [docs.globalgetnet.com](https://docs.globalgetnet.com/pt/products/online-payments/payment-link-api). |
| **Getnet Brasil Digital Platform** | Older e-commerce credentials that came with a **Seller ID** (API at `api.getnet.com.br`). Getnet marks this API as deprecated. |

If you are not sure which one you have, ask Getnet support which API your Client ID was issued for. Each platform has its own streams: the Getnet Brasil Digital Platform streams start with `legacy_` (see [Streams and Fields](#streams-and-fields)).

## Configuring Getnet 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 Getnet 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 Platform**: Global Getnet or Getnet Brasil Digital Platform (see [Before you start](#before-you-start)).
* **Client ID**: The Client ID of your Getnet API credentials.
* **Client Secret**: The Client Secret that came with the Client ID.
* **Seller ID**: (Getnet Brasil Digital Platform only, optional) The Seller ID of your e-commerce account.
* **Environment**: (Advanced) Production or Sandbox. Keep Production unless Getnet gave you test credentials.
* **Start Date**: (Advanced) Only payment links created on or after this date are synced, together with their orders. Leave it empty to sync every link.

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

> [!NOTE]
>
> The list shows only the streams of the **API Platform** you chose. If you later change the API Platform of an existing source, select the streams again: the two platforms have different streams and tables, so data from one never mixes with the other.

### 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**: every Getnet stream is FULL\_TABLE. Getnet does not let the connector ask only for what changed, and links and orders change status after they are created (a link expires or sells out, a paid order is refunded), so each run reads the current state of everything.

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. A daily or hourly run is usually enough for payment links.

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).
* An **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)** is not needed: every run is already a full read.

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.

# 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 | Platform | Description |
| - | - | - | - |
| Payment links | `payment_links` | Global Getnet | Every payment link of your account: status, expiration, products, enabled payment methods, and sales count. |
| Payment link orders | `payment_link_orders` | Global Getnet | One row per order (payment attempt by a shopper) on each link, with its current status and amount. |
| Order receipts | `payment_link_order_receipts` | Global Getnet | Receipt of every paid, approved, or refunded order: payment method, card brand, installments, authorization code, and total charged. |
| Payment links (Digital Platform) | `legacy_payment_links` | Getnet Brasil Digital Platform | Every payment link of your account, with the details of each link. |
| Payment link orders (Digital Platform) | `legacy_payment_link_orders` | Getnet Brasil Digital Platform | One row per payment order created on each link, with its status and amount. |
| Order payments (Digital Platform) | `legacy_payment_link_order_payments` | Getnet Brasil Digital Platform | One row per payment attempt of each order: status, payment type, amount, installments, and acquirer details. |

All amounts are **integers in cents**, as Getnet sends them (for example, `9990` is 99.90). Divide by 100 to get the value in the currency, for example `amount / 100.0`. Nested objects and lists are stored as JSON text, for example `json_extract_scalar(customer, '$.email')`.

> [!NOTE]
>
> Orders that are pending or denied have no receipt, so they appear in `payment_link_orders` but not in `payment_link_order_receipts`. When Getnet has no receipt for a paid order, the run log says how many. If Getnet returns no receipt at all while there are paid orders, the run fails instead of saving an empty receipts table.

> [!NOTE]
>
> If Getnet returns an incomplete list (for example, a page without the total number of rows, or more rows than the total it announced), or an amount that is not a whole number of cents, the run fails with a message in the log instead of saving partial or empty values.

## Fields by stream

### Global Getnet

> [accordion] Payment links
>
> Stream name: `payment_links`. One row per payment link.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `link_id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `link_id` | String | Unique identifier (UUID) of the payment link. |
> | `short_id` | String | Short public identifier that appears in the link URL. |
> | `seller_id` | String | Identifier (UUID) of the seller that owns the link. |
> | `label` | String | Identification tag given to the link by the seller. |
> | `type` | String | Link type: 'custom' (predefined products and amounts) or 'unique' (amount set at payment). |
> | `status` | String | Current link status: ACTIVE, INACTIVE (deactivated by the seller) or EXPIRED (expiration date reached or max\_orders sold out). |
> | `currency` | String | ISO 4217 currency code of the link (e.g. BRL). |
> | `expiration` | Datetime | Date and time when the link expires. |
> | `max_orders` | Integer | Maximum number of sales allowed on the link. |
> | `successful_sales` | Integer | Number of successful sales made through the link. |
> | `request_delivery_address` | Boolean | Whether the shopper must provide a delivery address. |
> | `shipping_amount` | Integer | Shipping amount charged on the link, in cents (integer, e.g. 1500 = 15.00). |
> | `products` | String (JSON) | Products sold on the link (JSON array of objects: product\_type, title, description, quantity, order\_prefix, image\_id, amount in cents). |
> | `payment` | String (JSON) | Payment methods enabled on the link (JSON object: credit/debit brands and installments, bankslip, instant\_payment (PIX), wallets). |
> | `created_at` | Datetime | Date and time when the link was created. |
> | `updated_at` | Datetime | Date and time of the last change to the link. |

> [accordion] Payment link orders
>
> Stream name: `payment_link_orders`. One row per order created on a payment link.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `order_id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `order_id` | String | Unique identifier (UUID) of the order. |
> | `link_id` | String | Identifier (UUID) of the payment link the order belongs to. |
> | `status` | String | Current order status: pending, paid, approved, refunded, denied or authentication\_denied. |
> | `currency` | String | ISO 4217 currency code of the order (e.g. BRL). |
> | `amount` | Integer | Order amount in cents (integer, e.g. 9990 = 99.90). |
> | `reference_code` | String | Reference code of the order (order prefix + sequence). |
> | `checkout_id` | String | Identifier of the checkout session that created the order. |
> | `customer` | String (JSON) | Shopper data as returned by the order list (JSON object: first\_name, last\_name, email, ...). |
> | `shipping` | String (JSON) | Delivery data of the order, when requested (JSON object with the address). |
> | `history` | String (JSON) | Status history of the order when Getnet includes it (JSON array of objects with status and created\_at). |
> | `created_at` | Datetime | Date and time when the order was created. |
> | `updated_at` | Datetime | Date and time of the last change to the order. |

> [accordion] Order receipts
>
> Stream name: `payment_link_order_receipts`. One row per paid, approved, or refunded order.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `order_id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `order_id` | String | Identifier (UUID) of the paid order. |
> | `link_id` | String | Identifier (UUID) of the payment link. |
> | `authorization_code` | String | Authorization code returned by the issuer. |
> | `transaction_date` | Datetime | Date and time of the payment transaction. |
> | `country` | String | Country of the transaction (ISO 3166 alpha-2, e.g. BR). |
> | `merchant_name` | String | Name of the merchant on the receipt. |
> | `merchant_document` | String | Document number (CNPJ) of the merchant. |
> | `soft_descriptor` | String | Text shown on the shopper's card statement. |
> | `reference_code` | String | Reference code of the order. |
> | `payment_currency` | String | ISO 4217 currency code of the payment. |
> | `payment_amount` | Integer | Purchase amount in cents, without shipping and interest (integer, e.g. 11980 = 119.80). |
> | `payment_total_amount` | Integer | Total charged in cents: amount + shipping + interest (integer, e.g. 13480 = 134.80). |
> | `payment_operation` | String | Payment method used: credit, debit, bankslip (boleto) or instant\_payment (PIX). |
> | `payment_brand` | String | Card brand (VISA, MASTERCARD, ELO, ...), when a card was used. |
> | `payment_transaction_id` | String | Identifier of the payment transaction at Getnet. |
> | `payment_installment_schema` | String | Installment plan (plan\_lojista or plan\_emissor). |
> | `payment_installment_type` | String | Installment type: no\_interest or with\_interest. |
> | `payment_installment_number` | Integer | Number of installments. |
> | `payment_installment_interest_rate` | Number | Interest rate applied to the installments. |
> | `payment_installment_increase_rate` | Number | Surcharge rate applied to the installments. |
> | `payment_last_four_digits` | String | Last four digits of the card, when a card was used. |
> | `shipping_amount` | Integer | Shipping amount charged, in cents (integer, e.g. 1500 = 15.00). |
> | `payment` | String (JSON) | Full payment block of the receipt as returned by Getnet (JSON object; amounts in cents). |
> | `customer` | String (JSON) | Shopper data on the receipt (JSON object: name, email, document, phone, billing address). |
> | `products` | String (JSON) | Products paid (JSON array: product\_type, title, description, quantity, value in cents). |
> | `shipping` | String (JSON) | Delivery data on the receipt (JSON object with the address). |
> | `created_at` | Datetime | Date and time when the receipt was created. |
> | `updated_at` | Datetime | Date and time of the last change to the receipt. |

### Getnet Brasil Digital Platform

> [accordion] Payment links
>
> Stream name: `legacy_payment_links`. One row per payment link, with the details of each link.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `link_id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `link_id` | String | Unique identifier (UUID) of the payment link. |
> | `seller_id` | String | Identifier (UUID) of the e-commerce seller that owns the link. |
> | `label` | String | Identification tag given to the link by the seller. |
> | `title` | String | Cart title displayed on the payment page. |
> | `status` | String | Current link status: ACTIVE, SUSPENDED, EXPIRED or SOLD\_OUT. |
> | `url` | String | Public URL of the payment link. |
> | `amount` | Integer | Cart amount in cents (integer, e.g. 9990 = 99.90). |
> | `shipping_amount` | Integer | Shipping amount in cents (integer, e.g. 1500 = 15.00). |
> | `expiration` | Datetime | Date and time when the link expires. |
> | `max_orders` | Integer | Maximum number of sales allowed on the link. |
> | `successfull_orders` | Integer | Number of successful sales made through the link. |
> | `payment_orders_created` | Integer | Number of payment orders created (a shopper filled in the form, paid or not). |
> | `access_counter` | Integer | How many times the link was opened. |
> | `last_order_at` | Datetime | Date and time of the last order on the link. |
> | `order` | String (JSON) | Product sold on the link (JSON object: product\_type, title, description, amount and shipping\_amount in cents, order\_prefix). |
> | `payment` | String (JSON) | Payment methods enabled on the link (JSON object: credit, debit, wallet, pix). |
> | `merchant` | String (JSON) | Merchant that created the link (JSON object: name, document). |
> | `links` | String (JSON) | Related API links returned by Getnet (JSON array). |
> | `created_at` | Datetime | Date and time when the link was created. |
> | `updated_at` | Datetime | Date and time of the last change to the link. |

> [accordion] Payment link orders
>
> Stream name: `legacy_payment_link_orders`. One row per payment order created on a payment link.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `link_id`, `payment_order_id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `payment_order_id` | String | Unique identifier of the payment order. |
> | `link_id` | String | Identifier (UUID) of the payment link the order belongs to. |
> | `status` | String | Order status: CREATED, SUCCESSFULL (paid) or FAILED. |
> | `quantity` | Integer | Number of carts bought in this order. |
> | `amount` | Integer | Order amount in cents (integer, e.g. 9990 = 99.90). |
> | `email` | String | Shopper's e-mail. |
> | `first_name` | String | Shopper's first name. |
> | `last_name` | String | Shopper's last name. |
> | `document_type` | String | Type of the shopper's document (CPF/CNPJ). |
> | `document_number` | String | Shopper's document number. |
> | `links` | String (JSON) | Related API links returned by Getnet (JSON array). |
> | `created_at` | Datetime | Date and time when the order was created. |

> [accordion] Order payments
>
> Stream name: `legacy_payment_link_order_payments`. One row per payment attempt of a payment order.
>
> **Sync Strategy:**
>
> * Full table (every run reads the current state)
> * Primary key(s): `link_id`, `payment_order_id`, `payment_id`
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `payment_order_id` | String | Identifier of the payment order. |
> | `payment_id` | String | Identifier of the payment attempt at Getnet ('attempt-N' when Getnet sends none). |
> | `link_id` | String | Identifier (UUID) of the payment link. |
> | `status` | String | Status of this payment attempt (transaction status). |
> | `payment_type` | String | Payment method of the attempt (credit, debit, pix, ...). |
> | `transaction_type` | String | Type of transaction carried out. |
> | `amount` | Integer | Amount of the attempt in cents (integer, e.g. 9990 = 99.90). |
> | `number_installments` | Integer | Number of installments (credit). |
> | `registred_at` | Datetime | Date and time when the payment was registered. |
> | `transaction` | String (JSON) | Transaction details returned by the acquirer (JSON object; varies by payment type). |
> | `order_status` | String | Status of the payment order: CREATED, SUCCESSFULL or FAILED. |
> | `order_amount` | Integer | Amount of the payment order in cents. |
> | `order_quantity` | Integer | Number of carts in the payment order. |
> | `order_shipping_amount` | Integer | Shipping amount of the payment order in cents. |
> | `customer` | String (JSON) | Shopper data of the order (JSON object, with billing address). |
> | `shippings` | String (JSON) | Delivery data of the order (JSON object with the address). |
> | `order_created_at` | Datetime | Date and time when the payment order was created. |
> | `order_updated_at` | Datetime | Date and time of the last change to the payment order. |

## Use cases

### Paid amount per payment link

```sql theme={null}
SELECT
  l.label,
  l.status,
  COUNT(r.order_id) AS paid_orders,
  SUM(r.payment_total_amount) / 100.0 AS total_charged
FROM payment_links l
LEFT JOIN payment_link_order_receipts r ON r.link_id = l.link_id
GROUP BY l.label, l.status
ORDER BY total_charged DESC
```

### Orders by status

```sql theme={null}
SELECT status, COUNT(*) AS orders, SUM(amount) / 100.0 AS amount
FROM payment_link_orders
GROUP BY status
```


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