AlmondTill/G3N API

commissionPayoutReport

query · in the family Reading your records

What it does

The commission payout report — what you owe each seller for the period.

The commission payout report: signed rows per (agent × currency) over entries createdAt ∈ [from, to) — earned/clawedBack/payable/entryCount; late claws land in their own period as negative rows (append-only — close periods after the return window); agentUserId narrows to one agent. NO posting state — payroll is external BY design.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

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

Roles that may call it:

What happens

Reads only.

Arguments

NameTypeRequiredNotes
fromString String!yes
toString String!yes
agentUserIdIDno
limitIntnoHow many records to answer at most; a page may hold fewer.
nextTokenStringnoThe cursor from the previous page, passed back exactly as received.

Returns

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.

Example request

graphql
query ExampleCommissionPayoutReport($from: String!, $to: String!, $agentUserId: ID) {
  commissionPayoutReport(from: $from, to: $to, agentUserId: $agentUserId) {
    items {
      subjectId
      currency
      earnedMinor
      clawedBackMinor
      payableMinor
      entryCount
    }
    nextToken
  }
}

Variables:

json
{
  "from": "<from>",
  "to": "<to>",
  "agentUserId": "01900000-0000-7000-8000-d9a011190000"
}

Example response

json
{
  "data": {
    "commissionPayoutReport": {
      "items": [
        {
          "subjectId": "01900000-0000-7000-8000-a07924ef0000",
          "currency": "USD",
          "earnedMinor": 1250,
          "clawedBackMinor": 1250,
          "payableMinor": 1250,
          "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

Used in