Skip to main content

generateCommissionPayout

Requires permission commissions:commission:update.

Gathers a person's locked, unpaid commissions for one period into a pending payout. A period can only be paid once it has ended, and a period with nothing locked is refused. Running it again while the payout is still pending refreshes its total, and a payout already paid cannot be regenerated. Requires permission to update commissions.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation GenerateCommissionPayout($input: GeneratePayoutInput!) {
generateCommissionPayout(input: $input) {
id
repName
status
createdAt
commissionCount
paidAt
}
}

Variables:

{
"input": {
"period": "string",
"userId": "string"
}
}

Response:

{
"data": {
"generateCommissionPayout": {
"id": "id",
"repName": "string",
"status": "LOCKED",
"createdAt": "2025-01-15T00:00:00Z",
"commissionCount": 0,
"paidAt": "2025-01-15T00:00:00Z"
}
}
}
generateCommissionPayout(
input: GeneratePayoutInput!
): CommissionPayout!

Arguments​

generateCommissionPayout.input ● GeneratePayoutInput! non-null input​

The person and the period, as YYYY-MM.

Type​

CommissionPayout object​

A payout settling a rep's commissions for a period.