# Amazon Settlement Report Normalizer (Flat File V2) (`tomwang/amazon-settlement-normalizer`) Actor

Turn an Amazon Flat File V2 settlement report into a clean reconciled ledger: per-fee-type and per-SKU summaries, per-order rollups, and an explicit deposit reconciliation check. Paste-only input. Aggregation only - not P\&L or accounting advice.

- **URL**: https://apify.com/tomwang/amazon-settlement-normalizer.md
- **Developed by:** [Tom](https://apify.com/tomwang) (community)
- **Categories:** E-commerce, Business, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$250.00 / 1,000 report processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Amazon Settlement Report Normalizer (Flat File V2)

Turns an Amazon **Flat File V2 settlement report** into a clean, reconciled
ledger: per-fee-type and per-SKU summaries, per-order rollups, and an explicit
deposit reconciliation check. Built for sellers who currently split settlement
reports by hand in spreadsheets.

- **Is:** deterministic parsing and aggregation of the settlement file the seller already downloads from Seller Central. Exact integer minor-unit math; unparseable rows go to a labeled quarantine bucket, never silently dropped.
- **Is not:** profit/P\&L accounting. Reports revenue, fee, refund, tax, promotion, reserve, and adjustment totals - not profit. Not accounting, tax, or compliance advice.

**Input:** paste the tab-delimited report text (paste-only; file upload not implemented).
**Output:** JSON/CSV dataset with `category_summary`, `per_sku`, `per_order`, `reconciliation`, and `quarantine`.

**Privacy:** this Actor runs on the Apify platform, which persists run input and output datasets by default. The pasted report passes through Apify platform storage; check Apify data retention settings if you need guarantees. The Actor logs row counts only - never order IDs, SKUs, or raw report lines. It never asks for Amazon credentials and never connects to Amazon.

# Actor input Schema

## `report_text` (type: `string`):

Paste the tab-delimited Flat File V2 settlement report text. A small sample is prefilled so you can try the Actor and so the daily automatic Store test succeeds; replace it with your own report.

## Actor input object example

```json
{
  "report_text": "settlement-id\tsettlement-start-date\tsettlement-end-date\tdeposit-date\ttotal-amount\tcurrency\ttransaction-type\torder-id\tmerchant-order-id\tadjustment-id\tshipment-id\tmarketplace-name\tamount-type\tamount-description\tamount\tfulfillment-id\tposted-date\tposted-date-time\torder-item-code\tmerchant-order-item-id\tmerchant-adjustment-item-id\tsku\tquantity-purchased\tpromotion-id\n1000000001\t2026-10-01\t2026-10-15\t2026-10-17\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tItemPrice\tPrincipal\t25.00\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t1\t\n1000000001\t\t\t\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tItemPrice\tTax\t2.00\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t\t\n1000000001\t\t\t\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tItemFees\tCommission\t-4.05\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t\t\n1000000001\t\t\t\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tItemFees\tFBAPerUnitFulfillmentFee\t-5.50\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t\t\n1000000001\t\t\t\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tPromotion\tShippingDiscount\t-1.50\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t\t\n1000000001\t\t\t\t8.59\tUSD\tRefund\t111-0000002-0000002\t\t\t\tAmazon.com\tItemPrice\tPrincipal\t-18.00\tAFN\t2026-10-05\t\t\t\t\tWIDGET-2\t-1\t\n1000000001\t\t\t\t8.59\tUSD\tRefund\t111-0000002-0000002\t\t\t\tAmazon.com\tItemRelatedFees\tRefundCommission\t2.94\tAFN\t2026-10-05\t\t\t\t\tWIDGET-2\t\t\n1000000001\t\t\t\t8.59\tUSD\tadjustment\t\t\t\t\tAmazon.com\tAdjustment\tWAREHOUSE_DAMAGED\t4.50\tAFN\t2026-10-08\t\t\t\t\tWIDGET-1\t\t\n1000000001\t\t\t\t8.59\tUSD\tFBA Inventory Reimbursement\t\t\t\t\tAmazon.com\tFBA Inventory Reimbursement\tReimbursement\t6.20\tAFN\t2026-10-09\t\t\t\t\tWIDGET-3\t\t\n1000000001\t\t\t\t8.59\tUSD\tMysteryCharge\t\t\t\t\tAmazon.com\tOther\tOTHER\t-3.00\t\t2026-10-10\t\t\t\t\t\t\t\n1000000002\t2026-10-16\t2026-10-31\t2026-11-02\t\tUSD\tServiceFee\t\t\t\t\tAmazon.com\tSubscription\tSubscription Fee\t-39.99\t\t2026-10-16\t\t\t\t\t\t\t\n1000000002\t\t\t\t\tUSD\tOrder\t111-0000003-0000003\t\t\t\tAmazon.com\tItemPrice\tPrincipal\t12.49\tAFN\t2026-10-20\t\t\t\t\tGADGET-9\t1\t\n"
}
```

# Actor output Schema

## `results` (type: `string`):

Default dataset: one item containing the full normalized summary of the pasted settlement report.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "report_text": `settlement-id	settlement-start-date	settlement-end-date	deposit-date	total-amount	currency	transaction-type	order-id	merchant-order-id	adjustment-id	shipment-id	marketplace-name	amount-type	amount-description	amount	fulfillment-id	posted-date	posted-date-time	order-item-code	merchant-order-item-id	merchant-adjustment-item-id	sku	quantity-purchased	promotion-id
1000000001	2026-10-01	2026-10-15	2026-10-17	8.59	USD	Order	111-0000001-0000001				Amazon.com	ItemPrice	Principal	25.00	AFN	2026-10-02					WIDGET-1	1	
1000000001				8.59	USD	Order	111-0000001-0000001				Amazon.com	ItemPrice	Tax	2.00	AFN	2026-10-02					WIDGET-1		
1000000001				8.59	USD	Order	111-0000001-0000001				Amazon.com	ItemFees	Commission	-4.05	AFN	2026-10-02					WIDGET-1		
1000000001				8.59	USD	Order	111-0000001-0000001				Amazon.com	ItemFees	FBAPerUnitFulfillmentFee	-5.50	AFN	2026-10-02					WIDGET-1		
1000000001				8.59	USD	Order	111-0000001-0000001				Amazon.com	Promotion	ShippingDiscount	-1.50	AFN	2026-10-02					WIDGET-1		
1000000001				8.59	USD	Refund	111-0000002-0000002				Amazon.com	ItemPrice	Principal	-18.00	AFN	2026-10-05					WIDGET-2	-1	
1000000001				8.59	USD	Refund	111-0000002-0000002				Amazon.com	ItemRelatedFees	RefundCommission	2.94	AFN	2026-10-05					WIDGET-2		
1000000001				8.59	USD	adjustment					Amazon.com	Adjustment	WAREHOUSE_DAMAGED	4.50	AFN	2026-10-08					WIDGET-1		
1000000001				8.59	USD	FBA Inventory Reimbursement					Amazon.com	FBA Inventory Reimbursement	Reimbursement	6.20	AFN	2026-10-09					WIDGET-3		
1000000001				8.59	USD	MysteryCharge					Amazon.com	Other	OTHER	-3.00		2026-10-10							
1000000002	2026-10-16	2026-10-31	2026-11-02		USD	ServiceFee					Amazon.com	Subscription	Subscription Fee	-39.99		2026-10-16							
1000000002					USD	Order	111-0000003-0000003				Amazon.com	ItemPrice	Principal	12.49	AFN	2026-10-20					GADGET-9	1`
};

