openapi: 3.0.3
info:
  title: 'Kinger API'
  description: ''
  version: 1.0.0
servers:
  -
    url: 'https://verkoper.kinger.nl'
paths:
  /api/v1/products:
    get:
      summary: 'Get all products'
      description: 'Get a list of products.'
      parameters:
        -
          in: query
          name: api_token
          description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
          example: your-api-token
          required: true
          schema:
            type: string
            description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
            example: your-api-token
        -
          in: query
          name: status
          description: 'Product status: "PAUSED", "PUBLISHED" or "ALL".<aside class="notice">Default value is ALL.</aside>'
          example: PUBLISHED
          required: false
          schema:
            type: string
            description: 'Product status: "PAUSED", "PUBLISHED" or "ALL".<aside class="notice">Default value is ALL.</aside>'
            example: PUBLISHED
        -
          in: query
          name: page
          description: 'The requested page with a size of 20 items per page.'
          example: 1
          required: false
          schema:
            type: integer
            description: 'The requested page with a size of 20 items per page.'
            example: 1
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  \"current_page\": 1,\n  \"data\": [\n  {\n    \"id\": 5137,\n    \"name\": \"Eurom Convectorkachel 2000 Watt\",\n    \"description\": \"<p>De Eurom 2000 Watt is een elektrische convectorkachel die uitermate geschikt is als bijverwarming van ruimtes.</p>\",\n    \"ean\": \"5901234123457\",\n    \"brand\": {\n        \"name\": \"Eurom\"\n    },\n    \"visible\": true,\n    \"pricing\": {\n      \"unit_price\": 49.95,\n      \"shipping_fee_nl\": 0,\n      \"shipping_fee_be\": 7.49,\n      \"tax_level\": \"HIGH\"\n    },\n    \"stock\": {\n      \"amount\": 50,\n    },\n    \"fulfilment\": {\n       \"delivery_by\": \"retailer\",\n       \"delivery\": \"1-23\"\n    },\n    \"delivery_to\": {\n       \"netherlands\": true,\n       \"belgium\": true\n    },\n    \"images\": [\n     {\n         \"1\": \"https://cdn.kinger.nl/product_images/first-product-image.jpg\"\n     },\n     {\n         \"2\": \"https://cdn.kinger.nl/product_images/second-product-image.jpg\"\n     }\n  ]\n  },\n  {\n    \"id\": 5138,\n    \"name\": \"Eurom Convectorkachel 1500 Watt\",\n    \"description\": \"<p>De Eurom 1500 Watt is een elektrische convectorkachel die uitermate geschikt is als bijverwarming van ruimtes.</p>\",\n    \"ean\": \"5901234123458\",\n    \"brand\": {\n        \"name\": \"Eurom\"\n    },\n    \"visible\": true,\n    \"pricing\": {\n       \"unit_price\": 22.95,\n       \"shipping_fee_nl\": 5.95,\n       \"shipping_fee_be\": 7.49,\n       \"tax_level\": \"HIGH\"\n    },\n    \"stock\": {\n        \"amount\": 103,\n    },\n    \"fulfilment\": {\n       \"delivery_by\": \"retailer\",\n       \"delivery\": \"4-0\"\n    },\n    \"delivery_to\": {\n        \"netherlands\": true,\n        \"belgium\": true\n    },\n    \"images\": [\n     {\n         \"1\": \"https://cdn.kinger.nl/product_images/first-product-image.jpg\"\n     },\n     {\n         \"2\": \"https://cdn.kinger.nl/product_images/second-product-image.jpg\"\n     }\n  ]\n  }\n],\n  \"first_page_url\": \"https://verkoper.kinger.nl/api/v1/products?page=1\",\n  \"from\": 1,\n  \"last_page\": 1,\n  \"last_page_url\": \"https://verkoper.kinger.nl/api/v1/products?page=1\",\n  \"next_page_url\": \"https://verkoper.kinger.nl/api/v1/products?page=1\",\n  \"path\": \"https://verkoper.kinger.nl/api/v1/products\",\n  \"per_page\": 20,\n  \"prev_page_url\": null,\n  \"to\": 20,\n  \"total\": 2\n }\n}"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 'Internal server error, could not get any products.'
                properties:
                  error:
                    type: string
                    example: 'Internal server error, could not get any products.'
      tags:
        - Products
  '/api/v1/product/{id}':
    get:
      summary: 'Get product'
      description: 'Get a product by product id.'
      parameters:
        -
          in: query
          name: api_token
          description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
          example: your-api-token
          required: true
          schema:
            type: string
            description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
            example: your-api-token
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            text/plain:
              schema:
                type: string
                example: "{\n  {\n    \"id\": 5137,\n    \"name\": \"Eurom Convectorkachel 2000 Watt\",\n    \"description\": \"<p>De Eurom 2000 Watt is een elektrische convectorkachel die uitermate geschikt is als bijverwarming van ruimtes.</p>\",\n    \"ean\": \"5901234123457\",\n    \"brand\": {\n        \"name\": \"Eurom\"\n    },\n    \"visible\": true,\n    \"pricing\": {\n      \"unit_price\": 49.95,\n      \"shipping_fee_nl\": 0,\n      \"shipping_fee_be\": 7.49,\n      \"tax_level\": \"HIGH\"\n    },\n    \"stock\": {\n      \"amount\": 50,\n    },\n    \"fulfilment\": {\n       \"delivery_by\": \"retailer\",\n       \"delivery\": \"1-23\"\n    },\n    \"delivery_to\": {\n       \"netherlands\": true,\n       \"belgium\": true\n    },\n    \"images\": [\n     {\n         \"1\": \"https://cdn.kinger.nl/product_images/first-product-image.jpg\"\n     },\n     {\n         \"2\": \"https://cdn.kinger.nl/product_images/second-product-image.jpg\"\n     }\n  ]\n }"
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 'Internal server error, could not get product.'
                properties:
                  error:
                    type: string
                    example: 'Internal server error, could not get product.'
      tags:
        - Products
    parameters:
      -
        in: path
        name: id
        description: 'The id of the product.'
        example: 5137
        required: true
        schema:
          type: integer
  '/api/v1/product/{id}/stock':
    put:
      summary: 'Update stock'
      description: 'Update stock by product id.'
      parameters:
        -
          in: query
          name: api_token
          description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
          example: your-api-token
          required: true
          schema:
            type: string
            description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
            example: your-api-token
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  result: 'Stock for product with id: 5137 has been updated.  New stock is: 40.'
                properties:
                  result:
                    type: string
                    example: 'Stock for product with id: 5137 has been updated.  New stock is: 40.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 'Internal server error, stock could not be updated.'
                properties:
                  error:
                    type: string
                    example: 'Internal server error, stock could not be updated.'
      tags:
        - Products
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                stock:
                  type: integer
                  description: 'The amount of stock available for the product.'
                  example: 40
              required:
                - stock
    parameters:
      -
        in: path
        name: id
        description: 'The id of the product.'
        example: 5137
        required: true
        schema:
          type: integer
  '/api/v1/product/{id}/price':
    put:
      summary: 'Update price'
      description: 'Update product price by product id.'
      parameters:
        -
          in: query
          name: api_token
          description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
          example: your-api-token
          required: true
          schema:
            type: string
            description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
            example: your-api-token
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  result: 'Price for 5137 has been updated. New price is: 59.99.'
                properties:
                  result:
                    type: string
                    example: 'Price for 5137 has been updated. New price is: 59.99.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 'Internal server error, price could not be updated.'
                properties:
                  error:
                    type: string
                    example: 'Internal server error, price could not be updated.'
      tags:
        - Products
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                price:
                  type: number
                  description: 'The new price for the specified product.'
                  example: 59.99
              required:
                - price
    parameters:
      -
        in: path
        name: id
        description: 'The id of the product.'
        example: 5137
        required: true
        schema:
          type: integer
  '/api/v1/product/{id}/delete':
    delete:
      summary: 'Delete product'
      description: "Delete product by product id.\n<aside class=\"warning\">The product will be <b>permanently</b> deleted.</aside>"
      parameters:
        -
          in: query
          name: api_token
          description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
          example: your-api-token
          required: true
          schema:
            type: string
            description: 'The api token should be added at the end of the url with ?api_token=your-api-token.'
            example: your-api-token
        -
          in: header
          name: Content-Type
          description: ''
          example: application/json
          schema:
            type: string
        -
          in: header
          name: Accept
          description: ''
          example: application/json
          schema:
            type: string
      responses:
        200:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  result: 'Product with id: 5137 has been deleted.'
                properties:
                  result:
                    type: string
                    example: 'Product with id: 5137 has been deleted.'
        404:
          description: ''
          content:
            application/json:
              schema:
                type: object
                example:
                  error: 'Internal server error, product could not be deleted.'
                properties:
                  error:
                    type: string
                    example: 'Internal server error, product could not be deleted.'
      tags:
        - Products
    parameters:
      -
        in: path
        name: id
        description: 'The id of the product.'
        example: 5137
        required: true
        schema:
          type: integer
tags:
  -
    name: Products
    description: "\nAPIs for managing products."
components:
  securitySchemes:
    default:
      type: apiKey
      name: api_token
      in: query
      description: ''
security:
  -
    default: []
