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

# Amazon Selling Partner as a data source

> Bring data from Amazon Selling Partner to Nekt.

Amazon Selling Partner (SP-API) is Amazon's suite of REST-based APIs that gives sellers and vendors programmatic access to their Amazon marketplace data. The SP-API provides access to order reports, product listings, and sales & traffic analytics across all Amazon marketplaces.

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

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

### 1. Add account access

You'll need to authorize Nekt to access your Amazon Selling Partner data. Click on the **Amazon Authorization** button and log in with your Amazon seller account. Grant the necessary permissions for the marketplace(s) you want to extract data from.

The following configurations are available:

* **Region**: Select the appropriate region for your marketplace:
  * North America (US, Canada, Mexico, Brazil)
  * Europe (UK, France, Germany, Italy, Spain, Netherlands, etc.)
  * Far East (Japan, Australia, Singapore, India)

* **Marketplace IDs**: The Amazon marketplace IDs you want to sync data from (e.g., `ATVPDKIKX0DER` for Amazon US, `A2Q3Y263D00KWC` for Amazon Brazil).

<Accordion title="Marketplace IDs">
  Find the complete list of marketplace IDs on this link: [https://developer-docs.amazon.com/sp-api/docs/marketplace-ids](https://developer-docs.amazon.com/sp-api/docs/marketplace-ids)

  | Region        | Country              | Marketplace Name | Marketplace ID |
  | :------------ | :------------------- | :--------------- | :------------- |
  | North America | United States        | Amazon.com       | ATVPDKIKX0DER  |
  | North America | Canada               | Amazon.ca        | A2EUQ1WTGCTBG2 |
  | North America | Mexico               | Amazon.com.mx    | A1AM78C64UM0Y8 |
  | North America | Brazil               | Amazon.com.br    | A2Q3Y263D00KWC |
  | Europe        | United Kingdom       | Amazon.co.uk     | A1F83G8C2ARO7P |
  | Europe        | Germany              | Amazon.de        | A1PA6795UKMFR9 |
  | Europe        | France               | Amazon.fr        | A13V1IB3VIYZZH |
  | Europe        | Italy                | Amazon.it        | APJ6JRA9NG5V4  |
  | Europe        | Spain                | Amazon.es        | A1RKKUPIHCS9HS |
  | Europe        | Netherlands          | Amazon.nl        | A1805IZSGTT6HS |
  | Europe        | Sweden               | Amazon.se        | A2NODRKZP88ZB9 |
  | Europe        | Poland               | Amazon.pl        | A1C3SOZRARQ6R3 |
  | Europe        | Belgium              | Amazon.com.be    | AMEN7PMS3EDWL  |
  | Far East      | Japan                | Amazon.co.jp     | A1VC38T7YXB528 |
  | Far East      | Singapore            | Amazon.sg        | A19VAU5U5O7RUS |
  | Far East      | Australia            | Amazon.com.au    | A39IBJ37TRP1C6 |
  | Far East      | India                | Amazon.in        | A21TJRUUN4KGV  |
  | Middle East   | United Arab Emirates | Amazon.ae        | A2VIGQ35RCS4UG |
  | Middle East   | Turkey               | Amazon.com.tr    | A33AVAJ2PDY3EV |
  | Middle East   | Saudi Arabia         | Amazon.sa        | A17E79C6D8DWNP |
  | Other         | Egypt                | Amazon.eg        | ARBP9OOSHTCHU  |
</Accordion>

* **Start Date**: The earliest date from which records will be synced. If not provided, the connector defaults to the last 30 days of data.

<Warning>
  Make sure your Amazon Seller account has the required permissions to request reports via the SP-API. The connector uses the Reports API to extract orders, listings, and sales & traffic data.
</Warning>

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.

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.

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 Amazon Selling Partner and their corresponding fields:

<AccordionGroup>
  <Accordion title="Orders Report">
    Complete order data including buyer information, item details, pricing, taxes, and shipping — fetched via the flat-file all-orders report (`GET_FLAT_FILE_ALL_ORDERS_DATA_BY_LAST_UPDATE_GENERAL`). Primary key is the composite `(amazonOrderId, sku)`.

    | Field                   | Type     | Description                                                   |
    | :---------------------- | :------- | :------------------------------------------------------------ |
    | `amazonOrderId`         | String   | Amazon order identifier                                       |
    | `merchantOrderId`       | String   | Merchant order identifier                                     |
    | `purchaseDate`          | DateTime | Date the order was placed                                     |
    | `lastUpdatedDate`       | DateTime | Date the order was last updated (replication key)             |
    | `orderStatus`           | String   | Order status                                                  |
    | `fulfillmentChannel`    | String   | Fulfillment channel (AFN for FBA, MFN for merchant-fulfilled) |
    | `salesChannel`          | String   | Sales channel                                                 |
    | `orderChannel`          | String   | Order channel                                                 |
    | `shipServiceLevel`      | String   | Ship service level                                            |
    | `productName`           | String   | Product name                                                  |
    | `sku`                   | String   | Seller SKU                                                    |
    | `asin`                  | String   | Amazon Standard Identification Number                         |
    | `itemStatus`            | String   | Item status                                                   |
    | `quantity`              | Integer  | Quantity ordered                                              |
    | `currency`              | String   | Currency code                                                 |
    | `itemPrice`             | String   | Item price                                                    |
    | `itemTax`               | String   | Item tax                                                      |
    | `shippingPrice`         | String   | Shipping price                                                |
    | `shippingTax`           | String   | Shipping tax                                                  |
    | `giftWrapPrice`         | String   | Gift wrap price                                               |
    | `giftWrapTax`           | String   | Gift wrap tax                                                 |
    | `itemPromotionDiscount` | String   | Item promotion discount                                       |
    | `shipPromotionDiscount` | String   | Shipping promotion discount                                   |
    | `shipCity`              | String   | Ship-to city                                                  |
    | `shipState`             | String   | Ship-to state                                                 |
    | `shipPostalCode`        | String   | Ship-to postal code                                           |
    | `shipCountry`           | String   | Ship-to country                                               |
    | `promotionIds`          | String   | Promotion IDs                                                 |
    | `isBusinessOrder`       | String   | Whether this is a business order                              |
    | `purchaseOrderNumber`   | String   | Purchase order number                                         |
    | `priceDesignation`      | String   | Price designation                                             |
  </Accordion>

  <Accordion title="Merchant Listings Report">
    Current snapshot of all active merchant listings with product details, pricing, inventory, and fulfillment information.

    | Field                     | Type     | Description                                                   |
    | :------------------------ | :------- | :------------------------------------------------------------ |
    | `itemName`                | String   | Listing title                                                 |
    | `itemDescription`         | String   | Listing description                                           |
    | `listingId`               | String   | Listing identifier                                            |
    | `sellerSku`               | String   | Seller SKU (primary key)                                      |
    | `price`                   | String   | Listing price                                                 |
    | `quantity`                | Integer  | Available quantity                                            |
    | `openDate`                | DateTime | Date the listing was opened                                   |
    | `imageUrl`                | String   | Main image URL                                                |
    | `itemIsMarketplace`       | String   | Whether the item is listed on the marketplace                 |
    | `productIdType`           | String   | Product ID type (e.g. ASIN, UPC)                              |
    | `zshopShippingFee`        | String   | zShop shipping fee                                            |
    | `itemNote`                | String   | Seller note on the item                                       |
    | `itemCondition`           | String   | Item condition                                                |
    | `asin1`                   | String   | Primary ASIN                                                  |
    | `asin2`                   | String   | Secondary ASIN                                                |
    | `asin3`                   | String   | Tertiary ASIN                                                 |
    | `willShipInternationally` | String   | Whether the item ships internationally                        |
    | `expeditedShipping`       | String   | Expedited shipping option                                     |
    | `productId`               | String   | Product identifier                                            |
    | `addDelete`               | String   | Add or delete flag                                            |
    | `pendingQuantity`         | Integer  | Quantity pending fulfillment                                  |
    | `fulfillmentChannel`      | String   | Fulfillment channel (AFN for FBA, MFN for merchant-fulfilled) |
    | `merchantShippingGroup`   | String   | Merchant shipping group                                       |
    | `status`                  | String   | Listing status                                                |
  </Accordion>

  <Accordion title="Sales and Traffic Report">
    Daily sales and traffic metrics including units ordered, revenue, refunds, sessions, page views, and conversion data — with B2B breakdowns. Amazon retains approximately 2 years of data for this report (730-day lookback cap).

    | Field                                | Type    | Description                               |
    | :----------------------------------- | :------ | :---------------------------------------- |
    | `date`                               | Date    | Date (YYYY-MM-DD, replication key)        |
    | `unitsOrdered`                       | Integer | Total units ordered                       |
    | `unitsOrderedB2B`                    | Integer | B2B units ordered                         |
    | `totalOrderItems`                    | Integer | Total order items                         |
    | `totalOrderItemsB2B`                 | Integer | B2B total order items                     |
    | `orderedProductSalesAmount`          | Number  | Ordered product sales amount              |
    | `orderedProductSalesCurrencyCode`    | String  | Ordered product sales currency            |
    | `orderedProductSalesB2BAmount`       | Number  | B2B ordered product sales amount          |
    | `orderedProductSalesB2BCurrencyCode` | String  | B2B ordered product sales currency        |
    | `unitsRefunded`                      | Integer | Units refunded                            |
    | `refundRate`                         | Number  | Refund rate                               |
    | `claimsGranted`                      | Integer | Claims granted                            |
    | `claimsAmountAmount`                 | Number  | Claims amount                             |
    | `claimsAmountCurrencyCode`           | String  | Claims amount currency                    |
    | `unitsShipped`                       | Integer | Units shipped                             |
    | `ordersShipped`                      | Integer | Orders shipped                            |
    | `sessions`                           | Integer | Total sessions                            |
    | `browserSessions`                    | Integer | Browser sessions                          |
    | `mobileAppSessions`                  | Integer | Mobile app sessions                       |
    | `sessionPercentage`                  | Number  | Session percentage                        |
    | `pageViews`                          | Integer | Total page views                          |
    | `browserPageViews`                   | Integer | Browser page views                        |
    | `mobileAppPageViews`                 | Integer | Mobile app page views                     |
    | `pageViewsPercentage`                | Number  | Page views percentage                     |
    | `buyBoxPercentage`                   | Number  | Buy box percentage                        |
    | `unitSessionPercentage`              | Number  | Unit session percentage (conversion rate) |
    | `unitSessionPercentageB2B`           | Number  | B2B unit session percentage               |
    | `averageOfferCount`                  | Integer | Average offer count                       |
    | `averageParentItems`                 | Integer | Average parent items                      |
    | `feedbackReceived`                   | Integer | Feedback received                         |
    | `negativeFeedbackReceived`           | Integer | Negative feedback received                |
    | `receivedNegativeFeedbackRate`       | Number  | Received negative feedback rate           |
  </Accordion>

  <Accordion title="Financial Events">
    Financial events stream via the Amazon SP-API Finances API. Fetches fee breakdowns (including commissions) per order-item. Primary key is the composite `(amazonOrderId, sellerSku, orderItemId, feeType)`.

    | Field             | Type     | Description                                           |
    | :---------------- | :------- | :---------------------------------------------------- |
    | `amazonOrderId`   | String   | Amazon order ID.                                      |
    | `sellerSku`       | String   | Seller SKU.                                           |
    | `orderItemId`     | String   | Order item ID.                                        |
    | `marketplaceId`   | String   | Marketplace ID.                                       |
    | `postedDate`      | DateTime | Date the event was posted (replication key).          |
    | `feeType`         | String   | Fee type (e.g. Commission, FBAPerUnitFulfillmentFee). |
    | `feeAmount`       | Number   | Fee amount (negative = deduction).                    |
    | `feeCurrency`     | String   | Fee currency code.                                    |
    | `chargeType`      | String   | Charge type (e.g. Principal, ShippingCharge).         |
    | `chargeAmount`    | Number   | Charge amount.                                        |
    | `chargeCurrency`  | String   | Charge currency code.                                 |
    | `quantityShipped` | Integer  | Quantity shipped.                                     |
  </Accordion>

  <Accordion title="FBA Manage Inventory Health">
    Consolidated view of FBA inventory including sales velocity, shipment statuses, estimated storage and long-term storage fees, and aged/excess units — fetched via the `GET_FBA_INVENTORY_PLANNING_DATA` report. Snapshot report (full table sync). Primary key is `sku`.

    | Field                                     | Type    | Description                                    |
    | :---------------------------------------- | :------ | :--------------------------------------------- |
    | `snapshotDate`                            | Date    | Snapshot date.                                 |
    | `sku`                                     | String  | Seller SKU.                                    |
    | `fnsku`                                   | String  | Fulfillment network SKU.                       |
    | `asin`                                    | String  | ASIN.                                          |
    | `productName`                             | String  | Product name.                                  |
    | `condition`                               | String  | Item condition.                                |
    | `available`                               | Integer | Available (sellable) quantity.                 |
    | `pendingRemovalQuantity`                  | Integer | Quantity pending removal.                      |
    | `invAge0To90Days`                         | Integer | Units aged 0-90 days.                          |
    | `invAge91To180Days`                       | Integer | Units aged 91-180 days.                        |
    | `invAge181To270Days`                      | Integer | Units aged 181-270 days.                       |
    | `invAge271To365Days`                      | Integer | Units aged 271-365 days.                       |
    | `invAge365PlusDays`                       | Integer | Units aged 365+ days.                          |
    | `currency`                                | String  | Currency code.                                 |
    | `qtyToBeChargedLtsf6Mo`                   | Integer | Qty to be charged LTSF at 6 months.            |
    | `projectedLtsf6Mo`                        | Number  | Projected LTSF charge at 6 months.             |
    | `qtyToBeChargedLtsf12Mo`                  | Integer | Qty to be charged LTSF at 12 months.           |
    | `estimatedLtsfNextCharge`                 | Number  | Estimated LTSF next charge.                    |
    | `unitsShippedT7`                          | Integer | Units shipped last 7 days.                     |
    | `unitsShippedT30`                         | Integer | Units shipped last 30 days.                    |
    | `unitsShippedT60`                         | Integer | Units shipped last 60 days.                    |
    | `unitsShippedT90`                         | Integer | Units shipped last 90 days.                    |
    | `alert`                                   | String  | Alert flag.                                    |
    | `yourPrice`                               | Number  | Your price.                                    |
    | `salesPrice`                              | Number  | Sales price.                                   |
    | `lowestPriceNewPlusShipping`              | Number  | Lowest new price plus shipping.                |
    | `lowestPriceUsed`                         | Number  | Lowest used price.                             |
    | `recommendedAction`                       | String  | Recommended action.                            |
    | `sellThrough`                             | Number  | Sell-through rate.                             |
    | `itemVolume`                              | Number  | Item volume.                                   |
    | `volumeUnitMeasurement`                   | String  | Volume unit of measurement.                    |
    | `storageType`                             | String  | Storage type (Standard/Oversize).              |
    | `storageVolume`                           | Number  | Storage volume.                                |
    | `marketplace`                             | String  | Marketplace identifier.                        |
    | `productGroup`                            | String  | Product group/category.                        |
    | `salesRank`                               | Integer | Sales rank.                                    |
    | `daysOfSupply`                            | Number  | Days of supply.                                |
    | `estimatedExcessQuantity`                 | Integer | Estimated excess quantity.                     |
    | `weeksOfCoverT30`                         | Number  | Weeks of cover based on 30-day sales.          |
    | `weeksOfCoverT90`                         | Number  | Weeks of cover based on 90-day sales.          |
    | `featuredofferPrice`                      | Number  | Featured offer (buy box) price.                |
    | `salesShippedLast7Days`                   | Number  | Sales shipped last 7 days.                     |
    | `salesShippedLast30Days`                  | Number  | Sales shipped last 30 days.                    |
    | `salesShippedLast60Days`                  | Number  | Sales shipped last 60 days.                    |
    | `salesShippedLast90Days`                  | Number  | Sales shipped last 90 days.                    |
    | `invAge0To30Days`                         | Integer | Units aged 0-30 days.                          |
    | `invAge31To60Days`                        | Integer | Units aged 31-60 days.                         |
    | `invAge61To90Days`                        | Integer | Units aged 61-90 days.                         |
    | `invAge181To330Days`                      | Integer | Units aged 181-330 days.                       |
    | `invAge331To365Days`                      | Integer | Units aged 331-365 days.                       |
    | `estimatedStorageCostNextMonth`           | Number  | Estimated storage cost next month.             |
    | `inboundQuantity`                         | Integer | Total inbound quantity.                        |
    | `inboundWorking`                          | Integer | Inbound working quantity.                      |
    | `inboundShipped`                          | Integer | Inbound shipped quantity.                      |
    | `inboundReceived`                         | Integer | Inbound received quantity.                     |
    | `totalReservedQuantity`                   | Integer | Total reserved quantity.                       |
    | `unfulfillableQuantity`                   | Integer | Unfulfillable quantity.                        |
    | `weeksOfCover`                            | Number  | Weeks of cover.                                |
    | `weeksOfCoverEstimatedExcessQuantity`     | Integer | Weeks of cover estimated excess quantity.      |
    | `recommendedOrderQuantity`                | Integer | Recommended order quantity.                    |
    | `recommendedOrderDate`                    | Date    | Recommended order date.                        |
    | `inventoryAgeSnapshotDate`                | Date    | Inventory age snapshot date.                   |
    | `inventorySupplyAtFba`                    | Integer | Inventory supply at FBA.                       |
    | `reservedFcTransfer`                      | Integer | Reserved for FC transfer.                      |
    | `reservedFcProcessing`                    | Integer | Reserved for FC processing.                    |
    | `reservedCustomerOrder`                   | Integer | Reserved for customer orders.                  |
    | `totalDaysOfSupplyIncludingOpenShipments` | Number  | Total days of supply including open shipments. |
  </Accordion>

  <Accordion title="FBA Inventory Summaries">
    Per-SKU inventory data including fulfillable, inbound, reserved, researching, and unfulfillable quantities — fetched via the FBA Inventory API. Primary key is the composite `(sellerSku, marketplaceId)`.

    | Field                                  | Type     | Description                                       |
    | :------------------------------------- | :------- | :------------------------------------------------ |
    | `asin`                                 | String   | Amazon Standard Identification Number.            |
    | `fnSku`                                | String   | Fulfillment network SKU.                          |
    | `sellerSku`                            | String   | Seller SKU.                                       |
    | `condition`                            | String   | Item condition.                                   |
    | `productName`                          | String   | Product title.                                    |
    | `totalQuantity`                        | Integer  | Total quantity across all statuses.               |
    | `lastUpdatedTime`                      | DateTime | Last time quantity was updated (replication key). |
    | `marketplaceId`                        | String   | Marketplace identifier.                           |
    | `fulfillableQuantity`                  | Integer  | Units available for order fulfillment.            |
    | `inboundWorkingQuantity`               | Integer  | Units in inbound shipment being worked on.        |
    | `inboundShippedQuantity`               | Integer  | Units in inbound shipment that have been shipped. |
    | `inboundReceivingQuantity`             | Integer  | Units in inbound shipment being received at FC.   |
    | `reservedTotalQuantity`                | Integer  | Total reserved quantity.                          |
    | `reservedPendingCustomerOrderQuantity` | Integer  | Reserved for customer orders.                     |
    | `reservedPendingTransshipmentQuantity` | Integer  | Reserved for FC transfers.                        |
    | `reservedFcProcessingQuantity`         | Integer  | Reserved for FC processing.                       |
    | `researchingTotalQuantity`             | Integer  | Total researching quantity.                       |
    | `researchingQuantityInShortTerm`       | Integer  | Researching 1-10 days.                            |
    | `researchingQuantityInMidTerm`         | Integer  | Researching 11-20 days.                           |
    | `researchingQuantityInLongTerm`        | Integer  | Researching 21+ days.                             |
    | `unfulfillableTotalQuantity`           | Integer  | Total unfulfillable quantity.                     |
    | `customerDamagedQuantity`              | Integer  | Customer damaged units.                           |
    | `warehouseDamagedQuantity`             | Integer  | Warehouse damaged units.                          |
    | `distributorDamagedQuantity`           | Integer  | Distributor damaged units.                        |
    | `carrierDamagedQuantity`               | Integer  | Carrier damaged units.                            |
    | `defectiveQuantity`                    | Integer  | Defective units.                                  |
    | `expiredQuantity`                      | Integer  | Expired units.                                    |
    | `reservedFutureSupplyQuantity`         | Integer  | Reserved future supply quantity.                  |
    | `futureSupplyBuyableQuantity`          | Integer  | Future supply buyable quantity.                   |
  </Accordion>
</AccordionGroup>

# Use Cases for Data Analysis

This guide outlines valuable business intelligence use cases when consolidating Amazon Selling Partner data, along with ready-to-use SQL queries that you can run on [Explorer](https://app.nekt.ai/explorer).

### 1. Sales Performance Overview

Analyze daily sales performance including revenue, units sold, and refund trends.

**Business Value:**

* Track revenue trends over time
* Monitor refund rates to identify product quality issues
* Compare B2B vs. B2C sales performance

<Accordion title="SQL query">
  <Tabs>
    <Tab title="AWS">
      ```sql theme={null}
      SELECT
         date,
         unitsOrdered,
         orderedProductSalesAmount,
         orderedProductSalesCurrencyCode,
         unitsRefunded,
         refundRate,
         unitsShipped,
         ordersShipped,
         CASE
            WHEN unitsOrdered > 0 THEN ROUND(unitsRefunded * 100.0 / unitsOrdered, 2)
            ELSE 0
         END AS calculated_refund_pct
      FROM
         nekt_raw.amazon_sp_sales_and_traffic_report
      WHERE
         date >= CURRENT_DATE - INTERVAL '30' DAY
      ORDER BY
         date DESC
      ```
    </Tab>

    <Tab title="GCP">
      ```sql theme={null}
      SELECT
         date,
         unitsOrdered,
         orderedProductSalesAmount,
         orderedProductSalesCurrencyCode,
         unitsRefunded,
         refundRate,
         unitsShipped,
         ordersShipped,
         CASE
            WHEN unitsOrdered > 0 THEN ROUND(SAFE_DIVIDE(unitsRefunded * 100.0, unitsOrdered), 2)
            ELSE 0
         END AS calculated_refund_pct
      FROM
         `nekt_raw.amazon_sp_sales_and_traffic_report`
      WHERE
         date >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
      ORDER BY
         date DESC
      ```
    </Tab>
  </Tabs>
</Accordion>

<Accordion title="Sample Result">
  | date       | unitsOrdered | orderedProductSalesAmount | orderedProductSalesCurrencyCode | unitsRefunded | refundRate | unitsShipped | ordersShipped | calculated\_refund\_pct |
  | ---------- | ------------ | ------------------------- | ------------------------------- | ------------- | ---------- | ------------ | ------------- | ----------------------- |
  | 2026-03-10 | 342          | 18,456.90                 | USD                             | 8             | 2.34       | 328          | 298           | 2.34                    |
  | 2026-03-09 | 298          | 15,230.45                 | USD                             | 5             | 1.68       | 290          | 265           | 1.68                    |
  | 2026-03-08 | 410          | 22,890.10                 | USD                             | 12            | 2.93       | 395          | 350           | 2.93                    |
  | 2026-03-07 | 275          | 14,100.00                 | USD                             | 3             | 1.09       | 270          | 245           | 1.09                    |
</Accordion>

### 2. Order Fulfillment Analysis

Track order distribution by status and fulfillment channel to monitor operational health.

**Business Value:**

* Monitor order processing efficiency across FBA and merchant-fulfilled channels
* Identify bottlenecks in fulfillment
* Track cancellation rates by channel

<Accordion title="SQL query">
  <Tabs>
    <Tab title="AWS">
      ```sql theme={null}
      WITH order_stats AS (
         SELECT
            fulfillmentChannel,
            orderStatus,
            COUNT(*) AS order_count,
            SUM(CAST(itemPrice AS DOUBLE)) AS total_revenue
         FROM
            nekt_raw.amazon_sp_orders_report
         WHERE
            purchaseDate >= CURRENT_DATE - INTERVAL '30' DAY
         GROUP BY
            fulfillmentChannel, orderStatus
      ),
      total AS (
         SELECT SUM(order_count) AS total_orders FROM order_stats
      )
      SELECT
         os.fulfillmentChannel,
         os.orderStatus,
         os.order_count,
         ROUND(os.order_count * 100.0 / t.total_orders, 2) AS percentage,
         ROUND(os.total_revenue, 2) AS total_revenue
      FROM
         order_stats os, total t
      ORDER BY
         os.order_count DESC
      ```
    </Tab>

    <Tab title="GCP">
      ```sql theme={null}
      WITH order_stats AS (
         SELECT
            fulfillmentChannel,
            orderStatus,
            COUNT(*) AS order_count,
            SUM(CAST(itemPrice AS FLOAT64)) AS total_revenue
         FROM
            `nekt_raw.amazon_sp_orders_report`
         WHERE
            purchaseDate >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
         GROUP BY
            fulfillmentChannel, orderStatus
      ),
      total AS (
         SELECT SUM(order_count) AS total_orders FROM order_stats
      )
      SELECT
         os.fulfillmentChannel,
         os.orderStatus,
         os.order_count,
         ROUND(SAFE_DIVIDE(os.order_count * 100.0, t.total_orders), 2) AS percentage,
         ROUND(os.total_revenue, 2) AS total_revenue
      FROM
         order_stats os, total t
      ORDER BY
         os.order_count DESC
      ```
    </Tab>
  </Tabs>
</Accordion>

<Accordion title="Sample Result">
  | fulfillmentChannel | orderStatus | order\_count | percentage | total\_revenue |
  | ------------------ | ----------- | ------------ | ---------- | -------------- |
  | AFN                | Shipped     | 1,245        | 52.30      | 89,234.50      |
  | MFN                | Shipped     | 520          | 21.84      | 31,245.00      |
  | AFN                | Pending     | 312          | 13.11      | 22,523.00      |
  | MFN                | Cancelled   | 156          | 6.55       | 9,856.00       |
  | AFN                | Cancelled   | 148          | 6.22       | 8,432.00       |
</Accordion>

### 3. Traffic-to-Sales Conversion

Measure how effectively your store traffic converts into orders using session and conversion data.

**Business Value:**

* Identify trends in traffic and conversion rates
* Compare browser vs. mobile app performance
* Optimize listing strategies based on Buy Box percentage

<Accordion title="SQL query">
  <Tabs>
    <Tab title="AWS">
      ```sql theme={null}
      SELECT
         date,
         sessions,
         browserSessions,
         mobileAppSessions,
         pageViews,
         unitsOrdered,
         unitSessionPercentage AS conversion_rate,
         buyBoxPercentage,
         CASE
            WHEN sessions > 0 THEN ROUND(pageViews * 1.0 / sessions, 2)
            ELSE 0
         END AS pages_per_session
      FROM
         nekt_raw.amazon_sp_sales_and_traffic_report
      WHERE
         date >= CURRENT_DATE - INTERVAL '30' DAY
      ORDER BY
         date DESC
      ```
    </Tab>

    <Tab title="GCP">
      ```sql theme={null}
      SELECT
         date,
         sessions,
         browserSessions,
         mobileAppSessions,
         pageViews,
         unitsOrdered,
         unitSessionPercentage AS conversion_rate,
         buyBoxPercentage,
         CASE
            WHEN sessions > 0 THEN ROUND(SAFE_DIVIDE(pageViews * 1.0, sessions), 2)
            ELSE 0
         END AS pages_per_session
      FROM
         `nekt_raw.amazon_sp_sales_and_traffic_report`
      WHERE
         date >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
      ORDER BY
         date DESC
      ```
    </Tab>
  </Tabs>
</Accordion>

<Accordion title="Sample Result">
  | date       | sessions | browserSessions | mobileAppSessions | pageViews | unitsOrdered | conversion\_rate | buyBoxPercentage | pages\_per\_session |
  | ---------- | -------- | --------------- | ----------------- | --------- | ------------ | ---------------- | ---------------- | ------------------- |
  | 2026-03-10 | 4,523    | 1,890           | 2,633             | 8,245     | 342          | 7.56             | 92.30            | 1.82                |
  | 2026-03-09 | 3,980    | 1,650           | 2,330             | 7,120     | 298          | 7.49             | 91.80            | 1.79                |
  | 2026-03-08 | 5,120    | 2,100           | 3,020             | 9,800     | 410          | 8.01             | 93.10            | 1.91                |
  | 2026-03-07 | 3,560    | 1,480           | 2,080             | 6,450     | 275          | 7.72             | 90.50            | 1.81                |
</Accordion>

## Implementation Notes

<AccordionGroup>
  <Accordion title="Report-Based Extraction">
    The connector primarily uses the Amazon SP-API Reports API rather than direct API endpoints for reports. Reports are created asynchronously — the connector submits a report request, polls until it's ready (up to 15 minutes per chunk: 60 attempts × 15 seconds), then downloads and parses the result. Downloaded documents are automatically decompressed when Amazon returns them in GZIP format.

    This approach avoids the strict rate limits of the Orders API (0.0056 req/s) and enables efficient bulk data extraction.

    *Note: The **Financial Events** and **FBA Inventory Summaries** streams differ by using the Finances API and FBA Inventory API respectively, not the Reports API.*

    * **Orders, Merchant Listings, and FBA Manage Inventory Health** reports are returned as TSV files encoded in ISO-8859-1.
    * **Sales and Traffic** reports are returned as JSON encoded in UTF-8.
  </Accordion>

  <Accordion title="Regional API Endpoints">
    The connector supports all Amazon SP-API regional endpoints:

    * **North America**: US, Canada, Mexico, Brazil
    * **Europe**: UK, France, Germany, Italy, Spain, Netherlands, Turkey, UAE, India, etc.
    * **Far East**: Japan, Australia, Singapore

    Make sure to select the correct API URL and marketplace IDs for your seller account's region.
  </Accordion>

  <Accordion title="Incremental Sync">
    The connector supports incremental sync for:

    * **Orders Report**: Uses `lastUpdatedDate` as the replication key — data is fetched in 30-day chunks.
    * **Sales and Traffic Report**: Uses `date` as the replication key — data is fetched in 30-day chunks. Amazon retains approximately 2 years of historical data, so the connector clamps the start date to a maximum of 730 days in the past regardless of the configured `Start Date`.
    * **Financial Events**: Uses `postedDate` as the replication key — data is fetched in 30-day chunks with a maximum lookback of 730 days.
    * **FBA Inventory Summaries**: Uses `lastUpdatedTime` as the replication key — data is fetched in 30-day chunks with a maximum lookback of 540 days.

    The **Merchant Listings Report** and **FBA Manage Inventory Health** are always a full-table sync since they represent snapshots of your current active listings and inventory.
  </Accordion>

  <Accordion title="Authentication and Token Management">
    The connector automatically manages OAuth access token refresh to prevent authentication failures:

    * Access tokens are refreshed proactively 15 minutes before expiration to avoid race conditions during long-running extractions.
  </Accordion>

  <Accordion title="Rate Limit and Retry Handling">
    The connector handles transient SP-API errors automatically:

    * **429 QuotaExceeded**: Retried up to 5 times. The `Retry-After` header is respected when present; otherwise exponential backoff is used (starting at 60 seconds, doubling each attempt).
    * **Stale connections**: If the server closes an idle connection during a long polling sleep, the connector reopens the session and retries transparently.
  </Accordion>

  <Accordion title="Data Chunking">
    For time-based reports (Orders, Sales & Traffic, Financial Events, and FBA Inventory Summaries), the connector splits requests into 30-day chunks to stay within SP-API limits and avoid timeouts on large date ranges. The chunking is handled automatically — you only need to set the desired `Start Date`.
  </Accordion>
</AccordionGroup>

## Skills for agents

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

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