openapi: 3.0.4
info:
  title: Norce Checkout Configuration
  description: |-
    Build 2026-01-09 08:53:55

    Configuration API
  version: 1.0.0
servers:
  - url: https://checkout-configuration.test.norce.tech
    description: Test server
paths:
  /api/v1/configuration/merchants/{merchant}/channels/{channel}/configurations/{configuration_name}:
    put:
      tags:
        - Configuration
      summary: |-
        Set configuration.
        If the channel does not exist, it will be created.
      operationId: SetConfiguration
      parameters:
        - name: merchant
          in: path
          description: Merchant
          required: true
          schema:
            type: string
        - name: channel
          in: path
          description: Channel
          required: true
          schema:
            type: string
        - name: configuration_name
          in: path
          description: Name of service or adapter
          required: true
          schema:
            type: string
      requestBody:
        description: Configuration
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/Configuration'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Configuration'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Bearer: []
    get:
      tags:
        - Configuration
      summary: Get configuration
      operationId: GetConfiguration
      parameters:
        - name: merchant
          in: path
          description: Merchant
          required: true
          schema:
            type: string
        - name: channel
          in: path
          description: Channel
          required: true
          schema:
            type: string
        - name: configuration_name
          in: path
          description: Name of service or adapter
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Configuration'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Bearer: []
    delete:
      tags:
        - Configuration
      summary: >-
        Delete configuration.

        If this is the last configuration for a channel, the channel will be
        deleted.
      operationId: DeleteConfiguration
      parameters:
        - name: merchant
          in: path
          description: Merchant
          required: true
          schema:
            type: string
        - name: channel
          in: path
          description: Channel
          required: true
          schema:
            type: string
        - name: configuration_name
          in: path
          description: Name of service or adapter
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Bearer: []
  /api/v1/configuration/merchants/{merchant}/channels/{channel}/configurations:
    get:
      tags:
        - Configuration
      summary: Get configurations
      operationId: GetConfigurations
      parameters:
        - name: merchant
          in: path
          description: Merchant
          required: true
          schema:
            type: string
        - name: channel
          in: path
          description: Channel
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Configuration'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Bearer: []
    put:
      tags:
        - Configuration
      summary: >-
        Set configurations.

        If the channel does not exist, it will be created.
                    
        Unlike a proper restful PUT of a list, this will only set/replace the
        configurations provided

        in the list and leave any other configurations for this merchant and
        channel unmodified.
      operationId: SetConfigurations
      parameters:
        - name: merchant
          in: path
          description: Merchant
          required: true
          schema:
            type: string
        - name: channel
          in: path
          description: Channel
          required: true
          schema:
            type: string
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/Configuration'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Configuration'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Bearer: []
    delete:
      tags:
        - Configuration
      summary: |-
        This endpoint deletes all the configurations for a given channel.
        This will also delete the channel.
      operationId: DeleteConfigurations
      parameters:
        - name: merchant
          in: path
          description: Merchant
          required: true
          schema:
            type: string
        - name: channel
          in: path
          description: Channel
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Bearer: []
  /api/v1/configuration/merchants/{merchant}/channels:
    get:
      tags:
        - Configuration
      summary: Get channels
      operationId: GetChannels
      parameters:
        - name: merchant
          in: path
          description: Merchant
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - Bearer: []
components:
  schemas:
    Configuration:
      required:
        - $schema
        - id
      type: object
      properties:
        $schema:
          minLength: 1
          type: string
          description: The URL of the validating schema
          example: >-
            https://checkout-name-adapter.norce.tech/schemas/v1/configuration.json
        id:
          minLength: 1
          type: string
          description: The Id of the adapter the configuration is for
          example: checkout-name-adapter
      additionalProperties: {}
    Error:
      type: object
      properties:
        code:
          type: string
          nullable: true
        message:
          type: string
          nullable: true
        details:
          type: object
          additionalProperties:
            type: string
            nullable: true
          nullable: true
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: >-
        Authorization header using the bearer scheme. Example: 'Bearer
        a3bcdABCaB12abc3AbCDAB5AbcABCaBcABC5ab3c5A0='
      name: Authorization
      in: header
