openapi: 3.1.0
info:
  title: AbaNinja Accounting API - Tax Timelines
  version: 3.0.0
  x-domain-id: accounting
servers:
  - url: https://api.abaninja.ch
    description: The AbaNinja API server
tags:
  - name: accounting-tax-timelines
    description: Manage Tax Timelines
    x-displayName: Tax Timelines
security:
  - ApiToken: []
paths:
  /accounts/{accountUuid}/accounting/v2/tax-timelines:
    get:
      tags:
        - accounting-tax-timelines
      summary: Get all tax timelines
      description: Get all tax timelines
      operationId: accounting_list_tax_timelines
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      title: Tax Timeline
                      properties:
                        uuid:
                          type: string
                          format: uuid
                        taxMethod:
                          type: string
                          enum:
                            - tax_free
                            - brut_method
                            - net_method
                            - flat_rate_method
                        taxConsideration:
                          type: string
                          enum:
                            - AGREED
                            - RECEIVED
                        validFrom:
                          type: string
                          format: date
                        defaultTaxRate:
                          properties:
                            uuid:
                              type: string
                              format: uuid
                            rate:
                              type: number
                          type: object
                        flatTaxConfiguration:
                          properties:
                            flatTaxRateStandard323:
                              type: string
                              format: uuid
                            flatTaxRateReduced333:
                              type: string
                              format: uuid
                            flatTaxRateAccommodation333:
                              type: string
                              format: uuid
                            flatTaxRateStandard322:
                              type: string
                              format: uuid
                            flatTaxRateReduced332:
                              type: string
                              format: uuid
                            flatTaxRateAccommodation332:
                              type: string
                              format: uuid
                          type:
                            - object
                            - 'null'
                      type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/accounting
      x-legacy-operation-id: 4b4fc1715e3dc08d0396cfb8a0f272c8
      x-required-scopes:
        - accounting
    post:
      tags:
        - accounting-tax-timelines
      summary: Create new tax timeline
      description: Create new tax timeline
      operationId: accounting_create_tax_timelines
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Create tax timeline
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/tax-timeline.create.schema.json
              description: A Schema for creating a tax timeline
              type: object
              properties:
                taxMethod:
                  type: string
                  enum:
                    - tax_free
                    - brut_method
                    - net_method
                    - flat_rate_method
                  description: The type of tax method for this period.
                taxConsideration:
                  type: string
                  enum:
                    - AGREED
                    - RECEIVED
                  description: The type of tax consideration for this period.
                defaultTaxRateUuid:
                  type: string
                  format: uuid
                  description: The UUID of the tax rate, that should be prefilled on invoices by default.
                validFrom:
                  type: string
                  format: date
                  description: Date from which on this tax timeline is to be used. This date has to be on the first of any quarter.
                flatTaxConfiguration: {}
              required:
                - taxMethod
                - taxConsideration
                - defaultTaxRateUuid
                - validFrom
              additionalProperties: false
              if:
                properties:
                  taxMethod:
                    enum:
                      - tax_free
                      - brut_method
                      - net_method
              then:
                properties:
                  flatTaxConfiguration:
                    type: 'null'
              else:
                required:
                  - flatTaxConfiguration
                properties:
                  flatTaxConfiguration:
                    type: object
                    properties:
                      flatTaxRateStandard323:
                        type: string
                        format: uuid
                        description: >-
                          The UUID of the flat tax rate, that should be applied instead of the standard tax rate
                          (currently 8.1%) that will be placed into figure 323.
                      flatTaxRateStandard322:
                        type: string
                        format: uuid
                        description: >-
                          The UUID of the flat tax rate, that should be applied instead of the old standard tax rate
                          (currently 7.7%) that will be placed into figure 322.
                      flatTaxRateReduced333:
                        type: string
                        format: uuid
                        description: >-
                          The UUID of the flat tax rate, that should be applied instead of the reduced tax rate
                          (currently 2.6%) that will be placed into figure 333.
                      flatTaxRateReduced332:
                        type: string
                        format: uuid
                        description: >-
                          The UUID of the flat tax rate, that should be applied instead of the old reduced tax rate
                          (currently 2.5%) that will be placed into figure 332.
                      flatTaxRateAccommodation333:
                        type: string
                        format: uuid
                        description: >-
                          The UUID of the flat tax rate, that should be applied instead of the accommodation tax rate
                          (currently 3.7%) that will be placed into figure 333.
                      flatTaxRateAccommodation332:
                        type: string
                        format: uuid
                        description: >-
                          The UUID of the flat tax rate, that should be applied instead of the old accommodation tax
                          rate (currently 3.6%) that will be placed into figure 332.
                    required:
                      - flatTaxRateStandard323
                      - flatTaxRateReduced333
                      - flatTaxRateAccommodation333
                      - flatTaxRateStandard322
                      - flatTaxRateReduced332
                      - flatTaxRateAccommodation332
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Tax Timeline
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      taxMethod:
                        type: string
                        enum:
                          - tax_free
                          - brut_method
                          - net_method
                          - flat_rate_method
                      taxConsideration:
                        type: string
                        enum:
                          - AGREED
                          - RECEIVED
                      validFrom:
                        type: string
                        format: date
                      defaultTaxRate:
                        properties:
                          uuid:
                            type: string
                            format: uuid
                          rate:
                            type: number
                        type: object
                      flatTaxConfiguration:
                        properties:
                          flatTaxRateStandard323:
                            type: string
                            format: uuid
                          flatTaxRateReduced333:
                            type: string
                            format: uuid
                          flatTaxRateAccommodation333:
                            type: string
                            format: uuid
                          flatTaxRateStandard322:
                            type: string
                            format: uuid
                          flatTaxRateReduced332:
                            type: string
                            format: uuid
                          flatTaxRateAccommodation332:
                            type: string
                            format: uuid
                        type:
                          - object
                          - 'null'
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 201
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/accounting
      x-legacy-operation-id: f07ed114b14b89c3ce9d6aac9e2f2bf1
      x-required-scopes:
        - accounting
  /accounts/{accountUuid}/accounting/v2/tax-timelines/{taxTimelineUuid}:
    get:
      tags:
        - accounting-tax-timelines
      summary: Get single tax timelines
      description: Get single tax timelines
      operationId: accounting_get_tax_timelines
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: taxTimelineUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Tax Timeline
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      taxMethod:
                        type: string
                        enum:
                          - tax_free
                          - brut_method
                          - net_method
                          - flat_rate_method
                      taxConsideration:
                        type: string
                        enum:
                          - AGREED
                          - RECEIVED
                      validFrom:
                        type: string
                        format: date
                      defaultTaxRate:
                        properties:
                          uuid:
                            type: string
                            format: uuid
                          rate:
                            type: number
                        type: object
                      flatTaxConfiguration:
                        properties:
                          flatTaxRateStandard323:
                            type: string
                            format: uuid
                          flatTaxRateReduced333:
                            type: string
                            format: uuid
                          flatTaxRateAccommodation333:
                            type: string
                            format: uuid
                          flatTaxRateStandard322:
                            type: string
                            format: uuid
                          flatTaxRateReduced332:
                            type: string
                            format: uuid
                          flatTaxRateAccommodation332:
                            type: string
                            format: uuid
                        type:
                          - object
                          - 'null'
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/accounting
      x-legacy-operation-id: 8cbef8627bc31e82d3b4a339a9721a36
      x-required-scopes:
        - accounting
    patch:
      tags:
        - accounting-tax-timelines
      summary: Update tax timeline
      description: Update tax timeline
      operationId: accounting_update_tax_timelines
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: taxTimelineUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Update tax timeline
        required: false
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              $id: https://api.abaninja.ch/schemas/2.0.0/tax-timeline.update.schema.json
              description: A Schema for updating a tax timeline
              type: object
              properties:
                taxMethod:
                  type: string
                  enum:
                    - tax_free
                    - brut_method
                    - net_method
                    - flat_rate_method
                  description: The type of tax method for this period.
                taxConsideration:
                  type: string
                  enum:
                    - AGREED
                    - RECEIVED
                  description: The type of tax consideration for this period.
                defaultTaxRateUuid:
                  type: string
                  format: uuid
                  description: The UUID of the tax rate, that should be prefilled on invoices by default.
                validFrom:
                  type: string
                  format: date
                  description: Date from which on this tax timeline is to be used. This date has to be on the first of any quarter.
                flatTaxConfiguration:
                  type: object
                  properties:
                    flatTaxRateStandard323:
                      type: string
                      format: uuid
                      description: >-
                        The UUID of the flat tax rate, that should be applied instead of the standard tax rate
                        (currently 8.1%) that will be placed into figure 323.
                    flatTaxRateStandard322:
                      type: string
                      format: uuid
                      description: >-
                        The UUID of the flat tax rate, that should be applied instead of the old standard tax rate
                        (currently 7.7%) that will be placed into figure 322.
                    flatTaxRateReduced333:
                      type: string
                      format: uuid
                      description: >-
                        The UUID of the flat tax rate, that should be applied instead of the reduced tax rate (currently
                        2.6%) that will be placed into figure 333.
                    flatTaxRateReduced332:
                      type: string
                      format: uuid
                      description: >-
                        The UUID of the flat tax rate, that should be applied instead of the old reduced tax rate
                        (currently 2.5%) that will be placed into figure 332.
                    flatTaxRateAccommodation333:
                      type: string
                      format: uuid
                      description: >-
                        The UUID of the flat tax rate, that should be applied instead of the accommodation tax rate
                        (currently 3.7%) that will be placed into figure 333.
                    flatTaxRateAccommodation332:
                      type: string
                      format: uuid
                      description: >-
                        The UUID of the flat tax rate, that should be applied instead of the old accommodation tax rate
                        (currently 3.6%) that will be placed into figure 332.
                  required:
                    - flatTaxRateStandard323
                    - flatTaxRateReduced333
                    - flatTaxRateAccommodation333
                    - flatTaxRateStandard322
                    - flatTaxRateReduced332
                    - flatTaxRateAccommodation332
              additionalProperties: false
              if:
                required:
                  - taxMethod
                properties:
                  taxMethod:
                    const: flat_rate_method
              then:
                required:
                  - flatTaxConfiguration
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data:
                    title: Tax Timeline
                    properties:
                      uuid:
                        type: string
                        format: uuid
                      taxMethod:
                        type: string
                        enum:
                          - tax_free
                          - brut_method
                          - net_method
                          - flat_rate_method
                      taxConsideration:
                        type: string
                        enum:
                          - AGREED
                          - RECEIVED
                      validFrom:
                        type: string
                        format: date
                      defaultTaxRate:
                        properties:
                          uuid:
                            type: string
                            format: uuid
                          rate:
                            type: number
                        type: object
                      flatTaxConfiguration:
                        properties:
                          flatTaxRateStandard323:
                            type: string
                            format: uuid
                          flatTaxRateReduced333:
                            type: string
                            format: uuid
                          flatTaxRateAccommodation333:
                            type: string
                            format: uuid
                          flatTaxRateStandard322:
                            type: string
                            format: uuid
                          flatTaxRateReduced332:
                            type: string
                            format: uuid
                          flatTaxRateAccommodation332:
                            type: string
                            format: uuid
                        type:
                          - object
                          - 'null'
                    type: object
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/accounting
      x-legacy-operation-id: 6a16b53f5a4866672258b6131f10ee35
      x-required-scopes:
        - accounting
    delete:
      tags:
        - accounting-tax-timelines
      summary: Delete tax timeline
      description: Delete tax timeline
      operationId: accounting_delete_tax_timelines
      parameters:
        - name: accountUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: taxTimelineUuid
          in: path
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                properties:
                  data: {}
                  message:
                    title: message
                    type: string
                  status:
                    example: 200
                  meta:
                    title: meta
                    type:
                      - object
                      - 'null'
                required:
                  - data
                  - message
                  - status
        '400':
          description: Bad request or validation error
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                properties:
                  detail:
                    title: details
                  type:
                    title: type
                    type: string
                  requestUuid:
                    title: requestUuid
                    type: string
                    format: uuid
                  path:
                    title: path
                    type: string
                  message:
                    title: message
                    type:
                      - string
                      - 'null'
                  status:
                    title: status
                    description: HTTP status code
                    type: integer
                required:
                  - detail
                  - type
                  - message
                  - status
      security:
        - ApiToken:
            - https://api.abaninja.ch/auth/accounting
      x-legacy-operation-id: d4690bd8f7fac483ae20d5a7d2637d1d
      x-required-scopes:
        - accounting
components:
  securitySchemes:
    ApiToken:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication. Create tokens in Settings > API Token.
