> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

## Resource: Track Partner Earnings

## Article: Track Partner Earnings

## Article Link: https://dev.wix.com/docs/api-reference/account-level/studio-workspace/earnings/skills/track-partner-earnings.md

## Article Content:

# Track Partner Earnings

## Description
A Wix Partner earns revenue share from separate streams. Each payout API records what they earned, one row per earning; Materialized Invoices records what Wix invoiced and paid, one row per earnings month per payment status. All calls are read-only and account-level (account scope, no site ID), and return only the caller's own records. Amounts are USD, even where the field name has no currency.

## API Endpoints

| Call | Purpose |
|---|---|
| `POST https://www.wixapis.com/partners/revshare/v1/materialized-invoices/query` | invoices by month and status, with per-stream sub-totals |
| `POST https://www.wixapis.com/partners/revshare/v1/materialized-invoices/aggregate` | total amount and count of matching invoices |
| `GET https://www.wixapis.com/partners/revshare/v1/materialized-invoices/last-payment` | the most recent payment and whether it succeeded |
| `POST https://www.wixapis.com/partners/revshare/v1/premium-payouts/query` | premium plan earnings, one per subscription charge |
| `POST https://www.wixapis.com/partners/revshare/v1/premium-payouts/aggregate` | premium total and count |
| `POST https://www.wixapis.com/partners/revshare/v1/gpv-payouts/query` | GPV earnings, one per day, with a per-site breakdown |
| `POST https://www.wixapis.com/partners/revshare/v1/gpv-payouts/aggregate` | GPV total earned and total volume |
| `POST https://www.wixapis.com/partners/marketplace/v1/marketplace-payouts/query` | marketplace earnings (template sales), one per transaction |
| `POST https://www.wixapis.com/partners/marketplace/v1/marketplace-payouts/aggregate` | marketplace total and count |

