openapi: 3.0.3
info:
  title: WisePorter Inbound Product Catalog API
  description: |
    ## Summary

    ### Release : NOT

    WisePorter Inbound Product Catalog API is one of Catalog API. 

    There are two typical integration's ways:

    1. where WisePorter **consumes** data - data is published by external
    systems

    2. where WisePorter **produces** data - data is consumed by external
    systems.

    And this API provides capabilities **how to get the your data from external
    systems/sources into WisePorter**.
  termsOfService: https://wiseporter.com/terms-of-use/
  contact:
    name: API Support
    email: support@wiseporter.com
    url: https://wiseporter.com/
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '0.1'
externalDocs:
  description: Find out more about spec
  url: >-
    https://wiseporterpim.atlassian.net/wiki/spaces/WDP/pages/3971743746/WisePorter+Inbound+API
servers:
  - url: /api/
paths:
  /items:
    put:
      summary: This endpoint allows you to update and/or create a one product.
      description: >-
        Service to create or update item basic data, attributes, relationships
        and category assignment. If no code of a item is provided, the PIM will
        generate one for you.Explanation of all parts are described in
        documentation of WisePorter Inboud API.
      operationId: createOrUpdateItem
      tags:
        - Items operations
      parameters:
        - in: header
          name: processId
          description: ID of process in which the operation is executed
          required: true
          schema:
            type: string
        - in: header
          name: correlationId
          required: true
          description: >-
            Used to track calls from the service consumer to the API. This
            parameter is free text, unique value (e.g. UUID), generated by the
            caller. It is the responsibility of the application to generate a
            unique value and pass it during each call to the API. Unique
            identifier (at least for specific application) serves for pairing
            asynchronous request/response messages.
          schema:
            type: string
        - in: header
          name: applicationId
          required: true
          description: ID of source system/application
          schema:
            type: string
        - in: header
          name: effectiveDate
          required: true
          description: Date/time when the data itself was created/modified or just changed.
          schema:
            type: date-time
        - in: header
          name: batchId
          required: false
          description: ID of batch in which operations are executed
          schema:
            type: string
        - in: query
          name: preserveState
          required: false
          default: false
          description: Indicates that the item must remain in the state it is in.
          schema:
            type: boolean
      responses:
        '202':
          $ref: '#/components/responses/ItemAsyncRequestReceived'
      requestBody:
        $ref: '#/components/requestBodies/CreateOrUpdateBody'
    delete:
      summary: This endpoint allows you to delete a given item.
      description: Service to delete a given item.
      operationId: deleteItem
      tags:
        - Items operations
      parameters:
        - in: header
          name: processId
          description: ID of process in which the operation is executed
          required: true
          schema:
            type: string
        - in: header
          name: correlationId
          required: true
          description: >-
            Used to track calls from the service consumer to the API. This
            parameter is free text, unique value (e.g. UUID), generated by the
            caller. It is the responsibility of the application to generate a
            unique value and pass it during each call to the API. Unique
            identifier (at least for specific application) serves for pairing
            asynchronous request/response messages.
          schema:
            type: string
        - in: header
          name: applicationId
          required: true
          description: ID of source system/application
          schema:
            type: string
        - in: header
          name: effectiveDate
          required: true
          description: Date/time when the data itself was created/modified or just changed.
          schema:
            type: date-time
        - in: header
          name: batchId
          required: false
          description: ID of batch in which operations are executed
          schema:
            type: string
      responses:
        '202':
          $ref: '#/components/responses/ItemAsyncRequestReceived'
      requestBody:
        $ref: '#/components/requestBodies/DeleteItemBody'
