> ## Documentation Index
> Fetch the complete documentation index at: https://docs.toku.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Validate and Calculate Payroll

> Validates employee payroll rows and returns calculated payroll breakdown data.



## OpenAPI

````yaml POST /validateAndCalculatePayroll
openapi: 3.0.0
info:
  title: Toku API
  version: 1.0.0
  description: >-
    The Toku API lets you programmatically manage token grants, wallets,
    employees, payroll, and invoices. Build custom integrations and automate
    your token compensation workflows.
servers:
  - url: https://app.toku.com/api/tokuApi/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Grants
    description: Create, list, terminate, and revert token grants
  - name: Wallets
    description: Manage recipient wallets, verification, and distributions
  - name: Employees
    description: Manage user roles within your organization
  - name: Tokens & Networks
    description: Configure token types and blockchain networks for your organization
  - name: Invoices
    description: Submit and settle invoice payments
  - name: Organization
    description: Configure organization settings
  - name: Distributions
    description: >-
      Approve vestings, add tax details, update FMV, finalize, submit
      settlements, and track status
  - name: Custody
    description: >-
      Connect custody providers (Fireblocks, Anchorage, Safe), manage custody
      wallets, and allocate to grants
  - name: Authentication
    description: Partner API token management
  - name: Payroll
    description: Payroll run creation, management, and state transitions
  - name: EOR
    description: Employer of Record employee onboarding and management
  - name: Payslips
    description: Payslip generation, upload, and retrieval
  - name: Webhooks
    description: Webhook endpoint management and event delivery
  - name: Stablecoin Funding
    description: Token payroll creation and stablecoin settlement
paths:
  /validateAndCalculatePayroll:
    post:
      tags:
        - Payroll
      summary: Validate and calculate payroll
      description: >-
        Validates employee payroll rows and returns calculated payroll breakdown
        data.
      operationId: validateAndCalculatePayroll
      parameters:
        - name: x-role-type
          in: header
          required: true
          description: >-
            Role context for the request. Use CLIENT_ORG_ADMIN for most
            integrations.
          example: CLIENT_ORG_ADMIN
          schema:
            type: string
            enum:
              - CLIENT_ORG_ADMIN
              - PAYROLL_ADMIN
              - FINANCE_ADMIN
              - TOKU_ADMIN
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ValidateAndCalculatePayrollInput'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidateAndCalculatePayrollResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - bearerAuth: []
components:
  schemas:
    ValidateAndCalculatePayrollInput:
      type: object
      required:
        - payrollId
        - employeeData
      properties:
        payrollId:
          type: string
          format: uuid
          description: Payroll identifier
        employeeData:
          type: array
          items:
            type: object
            required:
              - employeeId
              - employeeName
              - totalCompensation
              - totalDeduction
              - currency
              - id
            properties:
              employeeId:
                type: string
                description: Employee identifier
              employeeName:
                type: string
                description: Employee full name
              totalCompensation:
                type: number
                description: Gross pay before deductions
              totalDeduction:
                type: number
                description: Total deductions
              currency:
                type: string
                description: Payroll currency code
              stableCoinPercentage:
                type: number
                description: Percentage of pay allocated to stablecoin
                nullable: true
              minimumWage:
                type: number
                description: Applicable minimum wage for validation
                nullable: true
              id:
                type: string
                description: Row identifier
          description: Payroll input rows to validate
        isCSVUploaded:
          type: boolean
          description: Whether the rows originated from a CSV upload
          nullable: true
    ValidateAndCalculatePayrollResponse:
      type: object
      properties:
        validatedEmployeeData:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Row identifier
              employeeId:
                type: string
                description: Employee identifier
              employeeName:
                type: string
                description: Employee full name
              totalCompensation:
                type: number
                description: Gross pay before deductions
              totalDeduction:
                type: number
                description: Total deductions
              currency:
                type: string
                description: Payroll currency code
              stableCoinPercentage:
                type: number
                description: Percentage of pay allocated to stablecoin
                nullable: true
              netPayFiat:
                type: number
                description: Calculated net fiat pay
                nullable: true
              netPayStableCoin:
                type: number
                description: Calculated net stablecoin pay
                nullable: true
              hasTGAProfile:
                type: boolean
                description: Whether the employee has a Toku profile
                nullable: true
              hasValidWallet:
                type: boolean
                description: Whether the employee has a valid wallet configured
                nullable: true
              hasPayrollError:
                type: boolean
                description: Whether payroll validation found an error
                nullable: true
              hasMinimumWageError:
                type: boolean
                description: Whether minimum wage validation failed
                nullable: true
          description: Validated payroll rows
          nullable: true
        error:
          type: string
          description: Validation error message
          nullable: true
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Short error message
        details:
          type: string
          description: Additional debugging information
  responses:
    Unauthorized:
      description: Authentication failed — token missing, invalid, or expired
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Caller does not have the required role
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Rate limit exceeded (100 req/min per IP)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Personal API token. Create via createUserApiToken endpoint.

````