Docs: [Earnings](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/earnings/introduction.md), [Materialized Invoices](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/earnings/materialized-invoice-v1/introduction.md), [Premium Payouts](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/earnings/premium-payout-v1/introduction.md), [GPV Payouts](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/earnings/gpv-payout-v1/introduction.md), [Marketplace Payouts](https://dev.wix.com/docs/api-reference/account-level/studio-workspace/earnings/marketplace-payout-v1/introduction.md)

## Rules

- **Read-only.** Wix creates every record; nothing here changes data.
- **Earned isn't paid.** Report an amount as paid only when its invoice `status` is `PAID`. `UNPAID` is scheduled but not paid yet. `BELOW_THRESHOLD` isn't scheduled: Wix pays once the unpaid total reaches $200.
- **Invoices and payouts use different dates.** Filter invoices on `earningsMonth`, the first day of the month at midnight UTC (`"2026-05-01T00:00:00.000Z"`). Filter payouts on a `transactionDate` range, never on `createdDate` or `updatedDate`.
- **Keep reversals in.** Premium and marketplace payouts with `negative: true` carry a negative `amount` that offsets an earlier earning. The net (dashboard) figure is every non-`REJECTED` row, negatives included.
- **Matching the dashboard.** The Wix Studio dashboard leaves out `BELOW_THRESHOLD` invoices and `REJECTED` payouts from its totals; the aggregate methods total every status the filter matches. To match the dashboard, add the status condition shown below. The dashboard's premium total is the Premium Payouts aggregate (Step 3), not the invoice `premium` sub-total, which leaves out uninvoiced months and adds unattributed earnings. Dashboard payout labels: `PENDING` = Estimated, `APPROVED` = Paid, `REJECTED` = Cancelled. A payout's `APPROVED` ("Paid") means confirmed, not paid out: whether Wix paid it is its invoice's `status`.
- **Agency only.** Never put earnings in a message to a client.
- **Report real data only.** Never estimate an amount. If a call returns nothing or fails, say so (Step 5).

## Steps

### 1. A month's earnings and whether they're paid

"How much did I earn last month?" Query the month's invoices. One month can return several rows, one per status:

```
POST https://www.wixapis.com/partners/revshare/v1/materialized-invoices/query
```
```json
{ "query": { "filter": { "earningsMonth": "2026-05-01T00:00:00.000Z" }, "cursorPaging": { "limit": 100 } } }
```

Response (trimmed):

```json
{ "materializedInvoices": [
  { "earningsMonth": "2026-05-01T00:00:00Z", "status": "PAID", "amount": 412.3,
    "invoicesRefCodes": ["<ref code>"],
    "revenueStreamsAggregation": { "premium": 380.1, "gpv": 12.2, "marketplace": 20, "appMarket": 0, "symphony": 0, "other": 0 } }
] }
```

Report each row's `amount` with its status in words (paid, scheduled, below the $200 threshold). The six `revenueStreamsAggregation` sub-totals add up to `amount`; include them all in a breakdown. The invoice figures are what Wix invoiced.

No row for the month means it isn't invoiced yet (normal for recent months): call the Premium, GPV and Marketplace payout aggregates for that month (Steps 3–4), report them as earned but not invoiced, and say app market and Symphony show only once it's invoiced.

For a period total, call the aggregate with the same filter shape; add a `status` condition to match the dashboard:

```
POST https://www.wixapis.com/partners/revshare/v1/materialized-invoices/aggregate
```
```json
{ "filter": { "earningsMonth": { "$gte": "2026-01-01T00:00:00.000Z" }, "status": { "$ne": "BELOW_THRESHOLD" } } }
```

It returns `materializedInvoicesTotalAmount` and `materializedInvoicesCount`; an empty `filter` totals all history. It covers invoiced months only: for months with no invoice yet, add their payout aggregates, or say which months the total covers.

### 2. Has Wix paid me? Did a payment fail?

```
GET https://www.wixapis.com/partners/revshare/v1/materialized-invoices/last-payment
```

Response:

```json
{ "lastPayment": { "refCode": "PAY-0000", "date": "2026-06-03T09:00:00Z", "amountInUsd": 412.3, "paid": true } }
```

`date` is when funds should arrive. When `paid` is `false`, report `rejection.issueType` (`PAYOUT_METHOD`, `PAYEE_BANK`, `GENERAL`) and `rejection.reason`, tell the user to check that payout method or bank detail, and list what's still waiting with an invoice query on `"status": "UNPAID"`.

### 3. Premium plan earnings: which sites and plans

```
POST https://www.wixapis.com/partners/revshare/v1/premium-payouts/query
```
```json
{ "query": {
  "filter": { "transactionDate": { "$gte": "2026-05-01T00:00:00.000Z", "$lt": "2026-06-01T00:00:00.000Z" } },
  "sort": [{ "fieldName": "transactionDate", "order": "ASC" }],
  "cursorPaging": { "limit": 100 } } }
```

Each `premiumPayouts[]` row has `amount`, `status`, `negative`, `transactionDate`, `metaSiteId`, `siteName` (a snapshot, may be empty), `premiumPlanType` (`STUDIO`, `WIX_COM`, `BUSINESS_EMAIL` …), `paymentRevenueSharePercent` (unit unclear in the docs, unlike GPV's in Step 4: report `amount`, don't compute) and `invoiceId` (empty until invoiced). Page via `pagingMetadata.cursors.next`. Filterable: `transactionDate`, `status`, `amount`, `transactionAmount`, `premiumProductId`, `createdDate`, `id`. Group by `metaSiteId` in code.

`PENDING` resolves when the client's trial ends: `APPROVED` if the subscription is active, `REJECTED` if cancelled.

Total in one call; the dashboard total is `status` not `REJECTED`:

```
POST https://www.wixapis.com/partners/revshare/v1/premium-payouts/aggregate
```
```json
{ "filter": { "transactionDate": { "$gte": "2026-05-01T00:00:00.000Z", "$lt": "2026-06-01T00:00:00.000Z" }, "status": { "$ne": "REJECTED" } } }
```

Returns `payoutsTotalAmount` (reversals subtracted) and `payoutsCount`.

### 4. Other streams

- **GPV** (share of Wix Payments volume on client sites): `POST https://www.wixapis.com/partners/revshare/v1/gpv-payouts/query` with the same `transactionDate` range body. One payout per day, no reversals, gaps on low-volume days. Each row has `gpv` (client sales), `amount`, `paymentRevenueSharePercent` (a fractional percent: `0.1` is 0.1%) and `sitesGpv[]` (`metaSiteId`, `siteName`, `gpvInUsd`). For a month, call `…/gpv-payouts/aggregate` with `{ "filter": { "transactionDate": { … } } }`: `payoutsTotalAmount`, `payoutsTotalGpv`.
- **Marketplace** (template sales): `POST https://www.wixapis.com/partners/marketplace/v1/marketplace-payouts/query`, same body. The query can't filter on `status`; skip `REJECTED` rows in code. `…/marketplace-payouts/aggregate` does accept `"status": { "$ne": "REJECTED" }`. Rows carry `listing.id`, not the template name.
- **App market and Symphony**: invoice sub-totals only (Step 1). There's no per-earning API; say so if asked for detail.

Was a payout paid? Query invoices with `{ "invoicesRefCodes": { "$hasSome": ["<invoiceId>"] } }` (a payout's `invoiceId` is the invoice's ref code) and read `status`.

### 5. No data, or no access

- Empty lists and zero totals everywhere: say "no partner earnings recorded yet", with no invented figures.
- A 403 on these calls: this account can't read partner earnings. Say which call failed, and point the user to the Earnings page in their Wix Studio workspace. Don't retry with a site ID.

## What to report

Lead with amount, period and paid state; then streams, pending, below-threshold, rejected and reversed items, in USD.