openapi: 3.0.1
info:
  title: Content API
  description: The Content API
  contact:
    name: Booknordics AS
    url: https://www.booknordics.com
  version: v0
servers:
  - url: /content
paths:
  /v0/Content:
    get:
      tags:
        - Content
      summary: Get product content
      parameters:
        - name: page
          in: query
          description: The pagination page from where to start fetching.
          schema:
            type: string
        - name: maxResults
          in: query
          description: The maximum number of results to return.
          schema:
            type: integer
            format: int32
            default: 100
        - name: dateoffset
          in: query
          description: Date offset for filtering.
          schema:
            type: integer
            format: int32
        - name: type
          in: query
          description: The type of the product. [Parent=0, Child=1]
          schema:
            $ref: '#/components/schemas/ProductType'
        - name: source
          in: query
          description: >-
            The source from where the product was obtained. [Activity=0,
            Accommodation=1, CarRental=2]
          schema:
            $ref: '#/components/schemas/ProductSource'
        - name: Cenium-Tenant-Id
          in: header
          description: Identifier which tenant we are working against.
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Gets product content
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ProductContentPaginated'
            application/json:
              schema:
                $ref: '#/components/schemas/ProductContentPaginated'
            text/json:
              schema:
                $ref: '#/components/schemas/ProductContentPaginated'
        '400':
          description: >-
            Page parameter should be empty or come from nextpage in the previous
            response.
  /v0/Content/check-updates:
    post:
      tags:
        - Content
      summary: Checks if products have updates from supplier
      parameters:
        - name: Cenium-Tenant-Id
          in: header
          description: Identifier which tenant we are working against.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: The request containing product IDs to check
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/CheckProductUpdatesRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/CheckProductUpdatesRequest'
          text/json:
            schema:
              $ref: '#/components/schemas/CheckProductUpdatesRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CheckProductUpdatesRequest'
      responses:
        '200':
          description: Successfully checked products for updates
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/CheckProductUpdatesResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/CheckProductUpdatesResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/CheckProductUpdatesResponse'
        '400':
          description: Invalid request
