> ## 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.

# Process Payroll File

> Parses an uploaded payroll file via ADP/UKG parsers, spreadsheet mapping or Claude extraction into validated rows without persisting.

Not available to API keys yet. It will need `payroll:write`.

## OpenAPI

````yaml api-reference/openapi.json POST /stablecoin-payroll/process-payroll-file
openapi: 3.1.0
info:
  title: Toku API
  version: 1.0.0
servers:
  - url: https://api.toku.com
security:
  - bearerAuth: []
paths:
  /stablecoin-payroll/process-payroll-file:
    post:
      operationId: processPayrollFile
      summary: Process Payroll File
      description: >-
        Parses an uploaded payroll file via ADP/UKG parsers, spreadsheet mapping
        or Claude extraction into validated rows without persisting.


        Not available to API keys yet. It will need `payroll:write`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProcessPayrollFileRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProcessPayrollFileResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '409':
          description: Conflict
        '429':
          description: Response 429
components:
  schemas:
    ProcessPayrollFileRequest:
      type: object
      properties:
        tokenPayrollId:
          type: string
        fileName:
          type: string
        fileSize:
          type: number
        fileType:
          type: string
        fileData:
          type: string
        validateOnly:
          type: boolean
        payrollType:
          type: string
        selectedTokenTypeId:
          type:
            - string
            - 'null'
        amountInputMode:
          type: string
          enum:
            - fiat
            - stablecoin
        isADPUpload:
          type: boolean
        isUKGUpload:
          type: boolean
        confirmedMappings:
          type: object
          additionalProperties:
            oneOf:
              - type: string
                enum:
                  - employeeName
                  - employeeFirstName
                  - employeeMiddleName
                  - employeeLastName
                  - employeeEmail
                  - employeeId
                  - positionId
                  - department
                  - currency
                  - grossPay
                  - netPay
                  - bonusPay
                  - allowances
                  - employeeTaxes
                  - employeeDeductions
                  - employerContributions
                  - employerCosts
                  - tokenDistributionValue
                  - digitalAssetNet
                  - stablecoinNet
                  - digitalAssetWithholding
              - type: 'null'
        forceAIExtraction:
          type: boolean
        selectedSheetName:
          type: string
      required:
        - fileName
        - fileSize
        - fileType
        - fileData
    ProcessPayrollFileResponse:
      type: object
      properties:
        success:
          type: boolean
        extractedData:
          type: array
          items: {}
        payrollMetadata: {}
        totalEmployees:
          type: number
        processingTime:
          type: number
        warnings:
          type: array
          items:
            type: string
        errors:
          type: array
          items:
            type: string
        payrollId:
          type: string
        errorDetails:
          type: array
          items:
            type: object
            properties:
              type:
                type: string
              message:
                type: string
              field:
                type: string
              row:
                type: number
              value: {}
              suggestion:
                type: string
            required:
              - type
              - message
        invalidData:
          type: array
          items: {}
        validEmployees:
          type: number
        invalidEmployees:
          type: number
        validateOnly:
          type: boolean
        entityInfo:
          type: object
          properties:
            wasReused:
              type: boolean
            existingName:
              type:
                - string
                - 'null'
            attemptedName:
              type:
                - string
                - 'null'
          required:
            - wasReused
            - existingName
            - attemptedName
        payrollGroups:
          type: array
          items:
            type: object
            properties:
              payrollId:
                type: string
              payrollMetadata: {}
              validEmployees:
                type: array
                items: {}
              invalidEmployees:
                type: array
                items: {}
              totalEmployees:
                type: number
            required:
              - payrollId
              - payrollMetadata
              - validEmployees
              - invalidEmployees
              - totalEmployees
        isMultiPayroll:
          type: boolean
        columnMapping:
          type: object
          properties:
            autoMapped:
              type: array
              items:
                type: object
                properties:
                  sourceHeader:
                    type: string
                  canonicalField:
                    type: string
                  canonicalLabel:
                    type: string
                  confidence:
                    type: number
                  source:
                    type: string
                required:
                  - sourceHeader
                  - canonicalField
                  - canonicalLabel
                  - confidence
                  - source
            needsReview:
              type: array
              items:
                type: object
                properties:
                  sourceHeader:
                    type: string
                  suggestedField:
                    type:
                      - string
                      - 'null'
                  suggestedLabel:
                    type:
                      - string
                      - 'null'
                  confidence:
                    type: number
                  source:
                    type: string
                  reason:
                    type: string
                  sampleValues:
                    type: array
                    items:
                      type: string
                  alternatives:
                    type: array
                    items:
                      type: object
                      properties:
                        canonicalField:
                          type: string
                        canonicalLabel:
                          type: string
                        confidence:
                          type: number
                      required:
                        - canonicalField
                        - canonicalLabel
                        - confidence
                required:
                  - sourceHeader
                  - suggestedField
                  - suggestedLabel
                  - confidence
                  - source
                  - reason
            missingRequired:
              type: array
              items:
                type: string
            readyToImport:
              type: boolean
            countryCode:
              type: string
            sheetName:
              type: string
            availableSheets:
              type: array
              items:
                type: string
            diagnosticCode:
              type: string
            skippedRowCount:
              type: number
            fieldOptions:
              type: array
              items:
                type: object
                properties:
                  value:
                    type: string
                  label:
                    type: string
                required:
                  - value
                  - label
            warnings:
              type: array
              items:
                type: string
          required:
            - autoMapped
            - needsReview
            - missingRequired
            - readyToImport
            - availableSheets
            - skippedRowCount
            - fieldOptions
      required:
        - success
        - extractedData
        - totalEmployees
        - processingTime
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
````
