openapi: 3.0.1
info:
  title: Country Store Service API
  description: Authentication is performed via OAuth2. Scopes are not used. GET requests
    are available to any valid token.
  version: '1.0'
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:
      - Country group memberships
      summary: Get country group memberships
      description: '<br/> This Endpoint is part of: tax_countries'
      operationId: getAllCountryGroupMemberships
      parameters:
      - name: countryGroupId
        in: path
        description: The country group UUID identifier
        required: true
        schema:
          type: string
          format: uuid
      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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
  /v1/countryGroups:
    get:
      tags:
      - Country groups
      summary: Get country groups
      description: '<br/> This Endpoint is part of: tax_countries'
      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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
  /v1/countryGroups/{countryGroupId}:
    get:
      tags:
      - Country groups
      summary: Get country group by uuid
      description: '<br/> This Endpoint is part of: tax_countries'
      operationId: getCountryGroup
      parameters:
      - name: countryGroupId
        in: path
        description: The country group UUID 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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
  /v1/territories/{territoryId}/subdivisions:
    get:
      tags:
      - Subdivisions
      summary: Get a list of all subdivisions of a territory
      description: '<br/> This Endpoint is part of: tax_countries'
      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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
  /v1/territories/{territoryId}/subdivisions/{subdivisionId}:
    get:
      tags:
      - Subdivisions
      summary: Get subdivision by uuid
      description: '<br/> This Endpoint is part of: tax_countries'
      operationId: getSubdivision
      parameters:
      - name: territoryId
        in: path
        description: The 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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
  /v1/taxRateCategories:
    get:
      tags:
      - Tax rate categories
      summary: Get tax rate categories
      description: '<br/> This Endpoint is part of: tax_countries'
      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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
  /v1/territories/{territoryId}/taxTypes/{taxTypeId}/taxRates:
    get:
      tags:
      - Tax rates
      summary: Get all tax rates for a specified tax rate category
      description: '<br/> This Endpoint is part of: tax_countries'
      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 ID type 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'
      security:
      - oauth2: []
  /v1/territories/{territoryCode}/taxType/{taxType}/taxRates:
    get:
      tags:
      - Tax rates
      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'
      security:
      - oauth2: []
      description: '<br/> This Endpoint is part of: tax_countries'
  /v1/territories:
    get:
      tags:
      - Territories
      summary: Get all territories and subdivisions
      description: '<br/> This Endpoint is part of: tax_countries'
      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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
  /v1/territories/{territoryId}:
    get:
      tags:
      - Territories
      summary: Get territory
      description: '<br/> This Endpoint is part of: tax_countries'
      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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
  /v1/validateTerritory/{territoryId}:
    get:
      tags:
      - Territories
      summary: Validates territory by uuid
      description: '<br/> This Endpoint is part of: tax_countries'
      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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
  /v1/territories/{territoryId}/taxIdTypes:
    get:
      tags:
      - Territory tax id types
      summary: Get tax ID types
      description: '<br/> This Endpoint is part of: tax_countries'
      operationId: getAllTaxIdTypes
      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/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'
      security:
      - oauth2: []
  /v1/territories/{territoryId}/taxTypes:
    get:
      tags:
      - Territory tax types
      summary: Get tax types
      description: '<br/> This Endpoint is part of: tax_countries'
      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
                  taxName: Default
                - id: 00000001-0000-0000-0000-000000000000
                  contentStatus: INACTIVE
                  taxType: ITX
                  calculationMethod: DEFAULT
                  taxName: 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:50Z
                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:50Z
                type: about:blank
                title: Not Found
                detail: The HTTP method was not allowed on this endpoint.
      security:
      - oauth2: []
components:
  schemas:
    JsonBMap:
      type: object
      additionalProperties:
        oneOf:
        - type: string
        - type: integer
        - type: array
          items:
            type: string
    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:
      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:
      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:
      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'
    DatabaseExport:
      type: object
      properties:
        success:
          type: boolean
          description: Indicates if the operation was successful
        message:
          type: string
          description: Result message
    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
        taxName:
          type: string
          description: The tax name of the tax type
    SubdivisionRequest:
      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:
      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:
      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:
      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:
      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:
      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:
      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
        taxName:
          type: string
          description: The tax name of the tax type
        contentStatus:
          type: string
          description: The content status of the tax type for the territory
    ListTerritoryTaxTypeResponse:
      type: object
      properties:
        taxTypes:
          type: array
          items:
            $ref: '#/components/schemas/TerritoryTaxType'
    TerritoryTaxTypePatchRequest:
      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
        taxName:
          type: string
          description: The tax name of the tax type
    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:
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://api.btx.fr.banqup.com/oauth2/client_credential/gettoken
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
        authorizationCode:
          authorizationUrl: https://api.btx.fr.banqup.com/oauth2/auth
          tokenUrl: https://api.btx.fr.banqup.com/oauth2/token
          scopes:
            info: Scopes are endpoint-specific, see each endpoint for required scope.