components:
  schemas:
    Alias:
      allOf:
        - $ref: '#/components/schemas/AliasIdentifier'
        - $ref: '#/components/schemas/ArrayElement'
    Category:
      allOf:
        - $ref: '#/components/schemas/ArrayElement'
        - type: object
          properties:
            identifier:
              type: object
              properties:
                code:
                  type: string
                  description: Category WIS code
                alias:
                  type: object
                  properties: {}
                  additionalProperties:
                    $ref: '#/components/schemas/AliasIdentifier'
                  description: Alias to clearly idenfity the category
                  examples:
                    - EAN:
                        value: 15546
          required:
            - identifier
    Attribute:
      type: object
      properties:
        value:
          type: array
          items:
            $ref: '#/components/schemas/AttributeValue'
          description: attribute values
        unit:
          type: string
          description: value unit
        mode:
          type: string
          enum:
            - additive
            - sync
          enumDesc: >-
            additive - appending value to multivalue attribute, sync - default
            sync - set given values to multivalue attribute and remove obsolete
            values
          default: sync
          description: How to process the attribute.
        valueDescriptor:
          type: string
          description: "meaning of value you are sending to Wiseporter (name, code, value of parameter etc.). This description is used to determinate mapping between your value and referenced WIS item. Put 'NAME' to say that value contains WIS item name of item to be referenced. Put ALIAS.ean to target referenced item by its ean alias.\r\nFor more information, see [How to save attribute value](https://wiseporterpim.atlassian.net/wiki/spaces/WDP/pages/3973021728/How+to...#Save-attribute-value)"
          examples:
            - ALIAS.ean
            - NAME
      required:
        - value
    AttributeValue:
      oneOf:
        - type: string
          description: String value of attribute
        - type: number
          description: Number value of attribute
        - $ref: '#/components/schemas/MultilangText'
    MultilangText:
      type: object
      properties: {}
      additionalProperties:
        type: string
      examples:
        - cs: string
          en: string
      description: Map of localized texts.
    ArrayElement:
      type: object
      properties:
        mode:
          type: string
          description: How to process the array element.
          enum:
            - additive
            - sync
          enumDesc: >-
            additive - add element to item sync - synchronize array elements
            with given data.
          default: sync
    AliasIdentifier:
      type: object
      properties:
        value:
          type: string
          description: alias code
        type:
          type: string
          description: multi-alias sub type differentiator
      required:
        - value
    ItemIdentifier:
      anyOf:
        - type: object
          properties:
            code:
              type: string
              description: item WIS code
        - type: object
          properties:
            version:
              type: string
              description: Business version or null to use default business version
        - type: object
          properties:
            aliases:
              type: object
              properties: {}
              additionalProperties:
                type: array
                items:
                  $ref: '#/components/schemas/AliasIdentifier'
              examples:
                - EAN:
                    - value: string
                  SUPPLIER_CODE:
                    - value: 1234
                      type: MANUFACTURER_1
              description: A list of alternative item codes used to find the targeted item.
          examples:
            - aliases:
                EAN:
                  - value: string
                SUPPLIER_CODE:
                  - value: 1234
                    type: MANUFACTURER_1
      description: >-
        See [How to identify
        item](https://wiseporterpim.atlassian.net/wiki/spaces/WDP/pages/3973021728/How+to...#Identify-Object)
        for more information
    Relationship:
      type: object
      properties:
        itemRole:
          type: string
          description: Role code in relationship of updating item
        roles:
          type: object
          properties: {}
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/RelationshipRole'
          examples:
            - PRODUCT:
                - identifier:
                    code: ITEM_CODE
              PRICE:
                - identifier:
                    code: ITEM_1_RETAIL_PRICE
                - identifier:
                    code: ITEM_1_FINAL_PRICE
          description: Other roles of relationship. Object field is the role code.
        attributes:
          type: object
          properties: {}
          additionalProperties:
            $ref: '#/components/schemas/Attribute'
          description: Attributes assigned to relationship.
        mode:
          type: string
          enum:
            - additive
            - sync
          enumDesc: >-
            additive - add element to item sync - synchronize array elements
            with given data
          default: sync
          description: Instructions for existing relationship update
      required:
        - itemRole
        - roles
        - attributes
    RelationshipRole:
      type: object
      properties:
        identifier:
          $ref: '#/components/schemas/Identifier'
      required:
        - identifier
    Identifier:
      anyOf:
        - type: object
          properties:
            code:
              type: string
              description: item WIS code
          required:
            - code
        - type: object
          properties: {}
          additionalProperties:
            $ref: '#/components/schemas/AliasIdentifier'
          examples:
            - EAN:
                value: 54984
          description: item alias
      description: >-
        See [How to identify
        item](https://wiseporterpim.atlassian.net/wiki/spaces/WDP/pages/3973021728/How+to...#Identify-Object)
        for more information
  securitySchemes: {}
  requestBodies:
    CreateOrUpdateBody:
      required: false
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              identifier:
                $ref: '#/components/schemas/ItemIdentifier'
                description: Object to identify item by code or aliases
              name:
                $ref: '#/components/schemas/MultilangText'
                description: Map of localized name texts
              state:
                type: string
                description: >-
                  Target item state. The default behavior in the case of an
                  unspecified state is to switch the item to editing and then
                  try to return it to its previous state. When a target state is
                  specified, after editing, it tries to switch the item to the
                  given state.
              description:
                $ref: '#/components/schemas/MultilangText'
                description: Map of localized description texts
              aliases:
                type: object
                properties: {}
                additionalProperties:
                  type: array
                  items:
                    $ref: '#/components/schemas/Alias'
                examples:
                  - EAN:
                      - value: string
                    SUPPLIER_CODE:
                      - value: 1234
                        type: MANUFACTURER_1
                description: Alternative item codes to be saved to item
              type:
                type: string
                description: >-
                  Item type of new entity. Mandatory only when creating new
                  entity.
              categories:
                type: array
                items:
                  $ref: '#/components/schemas/Category'
                description: Categories to assign item in
              attributes:
                type: object
                properties: {}
                additionalProperties:
                  $ref: '#/components/schemas/Attribute'
                examples:
                  - PARAM.manufacturer:ATTRIBUTE.manufacturer:
                      value:
                        - BEST_BRAND
                    PARAM.basicInfo:ATTRIBUTE.color:
                      value:
                        - red
                      valueDescriptor: NAME
                description: "Attributes to be set to item. Object field is the PATH to target changed attribute in item entity.\r\nFor more info, see [Target item data using WIS PATH](https://wiseporterpim.atlassian.net/wiki/spaces/WDP/pages/3969056784/Target+item+data+using+WIS+PATH)"
              relationships:
                type: object
                properties: {}
                additionalProperties:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relationship'
                examples:
                  - PRODUCT_PRICE:
                      - itemRole: PRODUCT
                        roles:
                          PRICE:
                            - identifier:
                                code: ITEM_1_RETAIL_PRICE
                            - identifier:
                                code: ITEM_1_FINAL_PRICE
                description: Item relationships
            required: []
          examples:
            Body structure example:
              value:
                identifier:
                  code: string
                  aliases:
                    EAN:
                      - value: string
                    SUPPLIER_CODE:
                      - value: 1234
                        type: MANUFACTURER_1
                name: &ref_0
                  cs: string
                  en: string
                state: ACTIVE
                description: *ref_0
                aliases:
                  EAN:
                    - value: string
                  SUPPLIER_CODE:
                    - value: 1234
                      type: MANUFACTURER_1
                type: string
                categories:
                  identifier:
                    code: string
                    alias:
                      EAN:
                        value: 15546
                attributes:
                  PARAM.manufacturer:ATTRIBUTE.manufacturer:
                    value:
                      - BEST_BRAND
                  PARAM.basicInfo:ATTRIBUTE.color:
                    value:
                      - red
                    valueDescriptor: NAME
                relationships:
                  PRODUCT_PRICE:
                    - itemRole: PRODUCT
                      roles:
                        PRICE:
                          - identifier:
                              code: ITEM_1_RETAIL_PRICE
                          - identifier:
                              code: ITEM_1_FINAL_PRICE
            Create item:
              value:
                identifier:
                  code: B2B_SUPPLIER
                name:
                  cs: Nejlepší telefon
                  en: The best phone
                aliases:
                  altCode:
                    value: B2B
                state: ACTIVE
                type: TYPE_PHONE
                attributes:
                  PARAM.address:ATTRIBUTE.street:
                    value: Na Příkopech
                  PARAM.address:ATTRIBUTE.number:
                    value: '111'
                  PARAM.address:ATTRIBUTE.zipCode:
                    value: '02'
                  PARAM.address:ATTRIBUTE.city:
                    value: Praha 1
                  PARAM.address:ATTRIBUTE.country:
                    value: CZ
                    valueDescriptor: ALIAS.externalSystemCodes
            Assign item to category:
              value:
                identifier:
                  aliases:
                    EAN:
                      - value: 551648544897
                categories:
                  - identifier:
                      alias:
                        altCode:
                          value: furniture
            Relationship assignment:
              value:
                identifier:
                  code: STOCK_B2B
                attributes:
                  PARAM.purchasePriceInformation:ATTRIBUTE.source:
                    value: EPP_1
                  PARAM.countryOfPurchase:ATTRIBUTE.Country:
                    value: CZ
                    valueDescriptor: ALIAS.externalSystemCodes
                  PARAM.stockSettingsPerPriceLevel:ELEMENT.stockSettingsPerPriceLevelMO_EP-CZ:ATTRIBUTE.priceLevel:
                    value: MO-CZ
                  PARAM.stockSettingsPerPriceLevel:ELEMENT.stockSettingsPerPriceLevelMO_EP-CZ:ATTRIBUTE.eligibleFlag:
                    value: true
                  PARAM.stockSettingsPerPriceLevel:ELEMENT.stockSettingsPerPriceLevelMO_EP-CZ:ATTRIBUTE.shippingCostsCurrency:
                    value: 50
                    unit: CZK
                  PARAM.stockSettingsPerPriceLevel:ELEMENT.stockSettingsPerPriceLevelMO_EP-CZ:ATTRIBUTE.administrationCostsCurrency:
                    value: 70
                    unit: CZK
                relationships:
                  RT_TIRE_VENDOR_EXTERNAL_STOCK:
                    itemRole: STOCK
                    roles:
                      VENDOR:
                        identifier:
                          code: B2B_SUPPLIER
    DeleteItemBody:
      required: false
      description: Request body to remove item.
      content:
        application/json:
          schema:
            type: object
            properties:
              identifier:
                $ref: '#/components/schemas/ItemIdentifier'
                description: Object to identify item by code or aliases
            required:
              - identifier
  responses:
    ItemSyncCreated:
      description: Successfully created item response.
      headers: {}
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                description: WIS code of updated entity.
            required:
              - code
    ItemSyncUpdated:
      headers: {}
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                description: WIS code of updated entity.
            required:
              - code
      description: Successfully updated item response.
    ItemAsyncRequestReceived:
      headers: {}
      content:
        application/json:
          schema:
            type: object
            properties:
              requestId:
                type: string
                description: ID of request to be processed.
            required:
              - requestId
      description: Successfully received request to process item.
tags:
  - name: Items operations
    description: ''
    externalDocs:
      description: ''
      url: ''
