# affiliatePayoutReport

query · in the family [Reading your records](/reference/reading-your-records/)

## What it does

The payout report for affiliates — what you owe each partner for the period.

The affiliate payout twin: signed rows per (affiliate × currency).

## What happens

Reads only; the numbers to settle with your partners.

## Who may call it

Capability area: **Reading your records** — Looking up and listing the records of your organization.

- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows `api:affiliatePayoutReport`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `from` | [String](/types/#scalars) `String!` | yes | No further notes. |
| `to` | [String](/types/#scalars) `String!` | yes | No further notes. |
| `affiliateId` | [ID](/types/#scalars) | no | No further notes. |
| `limit` | [Int](/types/#scalars) | no | How many records to answer at most; a page may hold fewer. |
| `nextToken` | [String](/types/#scalars) | no | The cursor from the previous page, passed back exactly as received. |

## Returns

[CommissionPayoutRowPage](/types/CommissionPayoutRowPage/) `CommissionPayoutRowPage!` — One payout-report page.

This is a page: `items` holds the records and `nextToken` the cursor for the next page — pass it back verbatim until it is null. See [paging](/guides/paging-and-the-cursor-grammar/).

## Example request

```graphql
query ExampleAffiliatePayoutReport($from: String!, $to: String!, $affiliateId: ID) {
  affiliatePayoutReport(from: $from, to: $to, affiliateId: $affiliateId) {
    items {
      subjectId
      currency
      earnedMinor
      clawedBackMinor
      payableMinor
      entryCount
    }
    nextToken
  }
}
```

Variables:

```json
{
  "from": "<from>",
  "to": "<to>",
  "affiliateId": "01900000-0000-7000-8000-ab1bc9b90000"
}
```

## Example response

```json
{
  "data": {
    "affiliatePayoutReport": {
      "items": [
        {
          "subjectId": "01900000-0000-7000-8000-91fe7ba20000",
          "currency": "USD",
          "earnedMinor": 1,
          "clawedBackMinor": 1,
          "payableMinor": 1,
          "entryCount": 1
        }
      ],
      "nextToken": "<the cursor from the previous page>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```

## Errors this call can answer

- `VALIDATION/INVALID` — Something in the request is not valid. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/NOT_FOUND/))

## Used in

- [Pay the people who sell for you — staff commissions and referral partners](/use-cases/pay-the-people-who-sell-for-you/)
