openapi: 3.0.1
info:
  title: 'country-store-service-api REST Service: API Specification'
  description: Update with description of API Service
  version: 0.0.45
servers:
- description: ''
  url: https://api.btx.fr.banqup.com/tax/countries
- description: ''
  url: https://api.btx.eu.banqup.com/tax/countries
paths:
  /v1/countryGroups/{countryGroupId}/memberships:
    get:
      tags:
      - countryGroupMemberships
      description: 'Get a list of all country group memberships <br/> Scope: []'
      operationId: getAllCountryGroupMemberships
      parameters:
      - name: countryGroupId
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCountryGroupMembershipResponse'
              example:
                memberships:
                - id: 00000011-0000-0000-0000-000000000000
                  startDate: '1970-01-01'
                  endDate: '2099-12-31'
                  excluded: false
                  territory:
                    id: 00000001-0000-0000-0000-000000000000
                    shortName: Netherlands
                    fullName: Kingdom of the Netherlands
                    alpha2: NL
                    alpha3: NLD
                    numericCode: '528'
                    code: ''
                    taxPrefix: NL
                    taxRegex: ^[0-9]{11}$
                    isTest: false
                - id: 00000001-0000-0000-0000-000000000000
                  startDate: '1970-01-01'
                  endDate: '2099-12-31'
                  excluded: false
                  territory:
                    id: 00000011-0000-0000-0000-000000000000
                    shortName: Belgium
                    fullName: Kingdom of Belgium
                    alpha2: BE
                    alpha3: BEL
                    numericCode: '056'
                    code: ''
                    taxPrefix: BE
                    taxRegex: ^[0-9]{11}$
                    isTest: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Country Group not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    post:
      tags:
      - countryGroupMemberships
      description: 'Create a new country group membership <br/> Scope: []'
      operationId: createCountryGroupMembership
      parameters:
      - name: countryGroupId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        description: Country group membership to create
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/CountryGroupMembershipRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountryGroupMembership'
              example:
                id: 00000011-0000-0000-0000-000000000000
                startDate: '2021-01-01'
                endDate: '2023-12-31'
                excluded: false
                territory:
                  id: 00000001-0000-0000-0000-000000000000
                  shortName: Netherlands
                  fullName: Kingdom of the Netherlands
                  alpha2: NL
                  alpha3: NLD
                  numericCode: '528'
                  code: ''
                  taxPrefix: NL
                  taxRegex: ^[0-9]{11}$
                  isTest: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Country Group not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
  /v1/countryGroups/{countryGroupId}/memberships/{membershipId}:
    delete:
      tags:
      - countryGroupMemberships
      description: 'Delete country group membership by UUID <br/> Scope: []'
      operationId: deleteCountryGroupMembership
      parameters:
      - name: countryGroupId
        in: path
        required: true
        schema:
          type: string
      - name: membershipId
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content - The country group membership was successfully
            deleted.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Country Group or Membership not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    patch:
      tags:
      - countryGroupMemberships
      description: 'Update an existing country group membership by UUID <br/> Scope:
        []'
      operationId: updateCountryGroupMembership
      parameters:
      - name: countryGroupId
        in: path
        required: true
        schema:
          type: string
      - name: membershipId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        description: Update country group membership data
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/CountryGroupMembershipPatchRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountryGroupMembershipPatchRequest'
              example:
                startDate: '2021-01-01'
                endDate: '2023-12-31'
                excluded: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Country Group or Membership not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
  /v1/countryGroups:
    get:
      tags:
      - countryGroups
      description: 'Get a list of all country groups <br/> Scope: []'
      operationId: getAllCountryGroups
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCountryGroupResponse'
              example:
                countryGroups:
                - id: 00000011-0000-0000-0000-000000000000
                  name: EU
                  type: TRADE_BLOCK
                - id: 00000001-0000-0000-0000-000000000000
                  name: GCC
                  type: TRADE_BLOCK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    post:
      tags:
      - countryGroups
      description: 'Create a new country group <br/> Scope: []'
      operationId: createCountryGroup
      requestBody:
        description: Country group to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CountryGroupRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountryGroup'
              example:
                id: 00000011-0000-0000-0000-000000000000
                name: European Union
                type: TRADE_BLOCK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
  /v1/countryGroups/{countryGroupId}:
    get:
      tags:
      - countryGroups
      description: 'Get country group by uuid <br/> Scope: []'
      operationId: getCountryGroup
      parameters:
      - name: countryGroupId
        in: path
        description: The country group identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountryGroup'
              example:
                id: 00000011-0000-0000-0000-000000000000
                name: European Union
                type: TRADE_BLOCK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    delete:
      tags:
      - countryGroups
      description: 'Delete country group  by uuid <br/> Scope: []'
      operationId: deleteCountryGroup
      parameters:
      - name: countryGroupId
        in: path
        description: The countryGroupUuid identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content - The country group was successfully deleted.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    patch:
      tags:
      - countryGroups
      description: 'Update an existing country group by uuid <br/> Scope: []'
      operationId: updateCountryGroup
      parameters:
      - name: countryGroupId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        description: Update country group data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CountryGroupRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountryGroup'
              example:
                id: 00000011-0000-0000-0000-000000000000
                name: European Union
                type: TRADE_BLOCK
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
  /v1/territories/{territoryId}/subdivisions:
    get:
      tags:
      - subdivisions
      description: 'Get a list of all subdivisions of a territory <br/> Scope: []'
      operationId: getAllSubdivisions
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: search
        in: query
        description: Search term to filter out subdivisions
        schema:
          type: string
      - name: taxType
        in: query
        description: Filter subdivisions by tax type
        schema:
          type: string
      - name: sortBy
        in: query
        description: Sort by criteria
        schema:
          type: string
          enum:
          - shortName
          - shortName.asc
          - shortName.desc
          - fullName
          - fullName.asc
          - fullName.desc
          - alpha2
          - alpha2.asc
          - alpha2.desc
          - alpha3
          - alpha3.asc
          - alpha3.desc
          - code
          - code.asc
          - code.desc
        example: name
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListSubdivisionResponse'
              example:
                subdivisions:
                - id: 00000011-0000-0000-0000-000000000001
                  shortName: Corsica
                  fullName: Corsica
                  code: FR-20R
                  taxPrefix: FR
                  taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                  isTest: false
                  subdivisions: []
                  taxTypes: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    post:
      tags:
      - subdivisions
      description: 'Create a new subdivision <br/> Scope: []'
      operationId: createSubdivision
      parameters:
      - name: territoryId
        in: path
        description: The country uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Territory to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubdivisionRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subdivision'
              example:
                id: 00000011-0000-0000-0000-000000000001
                shortName: Corsica
                fullName: Corsica
                code: FR-20R
                taxPrefix: FR
                taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                isTest: false
                subdivisions: []
                taxTypes: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
  /v1/territories/{territoryId}/subdivisions/{subdivisionId}:
    get:
      tags:
      - subdivisions
      description: 'Get subdivision by uuid <br/> Scope: []'
      operationId: getSubdivision
      parameters:
      - name: territoryId
        in: path
        description: The parent territory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: subdivisionId
        in: path
        description: The subdivision identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subdivision'
              example:
                id: 00000011-0000-0000-0000-000000000001
                shortName: Corsica
                fullName: Corsica
                code: FR-20R
                taxPrefix: FR
                taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                isTest: false
                subdivisions: []
                taxTypes: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    delete:
      tags:
      - subdivisions
      description: 'Delete subdivision by uuid <br/> Scope: []'
      operationId: deleteSubdivision
      parameters:
      - name: territoryId
        in: path
        description: The parent territory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: subdivisionId
        in: path
        description: The subdivision identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content - The subdivision was successfully deleted.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    patch:
      tags:
      - subdivisions
      description: 'Update an existing subdivision by uuid <br/> Scope: []'
      operationId: updateSubdivision
      parameters:
      - name: territoryId
        in: path
        description: The parent territory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: subdivisionId
        in: path
        description: The subdivision identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Update subdivision data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubdivisionRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subdivision'
              example:
                id: 00000011-0000-0000-0000-000000000001
                shortName: Corsica
                fullName: Corsica
                code: FR-20R
                taxPrefix: FR
                taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                isTest: false
                subdivisions: []
                taxTypes: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
  /v1/taxRateCategories:
    get:
      tags:
      - taxRateCategories
      description: 'Get a list of all tax rate categories <br/> Scope: []'
      operationId: getAllTaxRateCategories
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTaxRateCategoryResponse'
              example:
                taxRateCategories:
                - id: 00000011-0000-0000-0000-000000000000
                  name: Standard
                  taxType: ITX
                  isDefault: true
                - id: 00000001-0000-0000-0000-000000000000
                  name: Reduced
                  taxType: ITX
                  isDefault: false
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    post:
      tags:
      - taxRateCategories
      description: 'Create a new tax rate category <br/> Scope: []'
      operationId: createTaxRateCategory
      requestBody:
        description: Tax rate category to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ListTaxRateCategory'
            example:
              name: Standard
              taxType: ITX
              isDefault: true
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTaxRateCategory'
              example:
                id: 00000011-0000-0000-0000-000000000000
                name: Standard
                taxType: ITX
                isDefault: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
  /v1/taxRateCategories/{taxRateCategoryId}:
    delete:
      tags:
      - taxRateCategories
      description: 'Delete tax rate category by UUID <br/> Scope: []'
      operationId: deleteTaxRateCategory
      parameters:
      - name: taxRateCategoryId
        in: path
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content - The tax rate category was successfully deleted.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Tax rate category UUID not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    patch:
      tags:
      - taxRateCategories
      description: 'Update an existing tax rate category by uuid <br/> Scope: []'
      operationId: updateTaxRateCategory
      parameters:
      - name: taxRateCategoryId
        in: path
        required: true
        schema:
          type: string
      requestBody:
        description: Update tax rate category data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxRateCategoryPatchRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxRateCategoryPatchRequest'
              example:
                name: Standard
                isDefault: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
  /v1/territories/{territoryId}/taxTypes/{taxTypeId}/taxRates:
    get:
      tags:
      - taxRates
      summary: Get all tax rates for a specified tax rate category
      operationId: getAllTaxRates
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxTypeId
        in: path
        description: The tax type uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTaxRateResponse'
              example:
                taxRates:
                - id: 51f01025-b960-406a-b1c1-d758ca3a1e80
                  rate: 9.775
                  startDate: '2021-01-01'
                  endDate: '2023-12-31'
                  taxRateCategory:
                    id: 00000011-0000-0000-0000-000000000000
                    name: Standard
                    taxType: ITX
                    isDefault: true
                - id: f2a93c5d-1a4d-4827-9029-3d163cc7f848
                  rate: 20.0
                  startDate: '2020-01-01'
                  endDate: '2025-12-31'
                  taxRateCategory:
                    id: 00000022-0000-0000-0000-000000000000
                    name: Reduced
                    taxType: ITX
                    isDefault: false
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      description: ' <br/> Scope: []'
    post:
      tags:
      - taxRates
      summary: Create a new tax rate
      operationId: createTaxRate
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxTypeId
        in: path
        description: The tax type uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Tax rate to be created
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxRateRequest'
        required: true
      responses:
        '201':
          description: Tax rate created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxRate'
              example:
                id: 51f01025-b960-406a-b1c1-d758ca3a1e80
                rate: 9.775
                startDate: '2021-01-01'
                endDate: '2023-12-31'
                taxRateCategory:
                  id: 00000011-0000-0000-0000-000000000000
                  name: Standard
                  taxType: ITX
                  isDefault: true
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      description: ' <br/> Scope: []'
  /v1/territories/{territoryId}/taxTypes/{taxTypeId}/taxRates/{taxRateId}:
    delete:
      tags:
      - taxRates
      summary: Delete a specific tax rate
      operationId: deleteTaxRate
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxTypeId
        in: path
        description: The tax type uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxRateId
        in: path
        description: The rate uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content - The tax rate was successfully deleted.
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      description: ' <br/> Scope: []'
    patch:
      tags:
      - taxRates
      summary: Update a specific tax rate
      operationId: updateTaxRate
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxTypeId
        in: path
        description: The tax type uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxRateId
        in: path
        description: The rate uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Updated tax rate data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxRateRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxRate'
              example:
                id: 51f01025-b960-406a-b1c1-d758ca3a1e80
                rate: 9.775
                startDate: '2021-01-01'
                endDate: '2023-12-31'
                taxRateCategory:
                  id: 00000011-0000-0000-0000-000000000000
                  name: Standard
                  taxType: ITX
                  isDefault: true
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      description: ' <br/> Scope: []'
  /v1/territories/{territoryCode}/taxType/{taxType}/taxRates:
    get:
      tags:
      - taxRates
      summary: Get all tax rates for a territory by tax type
      operationId: getAllTaxRatesByTerritoryCodeAndTaxType
      parameters:
      - name: territoryCode
        in: path
        description: Territory code
        required: true
        schema:
          type: string
      - name: taxType
        in: path
        description: Tax type
        required: true
        schema:
          type: string
          enum:
          - ITX
          - PPT
          - WHT
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTaxRateResponse'
              example:
                taxRates:
                - id: 51f01025-b960-406a-b1c1-d758ca3a1e80
                  rate: 9.775
                  startDate: '2021-01-01'
                  endDate: '2023-12-31'
                  taxRateCategory:
                    id: 00000011-0000-0000-0000-000000000000
                    name: Standard
                    taxType: ITX
                    isDefault: true
                - id: f2a93c5d-1a4d-4827-9029-3d163cc7f848
                  rate: 20.0
                  startDate: '2020-01-01'
                  endDate: '2025-12-31'
                  taxRateCategory:
                    id: 00000022-0000-0000-0000-000000000000
                    name: Reduced
                    taxType: ITX
                    isDefault: false
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
      description: ' <br/> Scope: []'
  /v1/territories:
    get:
      tags:
      - territories
      description: 'Get a list of all territories and their subdivisions <br/> Scope:
        []'
      operationId: getAllTerritories
      parameters:
      - name: search
        in: query
        description: Search term to filter out territories
        schema:
          type: string
      - name: taxType
        in: query
        description: Filter territories by tax type
        schema:
          type: string
      - name: page
        in: query
        description: Zero-based page index, cannot be negative, default 0
        schema:
          type: integer
          format: int32
        example: 20
      - name: pageSize
        in: query
        description: 'Page size. Minimum 1, maximum: 400, default 20'
        schema:
          type: integer
          format: int32
        example: 20
      - name: includeTotalElements
        in: query
        description: Return the totalElements number of entries in the response
        schema:
          type: boolean
        example: true
      - name: sortBy
        in: query
        description: Sort by criteria
        schema:
          type: string
          enum:
          - shortName
          - shortName.asc
          - shortName.desc
          - fullName
          - fullName.asc
          - fullName.desc
          - alpha2
          - alpha2.asc
          - alpha2.desc
          - alpha3
          - alpha3.asc
          - alpha3.desc
          - code
          - code.asc
          - code.desc
        example: name
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListCountryResponse'
              example:
                territories:
                - id: d34654a3-ccd4-4a86-9a39-6f6a99c8a262
                  shortName: France
                  fullName: the French Republic
                  alpha2: FR
                  alpha3: FRA
                  numericCode: '250'
                  isIndependent: true
                  taxPrefix: FR
                  taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                  isTest: false
                  subdivisions: []
                  taxTypes:
                  - id: 704e98f9-76a3-4b14-b648-7c52bdd502ad
                    taxType: ITX
                    contentStatus: ACTIVE
                    calculationMethod: DEFAULT
                - id: ae5c3f92-b052-4ea6-a714-738a2de93367
                  shortName: Belgium
                  fullName: the Kingdom of Belgium
                  alpha2: BE
                  alpha3: BEL
                  numericCode: '056'
                  isIndependent: false
                  taxPrefix: BE
                  taxRegex: ^BE[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                  isTest: false
                  subdivisions: []
                  taxTypes:
                  - id: d957351b-d235-4aa5-b9ca-6473c73268bd
                    taxType: ITX
                    contentStatus: INACTIVE
                    calculationMethod: DEFAULT
                  - id: b42856f4-89c3-4d66-8e68-68a5178ec76d
                    taxType: PPT
                    contentStatus: INACTIVE
                    calculationMethod: GST_CANADA
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    post:
      tags:
      - territories
      description: 'Create a new country <br/> Scope: []'
      operationId: createCountry
      requestBody:
        description: Country to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CountryRequest'
            example: "{\n     \"shortName\": \"Belgium\",\n     \"fullName\": \"the
              Kingdom of Belgium\",\n     \"alpha2\": \"BE\",\n     \"alpha3\": \"\
              BEL\",\n     \"numericCode\": \"056\",\n     \"isIndependent\": true,\n\
              \     \"taxPrefix\": \"BE\",\n     \"taxRegex\": \"^BE[A-Z0-9]{2}\\\
              s?\\d{9}$|^EU\\d{9}$|^IM\\d{10}$\",\n     \"isTest\": false\n }"
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Country'
              example:
                id: 00000011-0000-0000-0000-000000000000
                shortName: France
                fullName: the French Republic
                alpha2: FR
                alpha3: FRA
                numericCode: '250'
                isIndependent: true
                taxPrefix: FR
                taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                isTest: false
                subdivisions:
                - id: 00000011-0000-0000-0000-000000000001
                  shortName: Corsica
                  fullName: Corsica
                  code: FR-20R
                  taxPrefix: FR
                  taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                  isTest: false
                  subdivisions: []
                taxTypes: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
  /v1/territories/{territoryId}:
    get:
      tags:
      - territories
      description: 'Get territory by uuid <br/> Scope: []'
      operationId: getTerritory
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Country'
              example:
                id: 00000011-0000-0000-0000-000000000000
                shortName: France
                fullName: the French Republic
                alpha2: FR
                alpha3: FRA
                numericCode: '250'
                isIndependent: true
                taxPrefix: FR
                taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                isTest: false
                subdivisions:
                - id: 00000011-0000-0000-0000-000000000001
                  shortName: Corsica
                  fullName: Corsica
                  code: FR-20R
                  taxPrefix: FR
                  taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                  isTest: false
                  subdivisions: []
                taxTypes: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    delete:
      tags:
      - territories
      description: 'Delete territory by uuid <br/> Scope: []'
      operationId: deleteTerritory
      parameters:
      - name: territoryId
        in: path
        description: The territory Uuid
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content - The territory was successfully deleted.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    patch:
      tags:
      - territories
      description: 'Update an existing country by uuid <br/> Scope: []'
      operationId: updateCountry
      parameters:
      - name: territoryId
        in: path
        description: The territory Uuid
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Update country data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CountryRequest'
            example: "{\n     \"shortName\": \"Belgium\",\n     \"fullName\": \"the
              Kingdom of Belgium\",\n     \"alpha2\": \"BE\",\n     \"alpha3\": \"\
              BEL\",\n     \"numericCode\": \"056\",\n     \"isIndependent\": true,\n\
              \     \"taxPrefix\": \"BE\",\n     \"taxRegex\": \"^BE[A-Z0-9]{2}\\\
              s?\\d{9}$|^EU\\d{9}$|^IM\\d{10}$\",\n     \"isTest\": false\n }"
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Country'
              example:
                id: 00000011-0000-0000-0000-000000000000
                shortName: France
                fullName: the French Republic
                alpha2: FR
                alpha3: FRA
                numericCode: '250'
                isIndependent: true
                taxPrefix: FR
                taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                isTest: false
                subdivisions:
                - id: 00000011-0000-0000-0000-000000000001
                  shortName: Corsica
                  fullName: Corsica
                  code: FR-20R
                  taxPrefix: FR
                  taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                  isTest: false
                  subdivisions: []
                taxTypes: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
  /v1/validateTerritory/{territoryId}:
    get:
      tags:
      - territories
      description: 'Validates territory by uuid <br/> Scope: []'
      operationId: validateTerritory
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subdivision'
              example:
                id: 00000011-0000-0000-0000-000000000001
                shortName: Corsica
                fullName: Corsica
                code: FR-20R
                taxPrefix: FR
                taxRegex: ^FR[A-Z0-9]{2}\s?\d{9}$|^EU\d{9}$|^IM\d{10}$
                isTest: false
                subdivisions: []
                taxTypes: []
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
  /v1/territories/{territoryId}/taxIdTypes:
    get:
      tags:
      - taxIdTypes
      description: 'Get a list of all tax ID types for a territory <br/> Scope: []'
      operationId: getAllTaxIdTypes
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTerritoryTaxIdTypeResponse'
              example:
                taxIdTypes:
                - id: 00000011-0000-0000-0000-000000000000
                  taxType: ITX
                  taxIdType: FIXED_ESTABLISHMENT
                - id: 00000001-0000-0000-0000-000000000000
                  taxType: ITX
                  taxIdType: IOSS
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
    post:
      tags:
      - taxIdTypes
      description: 'Create a new tax ID type for a territory <br/> Scope: []'
      operationId: createTaxIdType
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
      requestBody:
        description: Tax ID type to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerritoryTaxIdTypeRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerritoryTaxIdType'
              example:
                id: 00000011-0000-0000-0000-000000000000
                taxType: ITX
                taxIdType: FIXED_ESTABLISHMENT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
  /v1/territories/{territoryId}/taxIdTypes/{taxIdTypeId}:
    delete:
      tags:
      - taxIdTypes
      description: 'Delete a tax ID type for a territory <br/> Scope: []'
      operationId: deleteTaxIdType
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
      - name: taxIdTypeId
        in: path
        description: The tax ID type identifier
        required: true
        schema:
          type: string
      responses:
        '204':
          description: No Content - The tax ID type was successfully deleted.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
    patch:
      tags:
      - taxIdTypes
      description: 'Update an existing tax ID type for a territory <br/> Scope: []'
      operationId: updateTaxIdType
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
      - name: taxIdTypeId
        in: path
        description: The tax ID type identifier
        required: true
        schema:
          type: string
      requestBody:
        description: Updated tax ID type data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerritoryTaxIdTypeRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerritoryTaxIdType'
              example:
                id: 00000011-0000-0000-0000-000000000000
                taxType: ITX
                taxIdType: FIXED_ESTABLISHMENT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
  /v1/territories/{territoryId}/taxTypes:
    get:
      tags:
      - taxTypes
      description: 'Get a list of all tax types <br/> Scope: []'
      operationId: getAllTaxTypes
      parameters:
      - name: territoryId
        in: path
        description: The territory identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListTerritoryTaxTypeResponse'
              example:
                taxTypes:
                - id: 00000011-0000-0000-0000-000000000000
                  contentStatus: ACTIVE
                  taxType: ITX
                  calculationMethod: DEFAULT
                - id: 00000001-0000-0000-0000-000000000000
                  contentStatus: INACTIVE
                  taxType: ITX
                  calculationMethod: DEFAULT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    post:
      tags:
      - taxTypes
      description: 'Create a new tax type <br/> Scope: []'
      operationId: createTaxType
      parameters:
      - name: territoryId
        in: path
        description: The territory uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Tax type to create
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerritoryTaxTypeRequest'
            example:
              taxType: ITX
              calculationMethod: DEFAULT
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerritoryTaxType'
              example:
                id: 00000011-0000-0000-0000-000000000000
                contentStatus: INACTIVE
                taxType: ITX
                calculationMethod: DEFAULT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
  /v1/territories/{territoryId}/taxTypes/{taxTypeId}:
    delete:
      tags:
      - taxTypes
      description: 'Delete tax type by uuid <br/> Scope: []'
      operationId: deleteTaxType
      parameters:
      - name: territoryId
        in: path
        description: The territory Uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxTypeId
        in: path
        description: The tax type identifier
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: No Content - The territory was successfully deleted.
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
    patch:
      tags:
      - taxTypes
      description: 'Update an existing territory tax type by uuid <br/> Scope: []'
      operationId: updateTaxType
      parameters:
      - name: territoryId
        in: path
        description: The territory uuid identifier
        required: true
        schema:
          type: string
          format: uuid
      - name: taxTypeId
        in: path
        description: The tax type identifier
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Tax type data to update
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerritoryTaxTypePatchRequest'
            example:
              contentStatus: TEST
              calculationMethod: DEFAULT
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerritoryTaxType'
              example:
                id: 00000011-0000-0000-0000-000000000000
                contentStatus: INACTIVE
                taxType: ITX
                calculationMethod: DEFAULT
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 400
                error: BAD_REQUEST
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Bad Request
                detail: Bad Request message details.
        '404':
          description: Tax type UUID could not be found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorProblemDetail'
              example:
                status: 404
                error: NOT_FOUND
                requestId: a78150d2-7913-4ea6-933f-286cadac6745
                timestamp: '2018-08-27T12:34:50.000Z'
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
  /v1/validateTerritoryTaxRateCategory:
    post:
      tags:
      - taxTypes
      operationId: validateTerritoryTaxRateCategory
      requestBody:
        description: Territory tax type to validate
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TerritoryTaxTypeValidationRequest'
            example:
              territoryId: 550e8400-e29b-41d4-a716-446655440000
              taxRateCategoryId: 550e8400-e29b-41d4-a716-446655440001
        required: true
      responses:
        default:
          description: default response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerritoryTaxTypeValidation'
      description: ' <br/> Scope: []'
components:
  schemas:
    CountryGroupMembership:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the country group membership
          format: uuid
        startDate:
          type: string
          description: Start date of the membership
          format: date
        endDate:
          type: string
          description: End date of the membership
          format: date
        excluded:
          type: boolean
          description: Flag to indicate if the country is excluded from the group
        territory:
          $ref: '#/components/schemas/Territory'
      description: List of country groups memberships
    Territory:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the territory
          format: uuid
        shortName:
          type: string
          description: Short name of the territory
        fullName:
          type: string
          description: Full name of the territory
        alpha2:
          type: string
          description: Two-letter ISO code of the territory
        alpha3:
          type: string
          description: Three-letter ISO code of the territory
        numericCode:
          type: string
          description: Numeric ISO code of the territory
        jurisdictionType:
          type: string
          description: Jurisdiction type of the territory
          enum:
          - COUNTRY
          - SUBDIVISION
        isIndependent:
          type: boolean
          description: Flag to indicate country's independence status
          default: false
        taxPrefix:
          type: string
          description: Tax prefix used in the territory
        taxRegex:
          type: string
          description: Regular expression for validating tax numbers in the territory
        isTest:
          type: boolean
          description: Flag to indicate if this is a test record
        code:
          type: string
          description: Subdivision ISO code of the territory
      description: Territory that is a member of the group
    ApiErrorProblemDetail:
      required:
      - error
      - requestId
      - timestamp
      type: object
      properties:
        status:
          type: integer
          format: int32
        error:
          type: string
        requestId:
          type: string
        timestamp:
          type: string
          format: date-time
        type:
          type: string
          format: uri
        title:
          type: string
        detail:
          type: string
        instance:
          type: string
          format: uri
        problems:
          type: array
          items:
            $ref: '#/components/schemas/NestedProblem'
        properties:
          type: object
          additionalProperties:
            type: object
    NestedProblem:
      required:
      - detail
      - error
      - title
      type: object
      properties:
        error:
          type: string
        title:
          type: string
        detail:
          type: string
        type:
          type: string
          format: uri
    CountryGroupMembershipRequest:
      required:
      - startDate
      type: object
      properties:
        territoryId:
          type: string
          description: Territory ID that is a member of the group
          format: uuid
        startDate:
          type: string
          description: Start date of the membership
          format: date
        endDate:
          type: string
          description: End date of the membership
          format: date
        excluded:
          type: boolean
          description: Flag to indicate if the country is excluded from the group
          default: false
    ListCountryGroupMembershipResponse:
      type: object
      properties:
        memberships:
          type: array
          items:
            $ref: '#/components/schemas/CountryGroupMembership'
    CountryGroupMembershipPatchRequest:
      required:
      - startDate
      type: object
      properties:
        startDate:
          type: string
          description: Start date of the membership
          format: date
        endDate:
          type: string
          description: End date of the membership
          format: date
        excluded:
          type: boolean
          description: Flag to indicate if the country is excluded from the group
          default: false
    CountryGroup:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the country group
          format: uuid
        name:
          type: string
          description: Name of the country group
        type:
          type: string
          description: Type of the country group
          enum:
          - TRADE_BLOCK
          - REGION
    CountryGroupRequest:
      required:
      - name
      - type
      type: object
      properties:
        name:
          type: string
          description: Name of the country group
        type:
          type: string
          description: Type of the country group
    ListCountryGroupResponse:
      type: object
      properties:
        countryGroups:
          type: array
          items:
            $ref: '#/components/schemas/CountryGroup'
    Subdivision:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the territory
          format: uuid
        shortName:
          type: string
          description: Short name of the territory
        fullName:
          type: string
          description: Full name of the territory
        code:
          type: string
          description: Subdivision ISO code of the territory
        taxPrefix:
          type: string
          description: Tax prefix used in the territory
        taxRegex:
          type: string
          description: Regular expression for validating tax numbers in the territory
        isTest:
          type: boolean
          description: Flag to indicate if this is a test record
        subdivisions:
          type: array
          description: List of subdivisions of that territory
          items:
            $ref: '#/components/schemas/Subdivision'
        taxTypes:
          type: array
          description: Subdivision's tax types
          items:
            $ref: '#/components/schemas/TerritoryTaxType'
    TerritoryTaxType:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the territory tax type
          format: uuid
        taxType:
          type: string
          description: Type of the tax
          enum:
          - ITX
          - PPT
          - WHT
        contentStatus:
          type: string
          description: The type of content status
          enum:
          - ACTIVE
          - INACTIVE
          - TEST
        calculationMethod:
          type: string
          description: The calculation method of the tax type
          enum:
          - DEFAULT
          - GST_CANADA
          - GST_INDIA
    SubdivisionRequest:
      required:
      - code
      - shortName
      type: object
      properties:
        shortName:
          type: string
          description: Short name of the subdivision
        fullName:
          type: string
          description: Full name of the subdivision
        taxPrefix:
          type: string
          description: Tax prefix used in the subdivision
        taxRegex:
          type: string
          description: Regular expression for validating tax numbers in the subdivision
        isTest:
          type: boolean
          description: Flag to indicate if this is a test record
          default: false
        code:
          type: string
          description: Subdivision code
    ListSubdivisionResponse:
      type: object
      properties:
        subdivisions:
          type: array
          items:
            $ref: '#/components/schemas/Subdivision'
    ListTaxRateCategory:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the tax rate category
          format: uuid
        name:
          type: string
          description: Name of the tax rate category
        taxType:
          type: string
          description: The tax type of the tax rate category
          enum:
          - ITX
          - PPT
          - WHT
        isDefault:
          type: boolean
          description: Defines if the tax rate category is default or not
      description: The related tax rate category
    TaxRateCategoryRequest:
      required:
      - name
      - taxType
      type: object
      properties:
        name:
          type: string
          description: Name of the tax rate category
        taxType:
          type: string
          description: Tax type of the tax rate category
        isDefault:
          type: boolean
          description: Flag indicating if the tax rate category is default rate
    ListTaxRateCategoryResponse:
      type: object
      properties:
        taxRateCategories:
          type: array
          items:
            $ref: '#/components/schemas/ListTaxRateCategory'
    TaxRateCategoryPatchRequest:
      required:
      - name
      type: object
      properties:
        name:
          type: string
          description: Name of the tax rate category
        isDefault:
          type: boolean
          description: Flag indicating if the tax rate category is default rate
    TaxRate:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the tax rate
          format: uuid
        rate:
          type: number
          description: Tax rate numerical value
          format: double
        startDate:
          type: string
          description: Start date based on applicable tax rate date
          format: date
        endDate:
          type: string
          description: End date based on expiration of the tax rate by date
          format: date
        taxRateCategory:
          $ref: '#/components/schemas/ListTaxRateCategory'
    TaxRateRequest:
      required:
      - rate
      - startDate
      - taxRateCategoryId
      type: object
      properties:
        taxRateCategoryId:
          type: string
          description: Tax rate category UUID
          format: uuid
        rate:
          type: number
          description: Tax rate numerical value
          format: double
        startDate:
          type: string
          description: Start date based on applicable tax rate date
          format: date
        endDate:
          type: string
          description: End date based on expiration of the tax rate by date
          format: date
    ListTaxRateResponse:
      type: object
      properties:
        taxRates:
          type: array
          items:
            $ref: '#/components/schemas/TaxRate'
    Country:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the territory
          format: uuid
        shortName:
          type: string
          description: Short name of the territory
        fullName:
          type: string
          description: Full name of the territory
        alpha2:
          type: string
          description: Two-letter ISO code of the territory
        alpha3:
          type: string
          description: Three-letter ISO code of the territory
        numericCode:
          type: string
          description: Numeric ISO code of the territory
        isIndependent:
          type: boolean
          description: Flag to indicate country's independence status
          default: false
        taxPrefix:
          type: string
          description: Tax prefix used in the territory
        taxRegex:
          type: string
          description: Regular expression for validating tax numbers in the territory
        isTest:
          type: boolean
          description: Flag to indicate if this is a test record
        subdivisions:
          type: array
          description: Territory's subdivisions
          items:
            $ref: '#/components/schemas/Subdivision'
        taxTypes:
          type: array
          description: Territory's tax types
          items:
            $ref: '#/components/schemas/TerritoryTaxType'
    CountryRequest:
      required:
      - alpha2
      - alpha3
      - numericCode
      - shortName
      type: object
      properties:
        shortName:
          type: string
          description: Short name of the territory
        fullName:
          type: string
          description: Full name of the territory
        alpha2:
          type: string
          description: Two-letter ISO alpha code of the territory
        alpha3:
          type: string
          description: Three-letter ISO alpha code of the territory
        numericCode:
          type: string
          description: Numeric ISO code of the territory
        isIndependent:
          type: boolean
          description: Flag to indicate country's independence status
          default: false
        taxPrefix:
          type: string
          description: Tax prefix used in the territory
        taxRegex:
          type: string
          description: Regular expression for validating tax numbers in the territory
        isTest:
          type: boolean
          description: Flag to indicate if this is a test record
    ListCountryResponse:
      required:
      - currentPage
      - pageSize
      type: object
      properties:
        territories:
          type: array
          items:
            $ref: '#/components/schemas/Country'
        totalElements:
          type: integer
          description: Total number of items in the database that correspond to this
            search criteria
          format: int64
        currentPage:
          type: integer
          description: Current page
          format: int32
        pageSize:
          type: integer
          description: Response page size
          format: int32
    TerritoryTaxIdType:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the territory tax ID type
          format: uuid
        taxType:
          type: string
          description: Stores the the type of tax
          enum:
          - ITX
          - PPT
          - WHT
        taxIdType:
          type: string
          description: Stores the the type of tax id type
          enum:
          - PLACE_OF_ESTABLISHMENT
          - FIXED_ESTABLISHMENT
          - WITH_VAT_REP
          - WITHOUT_VAT_REP
          - IOSS
          - NEUOSS
    TerritoryTaxIdTypeRequest:
      required:
      - taxIdType
      - taxType
      type: object
      properties:
        taxType:
          type: string
          description: The type of tax applicable for the territory
        taxIdType:
          type: string
          description: The tax ID type for the territory
    ListTerritoryTaxIdTypeResponse:
      type: object
      properties:
        taxIdTypes:
          type: array
          items:
            $ref: '#/components/schemas/TerritoryTaxIdType'
    TerritoryTaxTypeRequest:
      required:
      - calculationMethod
      - taxType
      type: object
      properties:
        taxType:
          type: string
          description: The type of tax applicable for the territory
        calculationMethod:
          type: string
          description: The calculation method of the tax type for the territory
    ListTerritoryTaxTypeResponse:
      type: object
      properties:
        taxTypes:
          type: array
          items:
            $ref: '#/components/schemas/TerritoryTaxType'
    TerritoryTaxTypePatchRequest:
      required:
      - calculationMethod
      type: object
      properties:
        calculationMethod:
          type: string
          description: calculation method of the tax type
        contentStatus:
          type: string
          description: The content status of the tax type for the territory
    TerritoryTaxTypeValidation:
      type: object
      properties:
        isValid:
          type: boolean
          description: Does the territory have a valid mapping to the tax rate category?
          example: true
        message:
          type: string
          description: Reason for invalid territory tax type
    TerritoryTaxTypeValidationRequest:
      type: object
      properties:
        territoryId:
          type: string
          description: Territory UUID
          format: uuid
        taxRateCategoryId:
          type: string
          description: Tax rate category UUID
          format: uuid
  securitySchemes:
    country_store:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://docs.btx.banqup.com/docs/identity/auth/get-bearer-token
          scopes:
            country_read: Can read country store data
            country_write: Can write country store data
        authorizationCode:
          authorizationUrl: https://api.btx.fr.banqup.com/v1/oauth20/authorization
          tokenUrl: https://api.btx.fr.banqup.com/v1/oauth20/token_kc
          scopes:
            country_read: Can read country store data
            country_write: Can write country store data
