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

# Upsert Account Mapping

> Replaces the client's category-to-QBO-account mappings for an invoice type, resolving names from the live chart of accounts.

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

## OpenAPI

````yaml api-reference/openapi.json POST /platform/upsert-account-mapping
openapi: 3.1.0
info:
  title: Toku API
  version: 1.0.0
servers:
  - url: https://api.toku.com
security:
  - bearerAuth: []
paths:
  /platform/upsert-account-mapping:
    post:
      operationId: upsertAccountMapping
      summary: Upsert Account Mapping
      description: >-
        Replaces the client's category-to-QBO-account mappings for an invoice
        type, resolving names from the live chart of accounts.


        Not available to API keys yet. It will need `integrations:write`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertAccountMappingRequest'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpsertAccountMappingResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
        '409':
          description: Conflict
        '429':
          description: Response 429
components:
  schemas:
    UpsertAccountMappingRequest:
      type: object
      properties:
        clientId:
          type: string
          format: uuid
        invoiceType:
          type: string
          enum:
            - EOR_PEO
            - CONTRACTOR
            - W2_YEAR_END
            - HRIS_PAYROLL
        mappings:
          type: array
          items:
            type: object
            properties:
              tokuCategory:
                type: string
                enum:
                  - GROSS_WAGES
                  - EMPLOYER_TAXES
                  - EMPLOYER_BENEFITS
                  - EOR_MANAGEMENT_FEE
                  - EMPLOYEE_TAX_WITHHOLDING
                  - EMPLOYEE_BENEFITS_WITHHOLDING
                  - ACCOUNTS_PAYABLE
                  - GROSS_CRYPTO
                  - EMPLOYER_TOKEN_TAXES
                  - TOKEN_TAX_WITHHOLDING
                  - NET_CRYPTO_PAYABLE
                  - CONTRACTOR_PAYMENTS
                  - CONTRACTOR_MANAGEMENT_FEE
                  - NET_PAY_CLEARING
                  - EMPLOYER_COST_PAYABLE
              qboAccountId:
                type: string
                minLength: 1
            required:
              - tokuCategory
              - qboAccountId
      required:
        - invoiceType
        - mappings
    UpsertAccountMappingResponse:
      type: object
      properties:
        version:
          type: number
      required:
        - version
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
````