// Run the Actor and wait for it to finish
const run = await client.actor("tomwang/amazon-settlement-normalizer").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "report_text": """settlement-id\tsettlement-start-date\tsettlement-end-date\tdeposit-date\ttotal-amount\tcurrency\ttransaction-type\torder-id\tmerchant-order-id\tadjustment-id\tshipment-id\tmarketplace-name\tamount-type\tamount-description\tamount\tfulfillment-id\tposted-date\tposted-date-time\torder-item-code\tmerchant-order-item-id\tmerchant-adjustment-item-id\tsku\tquantity-purchased\tpromotion-id
1000000001\t2026-10-01\t2026-10-15\t2026-10-17\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tItemPrice\tPrincipal\t25.00\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t1\t
1000000001\t\t\t\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tItemPrice\tTax\t2.00\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t\t
1000000001\t\t\t\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tItemFees\tCommission\t-4.05\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t\t
1000000001\t\t\t\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tItemFees\tFBAPerUnitFulfillmentFee\t-5.50\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t\t
1000000001\t\t\t\t8.59\tUSD\tOrder\t111-0000001-0000001\t\t\t\tAmazon.com\tPromotion\tShippingDiscount\t-1.50\tAFN\t2026-10-02\t\t\t\t\tWIDGET-1\t\t
1000000001\t\t\t\t8.59\tUSD\tRefund\t111-0000002-0000002\t\t\t\tAmazon.com\tItemPrice\tPrincipal\t-18.00\tAFN\t2026-10-05\t\t\t\t\tWIDGET-2\t-1\t
1000000001\t\t\t\t8.59\tUSD\tRefund\t111-0000002-0000002\t\t\t\tAmazon.com\tItemRelatedFees\tRefundCommission\t2.94\tAFN\t2026-10-05\t\t\t\t\tWIDGET-2\t\t
1000000001\t\t\t\t8.59\tUSD\tadjustment\t\t\t\t\tAmazon.com\tAdjustment\tWAREHOUSE_DAMAGED\t4.50\tAFN\t2026-10-08\t\t\t\t\tWIDGET-1\t\t
1000000001\t\t\t\t8.59\tUSD\tFBA Inventory Reimbursement\t\t\t\t\tAmazon.com\tFBA Inventory Reimbursement\tReimbursement\t6.20\tAFN\t2026-10-09\t\t\t\t\tWIDGET-3\t\t
1000000001\t\t\t\t8.59\tUSD\tMysteryCharge\t\t\t\t\tAmazon.com\tOther\tOTHER\t-3.00\t\t2026-10-10\t\t\t\t\t\t\t
1000000002\t2026-10-16\t2026-10-31\t2026-11-02\t\tUSD\tServiceFee\t\t\t\t\tAmazon.com\tSubscription\tSubscription Fee\t-39.99\t\t2026-10-16\t\t\t\t\t\t\t
1000000002\t\t\t\t\tUSD\tOrder\t111-0000003-0000003\t\t\t\tAmazon.com\tItemPrice\tPrincipal\t12.49\tAFN\t2026-10-20\t\t\t\t\tGADGET-9\t1\t
""" }

