openapi: "3.0.0"


################################################################################
# General Information
# SYSTEM_10, 26, 28, 29: End Users Toolbox back-end
# SYSTEM_03, 06, 08, 09, 11, 12, 17, 19, 20, 21, 25: EcoAccount tool back-end
# SYSTEM_03, 04, 05, 08, 13, 14, 16, 17, 21: EcoShopping tool back-end
# NOTE: The URI endpoints below marked with:
# 'VALID USER SESSION/ACCESS TOKEN REQUIRED'
# require a valid logeed in session in order to respond. Accessing these
# endpoints without the user session authorization token in the HTTP request
# will result in a error response. The session parameters should be passed via
# HTTP headers as described in each path.
info:
  description: The ICT Platform Web Services for End User Application/Tools
  version: 1.0.2
  title: ICT Platform End User Module Web Service
  contact:
    name: Miltiadis Koutsokeras
    email: miltos.koutsokeras@iccs.gr
    url: https://www.iccs.gr/

# Deployed server endpoints
servers:
  - url: https://circ4life.iccs.gr/EndUserModule
    description: CIRC4Life ICT platform.
  - url: http://127.0.0.1:8082/
    description: Local debugging standalone server.
################################################################################


################################################################################
# Components
components:
  schemas:
    EcoAccountRegistrationForm:
      # No text field should be larger than 256  characters long
      description: EcoAccount user registration form
      type: object
      required:
        - username
        - password
        - email
        - firstname
        - lastname
      properties:
        # At least 8 characters of length, allowed only A-Z, a-z, 0-9
        username:
          description: Username
          type: string
        # At least 8 characters of length, not equal to username, allows any character
        password:
          type: string
        email:
          # Accepts only valid email addresses according to RFC822, RFC5322.
          # Extra conditions that need to be met for ICT Platform:
          # Local domains not allowed, e.g. user@localhost, user@localhost.localdomain, user@somehost.localdomain
          # IP addresses not allowed,  e.g. user@127.0.0.1, user@10.0.1.1, user@8.8.8.8, user@147.102.5.97, user@192.168.1.245
          # Number of characters in top level domain must not less than 2 or more than 6, e.g. username@yahoo.c, username@yahoo.corporate
          type: string
        firstname:
          # At least 2 and not more than 256 characters of length, allows any character
          # except numbers(0-9) and these (<>, {}, [], !, @, #, $, %, ^, &, *, +, \, |, /, ?, `, ~)
          type: string
        lastname:
          # At least 2 and not more than 256 characters of length, allows any character
          # except numbers(0-9) and these (<>, {}, [], !, @, #, $, %, ^, &, *, +, \, |, /, ?, `, ~)
          type: string
        birthday:
          # Must represent a Date of the past, at least 5 years old
          $ref: "CommonOpenAPI.yaml#/components/schemas/Date"
        address:
          # See CommonOpenAPI.yaml#/components/schemas/Address
          $ref: "CommonOpenAPI.yaml#/components/schemas/Address"
        telephone:
          # At least 4 characters of length, allowed only + as first character, 0-9
          type: string
        imageurl:
          # Valid HTTP, HTTPs URL
          # HTTP URL of an already publicly available image. If both this and
          # 'imageupload' are set, this takes priority to offload the ICT
          # platform from extraneous uploads.
          type: string
        imageupload:
          # Binary encoded image string in Base64 ASCII for uploading to the
          # server. If this is set and not 'imageurl', the server will try to
          # decode the Base64 string and save the data as an image. The URL that
          # will serve the image data is constructed automatically on upload. If
          # the decoding fails or size limit is exceeded then registration
          # completes with a default placeholder image.
          # File size limit: 256KiB, anything above will reject the registration
          # request.
          type: string
          format: base64
        url:
          # Valid HTTP, HTTPs URL
          type: string
        gender:
          type: string
        organization:
          # See CommonOpenAPI.yaml#/components/schemas/Organization
          $ref: "CommonOpenAPI.yaml#/components/schemas/Organization"
        recyclebinuserid:
          # If the registered user has already a a consumer ID in the
          # intelligent recycle bin system, it is possible to use it during
          # registration in order to map it with his EcoAccount
          $ref: "CommonOpenAPI.yaml#/components/schemas/RecycleBinUserID"
        locale:
          # ISO 639 alpha-2 language code for this locale
          # Supported values:
          # nl -> Dutch
          # fr -> French
          # fi -> Finnish
          # de -> German
          # pl -> Polish
          # es -> Spanish
          # sv -> Swedish
          # en -> English
          type: string
          default: "en"
          minLength: 2
          maxLength: 2

    EcoAccountForgotPasswordForm:
      description: EcoAccount user reset password form
      type: object
      required:
        - email
      properties:
        email:
          # Accepts only valid email addresses according to RFC822, RFC5322.
          # Extra conditions that need to be met for ICT Platform:
          # Local domains not allowed, e.g. user@localhost, user@localhost.localdomain, user@somehost.localdomain
          # IP addresses not allowed,  e.g. user@127.0.0.1, user@10.0.1.1, user@8.8.8.8, user@147.102.5.97, user@192.168.1.245
          # Number of characters in top level domain must not less than 2 or more than 6, e.g. username@yahoo.c, username@yahoo.corporate
          type: string

    EcoAccountResignationForm:
      description: EcoAccount user resignation form
      type: object
      required:
        - email
      properties:
        email:
          # Accepts only valid email addresses according to RFC822, RFC5322.
          # Extra conditions that need to be met for ICT Platform:
          # Local domains not allowed, e.g. user@localhost, user@localhost.localdomain, user@somehost.localdomain
          # IP addresses not allowed,  e.g. user@127.0.0.1, user@10.0.1.1, user@8.8.8.8, user@147.102.5.97, user@192.168.1.245
          # Number of characters in top level domain must not less than 2 or more than 6, e.g. username@yahoo.c, username@yahoo.corporate
          type: string

    EcoAccountUpdateForm:
      # No text field should be larger than 256  characters long
      # All fields are optional and only existing fields will be updated
      description: EcoAccount profile update form
      type: object
      properties:
        # At least 8 characters of length, not equal to username, allows any character
        password:
          type: string
        email:
          # Accepts only valid email addresses according to RFC822, RFC5322.
          # Extra conditions that need to be met for ICT Platform:
          # Local domains not allowed, e.g. user@localhost, user@localhost.localdomain, user@somehost.localdomain
          # IP addresses not allowed,  e.g. user@127.0.0.1, user@10.0.1.1, user@8.8.8.8, user@147.102.5.97, user@192.168.1.245
          # Number of characters in top level domain must not less than 2 or more than 6, e.g. username@yahoo.c, username@yahoo.corporate
          type: string
        firstname:
          # At least 2 and not more than 256 characters of length, allows any character
          # except numbers(0-9) and these (<>, {}, [], !, @, #, $, %, ^, &, *, +, \, |, /, ?, `, ~)
          type: string
        lastname:
          # At least 2 and not more than 256 characters of length, allows any character
          # except numbers(0-9) and these (<>, {}, [], !, @, #, $, %, ^, &, *, +, \, |, /, ?, `, ~)
          type: string
        birthday:
          # Must represent a Date of the past, at least 5 years old
          $ref: "CommonOpenAPI.yaml#/components/schemas/Date"
        address:
          # See CommonOpenAPI.yaml#/components/schemas/Address
          $ref: "CommonOpenAPI.yaml#/components/schemas/Address"
        telephone:
          # At least 4 characters of length, allowed only + as first character, 0-9
          type: string
        imageurl:
          # Valid HTTP, HTTPs URL
          # HTTP URL of an already publicly available image. If both this and
          # 'imageupload' are set, this takes priority to offload the ICT
          # platform from extraneous uploads.
          type: string
        imageupload:
          # Binary encoded image string in Base64 ASCII for uploading to the
          # server. If this is set and not 'imageurl', the server will try to
          # decode the Base64 string and save the data as an image. The URL that
          # will serve the image data is constructed automatically on upload. If
          # the decoding fails or size limit is exceeded then registration
          # completes with a default placeholder image.
          # File size limit: 256KiB, anything above will reject the registration
          # request.
          type: string
          format: base64
        url:
          # Valid HTTP, HTTPs URL
          type: string
        gender:
          type: string
        organization:
          # See CommonOpenAPI.yaml#/components/schemas/Organization
          $ref: "CommonOpenAPI.yaml#/components/schemas/Organization"
        recyclebinuserid:
          # If the registered user has already a a consumer ID in the
          # intelligent recycle bin system, it is possible to use it during
          # registration in order to map it with his EcoAccount
          $ref: "CommonOpenAPI.yaml#/components/schemas/RecycleBinUserID"
        locale:
          # ISO 639 alpha-2 language code for this locale
          # Supported values:
          # nl -> Dutch
          # fr -> French
          # fi -> Finnish
          # de -> German
          # pl -> Polish
          # es -> Spanish
          # sv -> Swedish
          # en -> English
          type: string
          default: "en"
          minLength: 2
          maxLength: 2

    EcoAccountLoginForm:
      description: EcoAccount user login form
      type: object
      required:
        - username
        - password
      properties:
        username:
          description: Username or email
          type: string
        password:
          type: string

    EcoAccountLogoutForm:
      description: ""
      type: object
      required:
       - refreshtoken
      properties:
        refreshtoken:
          $ref: "CommonOpenAPI.yaml#/components/schemas/RefreshToken"

    EcoBalance:
      description: Eco balance representation containing Eco-points, Eco-credits and other information.
      type: object
      required:
        - ecopoints
        - ecocredits
      properties:
        ecopoints:
          $ref: "CommonOpenAPI.yaml#/components/schemas/EcoPoints"
        ecocredits:
          $ref: "CommonOpenAPI.yaml#/components/schemas/EcoCredits"

    FeedbackScoreRating:
      description: Feedback score in 5 star rating scale (1=bad, 5=Good)
      type: integer
      minimum: 1
      maximum: 5

    FeedbackFreeText:
      description: Feedback free text comments
      type: string
      maxLength: 250

    SystemFeedbackForm:
      description: Feedback for ICT system form
      type: object
      required:
        - userscore
      properties:
        userscore:
          $ref: "#/components/schemas/FeedbackScoreRating"
        comment:
          $ref: "#/components/schemas/FeedbackFreeText"

    ProducersFeedbackForm:
      description: Feedback for product producers
      type: object
      required:
        - productgtin
        - userscore
      properties:
        productgtin:
          $ref: "CommonOpenAPI.yaml#/components/schemas/GTIN"
        userscore:
          $ref: "#/components/schemas/FeedbackScoreRating"
        comment:
          $ref: "#/components/schemas/FeedbackFreeText"

  requestBodies:
    EcoAccountRegistrationRequest:
      required: true
      description: EcoAccount user registration request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/EcoAccountRegistrationForm"

    EcoAccountResignationRequest:
      required: true
      description: EcoAccount user resignation request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/EcoAccountResignationForm"

    EcoAccountForgotPasswordRequest:
      required: true
      description: EcoAccount password reset email request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/EcoAccountForgotPasswordForm"

    EcoAccountUpdateRequest:
      required: true
      description: EcoAccount profile update request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/EcoAccountUpdateForm"

    EcoAccountLoginRequest:
      required: true
      description: EcoAccount user login request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/EcoAccountLoginForm"

    EcoAccountLogoutRequest:
      required: true
      description: EcoAccount user logout request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/EcoAccountLogoutForm"

    SystemFeedbackRequest:
      required: true
      description: Feedback for ICT system request
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/SystemFeedbackForm"

    # A single request for product producers feedback, can include multiple
    # forms, one per product.
    ProducersFeedbackRequest:
      required: true
      description: Feedback for a product's producer
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: "#/components/schemas/ProducersFeedbackForm"

  responses:
    EcoAccountLoginResponse:
      description: EcoAccount user login response containing the authorization token
      content:
        application/json:
          schema:
            description: The login response of a succesful authorization, including the Access Token
            type: object
            required:
              - accesstoken
              - refreshtoken
            properties:
              accesstoken:
                $ref: "CommonOpenAPI.yaml#/components/schemas/AccessToken"
              refreshtoken:
                $ref: "CommonOpenAPI.yaml#/components/schemas/RefreshToken"

    AnonymousConsumerIDResponse:
      description: EcoAccount user anonymous consumer ID
      content:
        application/json:
          schema:
            $ref: "CommonOpenAPI.yaml#/components/schemas/AnonymousConsumerID"

    AnonymousConsumerIDQRcodeResponse:
      description: EcoAccount user anonymous consumer ID as image QR code
      content:
        image/png:
          schema:
            type: string
            format: binary

    RecycleBinUserIDResponse:
      description: EcoAccount user recycle bin user ID
      content:
        application/json:
          schema:
            $ref: "CommonOpenAPI.yaml#/components/schemas/RecycleBinUserID"

    RecycleBinUserIDQRcodeResponse:
      description: EcoAccount user recycle bin user ID as image QR code
      content:
        image/png:
          schema:
            type: string
            format: binary

    EcoAccountHistoryResponse:
      description: EcoAccount user purchase and recycle history
      content:
        application/json:
          schema:
            type: object
            properties:
              purchased:
                type: array
                items:
                  $ref: "CommonOpenAPI.yaml#/components/schemas/Product"
              recycled:
                type: array
                items:
                  $ref: "CommonOpenAPI.yaml#/components/schemas/Product"

    # This Response includes also the user credentials in case the client wants
    # to use this information in a form.
    EcoAccountRecordResponse:
      description: EcoAccount user full record, all properties
      content:
        application/json:
          schema:
            type: string

    ProductInfoResponse:
      description: Product's general information record (JSON-LD)
      content:
        application/json:
          schema:
            type: string

    ProductManufacturerResponse:
      description: Product's manufacturer information (JSON-LD)
      content:
        application/json:
          schema:
            type: string

    # The returned JSON-LD from this response is an open discussion.
    ProductRecyclabilityResponse:
      description: Product's use/re-use/recycle information (JSON-LD)
      content:
        application/json:
          schema:
            type: string