components:
  schemas:
    CheckProductUpdatesRequest:
      type: object
      properties:
        productIds:
          type: array
          items:
            type: string
            format: uuid
          description: The product IDs to check for updates
          nullable: true
      additionalProperties: false
      description: Request to check if products have updates from supplier
    CheckProductUpdatesResponse:
      type: object
      properties:
        products:
          type: array
          items:
            $ref: '#/components/schemas/ProductUpdateStatus'
          description: List of products with their update status
          nullable: true
      additionalProperties: false
      description: Response containing update status for multiple products
    ExportProduct:
      type: object
      properties:
        type:
          type: string
          description: Relates to product category
          nullable: true
        commerceFulfillmentSchemaId:
          type: string
          description: Commerce fulfillment schema associated with this product
          format: uuid
        commerceExternalId:
          type: string
          description: Commerce external product id associated with this product
          nullable: true
        created:
          type: string
          description: Timestamp for creation of this product content
          nullable: true
        updated:
          type: string
          description: Timestamp for last update of this product content
          nullable: true
        countryCode:
          type: string
          description: Product country code (ISO 3166-1 two-letter code)
          nullable: true
        propertyCode:
          type: string
          description: >-
            Fulfillment specific identifier for the property offering this
            product
          nullable: true
        productCode:
          type: string
          description: Fulfillment specific identifier for the product
          nullable: true
        latitude:
          type: number
          description: Latitude of the location of the product
          format: double
          nullable: true
        longitude:
          type: number
          description: Longitude of the location of the product
          format: double
          nullable: true
        duration:
          type: string
          description: Duration of the activity
          format: date-span
          nullable: true
        numberOfGuests:
          type: integer
          description: Number of guests
          format: int32
          nullable: true
        bedRooms:
          type: integer
          description: Number of bed rooms
          format: int32
          nullable: true
        bedRoomsAndToilets:
          type: integer
          description: Number of bed rooms and toilets
          format: int32
          nullable: true
        singleBeds:
          type: integer
          description: Number of single beds
          format: int32
          nullable: true
        doubleBeds:
          type: integer
          description: Number of double beds
          format: int32
          nullable: true
        squareMeters:
          type: number
          description: Number of square meters
          format: double
          nullable: true
        minPax:
          type: integer
          description: Minimum number of people allowed
          format: int32
          nullable: true
        maxPax:
          type: integer
          description: Maximum number of people allowed
          format: int32
          nullable: true
        supplier:
          $ref: '#/components/schemas/ProductSupplier'
        source:
          type: string
          description: Fulfillment system for the product
          nullable: true
        translations:
          type: array
          items:
            $ref: '#/components/schemas/ExportProductTranslation'
          description: Product information, one entry for each translation
          nullable: true
        productType:
          type: string
          description: Specify the product is Parent or Child. For Activities, it is Child
          nullable: true
        productSource:
          type: string
          description: >-
            This specify the main source, ie the Category the product belongs
            to. Eg: Activity,Accommodation
          nullable: true
        productId:
          type: string
          format: uuid
          nullable: true
      additionalProperties: false
      description: Product content, exported from the fulfillment system
    ExportProductFacility:
      type: object
      properties:
        name:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
        voucher:
          type: boolean
          nullable: true
        indFee:
          type: boolean
          nullable: true
        amount:
          type: string
          nullable: true
        mandatoryToShow:
          type: boolean
          nullable: true
        display:
          type: string
          nullable: true
        inherited:
          type: boolean
          nullable: true
      additionalProperties: false
    ExportProductImage:
      type: object
      properties:
        caption:
          type: string
          description: Caption
          nullable: true
        ordinal:
          type: string
          description: Ordinal
          nullable: true
        isMain:
          type: boolean
          description: Main cover image
        sizes:
          type: array
          items:
            $ref: '#/components/schemas/ExportProductImageSize'
          description: A set of image sizes related to the image
          nullable: true
      additionalProperties: false
      description: Image related to the product content translation
    ExportProductImageSize:
      type: object
      properties:
        url:
          type: string
          description: Url of the image
          nullable: true
        width:
          type: integer
          description: Width of the image
          format: int64
          nullable: true
        height:
          type: integer
          description: Height of the image
          format: int64
          nullable: true
      additionalProperties: false
      description: Image size related to the image
    ExportProductTranslation:
      type: object
      properties:
        language:
          type: string
          description: Two-letter ISO-639-1 language identifier for this translation
          nullable: true
        countryName:
          type: string
          description: Country name
          nullable: true
        location:
          type: string
          description: Location name
          nullable: true
        property:
          type: string
          description: Property name
          nullable: true
        provider:
          type: string
          description: The name of the provider of the product
          nullable: true
        name:
          type: string
          description: Name of the product
          nullable: true
        description:
          type: string
          description: Product description
          nullable: true
        overview:
          type: string
          description: An excerpt or summary description of the product
          nullable: true
        requirements:
          type: array
          items:
            type: string
          description: Requirements
          nullable: true
        attention:
          type: array
          items:
            type: string
          description: Attention
          nullable: true
        guideLanguages:
          type: array
          items:
            type: string
          description: The languages guide can speak
          nullable: true
        ageLimit:
          type: string
          description: Allowed age limit
          nullable: true
        meetingPoints:
          type: array
          items:
            type: string
          description: Meeting points for the activity
          nullable: true
        city:
          type: string
          description: City
          nullable: true
        directions:
          type: array
          items:
            type: string
          description: Directions
          nullable: true
        duration:
          type: number
          description: Duration
          format: double
          nullable: true
        availableFrom:
          type: string
          description: Product available from
          format: date-time
          nullable: true
        availableTo:
          type: string
          description: Product available to
          format: date-time
          nullable: true
        startTimes:
          type: array
          items:
            type: string
            format: date-span
          description: Starting times
          nullable: true
        roomName:
          type: string
          description: Accommodation room name
          nullable: true
        occupancy:
          type: string
          description: Occupancy
          nullable: true
        address:
          type: string
          description: Address of the property
          nullable: true
        whatIsIncluded:
          type: array
          items:
            type: string
          description: What is included
          nullable: true
        whatIsNotIncluded:
          type: array
          items:
            type: string
          description: What is not included
          nullable: true
        whatToBring:
          type: array
          items:
            type: string
          description: Things to bring
          nullable: true
        keyPickup:
          type: string
          description: Key pick up
          nullable: true
        numberOfStars:
          type: number
          description: Number of stars
          format: double
          nullable: true
        images:
          type: array
          items:
            $ref: '#/components/schemas/ExportProductImage'
          description: A set of images related to the product
          nullable: true
        accommodationType:
          type: string
          description: 'Accommodation Type : Hotel, Hostel etc'
          nullable: true
        facilities:
          type: array
          items:
            $ref: '#/components/schemas/ExportProductFacility'
          description: Hotel all Facilities
          nullable: true
        phone:
          type: string
          description: Phone number
          nullable: true
        isRecommended:
          type: boolean
          description: A set of cancellation policies related to the product
          nullable: true
        isBestSeller:
          type: boolean
          nullable: true
        isHotelPickup:
          type: boolean
          nullable: true
        meetingpointinfo:
          type: string
          nullable: true
        difficulty:
          type: string
          nullable: true
        region:
          type: string
          nullable: true
      additionalProperties: false
      description: Translation of related exported product content
    ProductContentPaginated:
      type: object
      properties:
        exportProducts:
          type: array
          items:
            $ref: '#/components/schemas/ExportProduct'
          description: A set of exported product contents
          nullable: true
        nextPage:
          type: string
          description: Next page
          nullable: true
      additionalProperties: false
      description: Paginated product content
    ProductSource:
      enum:
        - Activity
        - Accommodation
        - CarRental
        - Transport
      type: string
      description: Product Source
      format: ''
    ProductSupplier:
      type: object
      properties:
        id:
          type: string
          description: ID of the supplier
          nullable: true
        name:
          type: string
          description: Name of the supplier
          nullable: true
      additionalProperties: false
      description: Details about the supplier of the product.
    ProductType:
      enum:
        - Parent
        - Child
      type: string
      description: Product Type
      format: ''
    ProductUpdateStatus:
      type: object
      properties:
        productId:
          type: string
          description: The ID of the product
          format: uuid
        hasUpdates:
          type: boolean
          description: Indicates whether the product has updates from the supplier
      additionalProperties: false
      description: Result of product update check
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://auth.aks.nordicadventuregroup.com/connect/authorize
          scopes:
            content: Content API
            commerce: Commerce Swagger UI