# Run the Actor and wait for it to finish
run = client.actor("tomwang/amazon-settlement-normalizer").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "report_text": "settlement-id\\tsettlement-start-date\\tsettlement-end-date\\tdeposit-date\\ttotal-amount\\tcurrency\\ttransaction-type\\torder-id\\tmerchant-order-id\\tadjustment-id\\tshipment-id\\tmarketplace-name\\tamount-type\\tamount-description\\tamount\\tfulfillment-id\\tposted-date\\tposted-date-time\\torder-item-code\\tmerchant-order-item-id\\tmerchant-adjustment-item-id\\tsku\\tquantity-purchased\\tpromotion-id\\n1000000001\\t2026-10-01\\t2026-10-15\\t2026-10-17\\t8.59\\tUSD\\tOrder\\t111-0000001-0000001\\t\\t\\t\\tAmazon.com\\tItemPrice\\tPrincipal\\t25.00\\tAFN\\t2026-10-02\\t\\t\\t\\t\\tWIDGET-1\\t1\\t\\n1000000001\\t\\t\\t\\t8.59\\tUSD\\tOrder\\t111-0000001-0000001\\t\\t\\t\\tAmazon.com\\tItemPrice\\tTax\\t2.00\\tAFN\\t2026-10-02\\t\\t\\t\\t\\tWIDGET-1\\t\\t\\n1000000001\\t\\t\\t\\t8.59\\tUSD\\tOrder\\t111-0000001-0000001\\t\\t\\t\\tAmazon.com\\tItemFees\\tCommission\\t-4.05\\tAFN\\t2026-10-02\\t\\t\\t\\t\\tWIDGET-1\\t\\t\\n1000000001\\t\\t\\t\\t8.59\\tUSD\\tOrder\\t111-0000001-0000001\\t\\t\\t\\tAmazon.com\\tItemFees\\tFBAPerUnitFulfillmentFee\\t-5.50\\tAFN\\t2026-10-02\\t\\t\\t\\t\\tWIDGET-1\\t\\t\\n1000000001\\t\\t\\t\\t8.59\\tUSD\\tOrder\\t111-0000001-0000001\\t\\t\\t\\tAmazon.com\\tPromotion\\tShippingDiscount\\t-1.50\\tAFN\\t2026-10-02\\t\\t\\t\\t\\tWIDGET-1\\t\\t\\n1000000001\\t\\t\\t\\t8.59\\tUSD\\tRefund\\t111-0000002-0000002\\t\\t\\t\\tAmazon.com\\tItemPrice\\tPrincipal\\t-18.00\\tAFN\\t2026-10-05\\t\\t\\t\\t\\tWIDGET-2\\t-1\\t\\n1000000001\\t\\t\\t\\t8.59\\tUSD\\tRefund\\t111-0000002-0000002\\t\\t\\t\\tAmazon.com\\tItemRelatedFees\\tRefundCommission\\t2.94\\tAFN\\t2026-10-05\\t\\t\\t\\t\\tWIDGET-2\\t\\t\\n1000000001\\t\\t\\t\\t8.59\\tUSD\\tadjustment\\t\\t\\t\\t\\tAmazon.com\\tAdjustment\\tWAREHOUSE_DAMAGED\\t4.50\\tAFN\\t2026-10-08\\t\\t\\t\\t\\tWIDGET-1\\t\\t\\n1000000001\\t\\t\\t\\t8.59\\tUSD\\tFBA Inventory Reimbursement\\t\\t\\t\\t\\tAmazon.com\\tFBA Inventory Reimbursement\\tReimbursement\\t6.20\\tAFN\\t2026-10-09\\t\\t\\t\\t\\tWIDGET-3\\t\\t\\n1000000001\\t\\t\\t\\t8.59\\tUSD\\tMysteryCharge\\t\\t\\t\\t\\tAmazon.com\\tOther\\tOTHER\\t-3.00\\t\\t2026-10-10\\t\\t\\t\\t\\t\\t\\t\\n1000000002\\t2026-10-16\\t2026-10-31\\t2026-11-02\\t\\tUSD\\tServiceFee\\t\\t\\t\\t\\tAmazon.com\\tSubscription\\tSubscription Fee\\t-39.99\\t\\t2026-10-16\\t\\t\\t\\t\\t\\t\\t\\n1000000002\\t\\t\\t\\t\\tUSD\\tOrder\\t111-0000003-0000003\\t\\t\\t\\tAmazon.com\\tItemPrice\\tPrincipal\\t12.49\\tAFN\\t2026-10-20\\t\\t\\t\\t\\tGADGET-9\\t1\\t\\n"
}' |
apify call tomwang/amazon-settlement-normalizer --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tomwang/amazon-settlement-normalizer"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/eYGmeLlnKnVDQ1x01/builds/aeVaf09fcOAf9Vi1S/openapi.json