################################################################################


################################################################################
# Resource path URI endpoints
paths:
  # Results can be returned in a specific language by using the Query parameter
  # 'locale' and set its value equal to the ISO 639 alpha-2 language code, e.g.
  # for Spanish: /purchase_history/12345678901?locale=es

  #-----------------------------------------------------------------------------
  # EcoAccount tool back-end
  # USER_G_02: EcoAccount user registration from client applications.
  # End-users applications should be able to register a new user EcoAccount by
  # supplying all required information via a UI form.
  # CAUTION: This endpoint is only accessible by the predefined user of
  # EndUserModuleWS service client, NOT by an EcoAccount or other REST service
  # client. In order to be able to register a new EcoAccount with this API
  # endpoint your are required to first get access tokens for User
  # 'EndUserModule' and ClientID 'EndUserModuleWS'.
  # VALID USER SESSION/ACCESS TOKEN NOT REQUIRED
  # VALID CLIENT APPLICATION SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/register:
    post:
      description: EcoAccount user registration from client applications.
      operationId: EcoAccountRegistrationPOST
      requestBody:
        $ref: "#/components/requestBodies/EcoAccountRegistrationRequest"
      responses:
        '200':
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultSuccess"
        # Any response that is not HTTP/200 OK is considered an error.
        '400':
          description: Malformed user registration form, client has sent a malformed registration form
          content:
            '*/*':
              schema:
                type: string
        '401':
          description: Authentication denied, client tried to access the endpoint with wrong credentials
          content:
            '*/*':
              schema:
                type: string
        '403':
          description: Authentication required, client tried to access the endpoint without authorization token
          content:
            '*/*':
              schema:
                type: string
        '409':
          description: Eco-account already exists, client has sent a new registration with an existing username or email
          content:
            '*/*':
              schema:
                type: string
        '500':
          description: Eco-account registration failed due to internal server error
          content:
            '*/*':
              schema:
                type: string
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # End-users applications should be able to allow Reset Password functionality.
  # CAUTION: This endpoint is only accessible by the predefined user of
  # EndUserModuleWS service client, NOT by an EcoAccount or other REST service
  # client. In order to be able to send a reset password request to an already
  # registered user with this API endpoint your are required to first get access
  # tokens for User 'EndUserModule' and ClientID 'EndUserModuleWS'.
  # VALID USER SESSION/ACCESS TOKEN NOT REQUIRED
  # VALID CLIENT APPLICATION SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/forgot_password:
    post:
      description: EcoAccount password reset email from client applications.
      operationId: EcoAccountForgotPasswordPOST
      requestBody:
        $ref: "#/components/requestBodies/EcoAccountForgotPasswordRequest"
      responses:
        '200':
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultSuccess"
        # Any response that is not HTTP/200 OK is considered an error.
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # End-users applications should be able to unregister a registered user.
  # CAUTION: This endpoint should be accessed by the logged in EcoAccount user
  # that we wish to resign from the system. A resignation causes a removal of
  # the account from the Access Control Manager and a removal of the EcoAccount
  # record from the database, including user historic data. This action CANNOT
  # be reverted. Be extra careful when you use this from your client application
  # and also make sure there is a CLEAR user dialog before performing a call, so
  # the user is absolutely sure the he wishes his EcoAccount destruction. You
  # have been warned.
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/resignation:
    post:
      description: EcoAccount removal endpoint
      operationId: EcoAccountResignationPOST
      requestBody:
        $ref: "#/components/requestBodies/EcoAccountResignationRequest"
      responses:
        '200':
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultSuccess"
        '400':
          description: Malformed user resignation form, details do not match logged in user profile
          content:
            '*/*':
              schema:
                type: string
        # Any response that is not HTTP/200 OK is considered an error.
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # Allow user to change EcoAccount profile details. This form has all fields as
  # optional and changes only the fields that are present. The logged in session
  # is the EcoAccount that is getting changed, so there is no need to identify
  # the user with the form, the identification is made from the logged in
  # session.
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/update:
    post:
      description: EcoAccount profile update endpoint
      operationId: EcoAccountUpdatePOST
      requestBody:
        $ref: "#/components/requestBodies/EcoAccountUpdateRequest"
      responses:
        '200':
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultSuccess"
        '400':
          description: Malformed user update form, client has sent a malformed update form
          content:
            '*/*':
              schema:
                type: string
        '401':
          description: Authentication denied, client tried to access the endpoint with wrong credentials
          content:
            '*/*':
              schema:
                type: string
        '403':
          description: Authentication required, client tried to access the endpoint without authorization token
          content:
            '*/*':
              schema:
                type: string
        '409':
          description: Updated email or Recycle Bin ID already belongs to other EcoAccount user
          content:
            '*/*':
              schema:
                type: string
         # Any response that is not HTTP/200 OK is considered an error.
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_G_02: User login from client applications.
  # End-users applications should be able to login in the ICT platform with a
  # pair of username/password credentials. As a response the application
  # receives a user session token that SHOULD be used to access the rest of the
  # ICT platform services for the lifetime of the user session (as long as the
  # logout or session expiration).
  # VALID USER SESSION/ACCESS TOKEN NOT REQUIRED
  /ecoaccount/login:
    post:
      description: EcoAccount user login from client applications.
      operationId: EcoAccountLoginPOST
      # No security, public endpoint
      security: []
      requestBody:
        $ref: "#/components/requestBodies/EcoAccountLoginRequest"
      responses:
        '200':
          $ref: "#/components/responses/EcoAccountLoginResponse"
        '401':
          description: Authentication denied, client tried to access the endpoint with wrong credentials
          content:
            '*/*':
              schema:
                type: string
        '409':
          description: User has registered successfully but the email verification process is not yet complete.
          content:
            '*/*':
              schema:
                type: string
        '500':
          description: Eco-account registration failed due to internal server error
          content:
            '*/*':
              schema:
                type: string
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/logout:
    post:
      description: EcoAccount user logout from client applications.
      operationId: EcoAccountLogoutPOST
      requestBody:
        $ref: "#/components/requestBodies/EcoAccountLogoutRequest"
      responses:
        '200':
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultSuccess"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_G_04: Get Anonymous Consumer ID as string or QR Code.
  # Use the current user session to get an anonymized code that uniquely
  # identifies the current user. This code can be used by applications with
  # QR code scanner for retrieving user related data without getting user's
  # full details.
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/anonymous_consumerid:
    get:
      description: EcoAccount user anonymous identification code.
      operationId: EcoAccountAnonymousConsumerIdGET
      # No input parameters, the user session is enough
      responses:
        '200':
          $ref: "#/components/responses/AnonymousConsumerIDResponse"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # Anonymous ID as QR code PNG image
  /ecoaccount/anonymous_consumerid/qrcode:
    get:
      description: EcoAccount user anonymous identification code as QR image.
      operationId: EcoAccountAnonymousConsumerQRCodeGET
      # No input parameters, the user session is enough
      responses:
        '200':
          $ref: "#/components/responses/AnonymousConsumerIDQRcodeResponse"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # Recycle Bin User ID as application/json
  /ecoaccount/recyclebinid:
    get:
      description: EcoAccount user recycle bin system identification code.
      operationId: EcoAccountRecycleBinUserIdGET
      # No input parameters, the user session is enough
      responses:
        '200':
          $ref: "#/components/responses/RecycleBinUserIDResponse"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # Recycle Bin User ID as QR Code PNG image
  /ecoaccount/recyclebinid/qrcode:
    get:
      description: EcoAccount user recycle bin system identification code as QR image.
      operationId: EcoAccountRecycleBinUserQRCodeGET
      # No input parameters, the user session is enough
      responses:
        '200':
          $ref: "#/components/responses/RecycleBinUserIDQRcodeResponse"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_U_04, USER_G_02: Statistics/Aggregation based on EcoBalance
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/ecobalance:
    get:
      description: EcoAccount user Eco balance details.
      operationId: EcoAccountEcoBalanceGET
      parameters:
        - in: query
          name: locale
          required: false
          schema:
            description: ISO 639 alpha-2 language code for this locale
            type: string
            default: "en"
            minLength: 2
            maxLength: 2
      responses:
        '200':
          description: EcoAccount user Eco balance and related statistics/aggregation.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/EcoBalance"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # Post CIRC4Life system feedback intended to system maintainers
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/feedback/system:
    post:
      description: Post user feedback for system maintainers from client applications.
      operationId: EcoAccountFeedbackSystemPOST
      requestBody:
        $ref: "#/components/requestBodies/SystemFeedbackRequest"
      responses:
        '200':
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultSuccess"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_U_03, USER_U_04, USER_G_03: Get purchase/recycle history
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/history:
    get:
      description: EcoAccount user purchase and recycle history.
      operationId: EcoAccountPurchaseRecycleHistoryGET
      parameters:
        - in: query
          name: locale
          required: false
          schema:
            description: ISO 639 alpha-2 language code for this locale
            type: string
            default: "en"
            minLength: 2
            maxLength: 2
      responses:
        '200':
          $ref: "#/components/responses/EcoAccountHistoryResponse"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_G_08: Get EcoAccount full record for display screen with all
  # information
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/user_record:
    get:
      description: EcoAccount user full record.
      operationId: EcoAccountUserRecordGET
      parameters:
        - in: query
          name: locale
          required: false
          schema:
            description: ISO 639 alpha-2 language code for this locale
            type: string
            default: "en"
            minLength: 2
            maxLength: 2
      responses:
        '200':
          $ref: "#/components/responses/EcoAccountRecordResponse"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_G_09: Post product feedback intended to producers
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoaccount/feedback/producers:
    post:
      description: Post user feedback for product producers from client applications.
      operationId: EcoAccountFeedbackProducersPOST
      requestBody:
        $ref: "#/components/requestBodies/ProducersFeedbackRequest"
      responses:
        '200':
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultSuccess"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"
  #-----------------------------------------------------------------------------

  #-----------------------------------------------------------------------------
  # EcoShopping tool back-end
  # USER_U_01, USER_U_03, USER_U_04, USER_G_12: Get Eco-points value for
  # specified Product GTIN
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoshopping/product/ecopoints/{productid}:
    get:
      description: Get Eco-points of a specific product from the Product Master Database.
      operationId: EcoShoppingEcoPointsGET
      parameters:
        - in: path
          name: productid
          required: true
          schema:
            $ref: "CommonOpenAPI.yaml#/components/schemas/ProductID"
      responses:
        '200':
          description: Eco-points value for the specified product.
          content:
            application/json:
              schema:
                $ref: "CommonOpenAPI.yaml#/components/schemas/EcoPoints"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_U_03, USER_U_04, USER_G_03, USER_G_08: Get purchase/recycle history and
  # provide incentive
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  # See /ecoaccount/history endpoint above. Incentives are an open discussion.

  # USER_U_03, USER_U_04, USER_U_05, USER_G_11: Get product general information
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoshopping/product/info/{productid}:
    get:
      description: Get information of a specific product from the Product Master Database.
      operationId: EcoShoppingProductGET
      parameters:
        - in: path
          name: productid
          required: true
          schema:
            $ref: "CommonOpenAPI.yaml#/components/schemas/ProductID"
        - in: query
          name: locale
          required: false
          schema:
            description: ISO 639 alpha-2 language code for this locale
            type: string
            default: "en"
            minLength: 2
            maxLength: 2
      responses:
        '200':
          $ref: "#/components/responses/ProductInfoResponse"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_U_03, USER_U_04, USER_U_06: Get product manufacturer Information
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoshopping/product/manufacturer/{productid}:
    get:
      description: Get information of a specific product's manufacturer from the Product Master Database.
      operationId: EcoShoppingProductManufacturerGET
      parameters:
        - in: path
          name: productid
          required: true
          schema:
            $ref: "CommonOpenAPI.yaml#/components/schemas/ProductID"
        - in: query
          name: locale
          required: false
          schema:
            description: ISO 639 alpha-2 language code for this locale
            type: string
            default: "en"
            minLength: 2
            maxLength: 2
      responses:
        '200':
          $ref: "#/components/responses/ProductManufacturerResponse"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_U_03, USER_U_04, USER_U_07, USER_G_15: Get product use/re-use/recycle
  # information
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  /ecoshopping/product/reusability/{productid}:
    get:
      description: Get information of a specific product's reusability/recyclability from the Product Master Database.
      operationId: EcoShoppingProductReusabilityGET
      parameters:
        - in: path
          name: productid
          required: true
          schema:
            $ref: "CommonOpenAPI.yaml#/components/schemas/ProductID"
        - in: query
          name: locale
          required: false
          schema:
            description: ISO 639 alpha-2 language code for this locale
            type: string
            default: "en"
            minLength: 2
            maxLength: 2
      responses:
        '200':
          $ref: "#/components/responses/ProductRecyclabilityResponse"
        default:
          $ref: "CommonOpenAPI.yaml#/components/responses/DefaultError"

  # USER_G_09: Post product feedback intended to producers
  # VALID USER SESSION/ACCESS TOKEN REQUIRED
  # See /ecoaccount/feedback/producers endpoint above.
  #-----------------------------------------------------------------------------
################################################################################
