swagger: '2.0'
info:
  version: '2.0'
  title: price-lists
consumes:
  - application/json
produces:
  - application/json
paths:
  /price-lists:
    get:
      tags:
        - price-lists
      description: Get a collection of price lists.
      operationId: getPriceLists
      parameters:
        - name: id
          in: query
          description: The unique generated ID of the price list item.
          required: false
          type: integer
          format: int64
        - name: organizationId
          in: query
          description: The owner organization of the price list.
          required: false
          type: integer
          format: int64
        - name: productSetId
          in: query
          description: The product set the specifies the list of products contained in the price list.
          required: false
          type: integer
          format: int32
        - name: description
          in: query
          description: 'A brief description of the  price list, suitable for display to an administrator managing a price list.'
          required: false
          type: string
        - name: identifier
          in: query
          description: 'A mnemonic name for the price list, unique for a particular owner.'
          required: false
          type: string
        - name: markForDelete
          in: query
          description: 'Indicates if this the price list is marked for deletion:\n0 = No.\n1 = Yes, the TradingPositionContainer has been marked for deletion and should not be used.'
          required: false
          type: integer
          format: int32
        - name: precedence
          in: query
          description: 'When more than one price lists are qualified at a particular time, the one with the highest precedence is used.'
          required: false
          type: number
          format: double
        - name: type
          in: query
          description: 'The Trading Position Container type:\nS = standard price list which contains the base prices for the products in the store catalog\nC = custom price list which specifies the list of products and their customized prices\nE = external price list imported from an external system. The external price list specifies the list of products and their customized prices.\nThe difference between external price list and custom price list is that the former allows the user interface to only pass any updates to the server, and does not need to send the entire price list definition.'
          required: false
          type: string
        - name: flags
          in: query
          description: 'This column contains the following bit flag indicating special processing to be performed by task commands that find prices for customers- \n1 = restricted. To use price lists in this price list container, the customer must be in one of the associated MemberGroups. The associated MemberGroups are recognized by the Store as customer groups (see MGPTRDPSCN and STOREMBRGP). Use the TermAndCondition and Participant objects to limit the use of TradingPositionContainers to certain customers.No other bit flags can be stored in this column. This column is deprecated and is provided for backward compatibility only.'
          required: false
          type: integer
          format: int32
        - name: workspace.name
          in: query
          description: The unique system-generated code for identifying the workspace. This identifier is not the name that is assigned to the workspace by the Workspace Manager.
          required: false
          type: string
        - name: workspace.taskGroup
          in: query
          description: The unique system-generated code for identifying the task group. This identifier is not the name that is assigned to the task group by the Workspace Manager.
          required: false
          type: string
        - name: workspace.task
          in: query
          description: The unique system-generated code for identifying the task. This identifier is not the name that is assigned to the task by the Workspace Manager.
          required: false
          type: string
        - name: offset
          in: query
          description: 'The position within the resulting dataset where the query begins returning item records. If the offset is "5", the records that returned begin with the sixth record that matches the query parameters. If the offset is "0", the records that are returned begin with the first record that matches the query parameters.'
          required: false
          type: integer
          format: int32
        - name: limit
          in: query
          description: The maximum number of records to return.
          required: false
          type: integer
          format: int32
        - name: fields
          in: query
          description: 'The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.'
          required: false
          type: string
        - name: expand
          in: query
          description: 'The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.'
          required: false
          type: string
        - name: sort
          in: query
          description: 'The comma-separated set of properties which controls the order of the items being listed, prefixed by either (-) to sort by descending order, or optionally (+) to sort by ascending order. For example, sort=name,-d which means, order the items based on the name value in ascending order, then by the id value in descending order.'
          required: false
          type: string
      responses:
        '200':
          description: A collection of price lists.
          schema:
            $ref: '#/definitions/PriceListCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    post:
      tags:
        - price-lists
      description: Create a price list.
      operationId: createPriceList
      parameters:
        - in: body
          name: PriceList
          description: 'The price list. An offer is part of a trading position container, which is owned by a member. A trading position container contains trading positions. The position container can be made available to all customers, or to only customers in certain groups. To make the container available to customers use the trading agreements or contracts, and the terms and conditions in the contracts. Under a contract, a trading position container is a price business object that can be referenced by multiple price business policies. The container, as a price business object, can be shared by a store or all stores in a store group. A trading position container is also referred to as a price list. In some business models, you can have multiple standard price lists, which could be based on either cost, or on list prices.'
          required: true
          schema:
            $ref: '#/definitions/PriceList'
        - name: workspace.name
          in: query
          description: The unique system-generated code for identifying the workspace. This identifier is not the name that is assigned to the workspace by the Workspace Manager.
          required: false
          type: string
        - name: workspace.taskGroup
          in: query
          description: The unique system-generated code for identifying the task group. This identifier is not the name that is assigned to the task group by the Workspace Manager.
          required: false
          type: string
        - name: workspace.task
          in: query
          description: The unique system-generated code for identifying the task. This identifier is not the name that is assigned to the task by the Workspace Manager.
          required: false
          type: string
      responses:
        '201':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
  '/price-lists/{id}':
    get:
      tags:
        - price-lists
      description: Get a price list.
      operationId: getPriceListById
      parameters:
        - name: workspace.name
          in: query
          description: The unique system-generated code for identifying the workspace. This identifier is not the name that is assigned to the workspace by the Workspace Manager.
          required: false
          type: string
        - name: workspace.taskGroup
          in: query
          description: The unique system-generated code for identifying the task group. This identifier is not the name that is assigned to the task group by the Workspace Manager.
          required: false
          type: string
        - name: workspace.task
          in: query
          description: The unique system-generated code for identifying the task. This identifier is not the name that is assigned to the task by the Workspace Manager.
          required: false
          type: string
        - name: fields
          in: query
          description: 'The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.'
          required: false
          type: string
        - name: expand
          in: query
          description: 'The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.'
          required: false
          type: string
        - name: sort
          in: query
          description: 'The comma-separated set of properties which controls the order of the items being listed, prefixed by either (-) to sort by descending order, or optionally (+) to sort by ascending order. For example, sort=name,-d which means, order the items based on the name value in ascending order, then by the id value in descending order.'
          required: false
          type: string
      responses:
        '200':
          description: 'The price list. An offer is part of a trading position container, which is owned by a member. A trading position container contains trading positions. The position container can be made available to all customers, or to only customers in certain groups. To make the container available to customers use the trading agreements or contracts, and the terms and conditions in the contracts. Under a contract, a trading position container is a price business object that can be referenced by multiple price business policies. The container, as a price business object, can be shared by a store or all stores in a store group. A trading position container is also referred to as a price list. In some business models, you can have multiple standard price lists, which could be based on either cost, or on list prices.'
          schema:
            $ref: '#/definitions/PriceList'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    delete:
      tags:
        - price-lists
      description: Delete a Price list.
      operationId: deletePriceListById
      parameters:
        - name: workspace.name
          in: query
          description: The unique system-generated code for identifying the workspace. This identifier is not the name that is assigned to the workspace by the Workspace Manager.
          required: false
          type: string
        - name: workspace.taskGroup
          in: query
          description: The unique system-generated code for identifying the task group. This identifier is not the name that is assigned to the task group by the Workspace Manager.
          required: false
          type: string
        - name: workspace.task
          in: query
          description: The unique system-generated code for identifying the task. This identifier is not the name that is assigned to the task by the Workspace Manager.
          required: false
          type: string
      responses:
        '204':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    patch:
      tags:
        - price-lists
      description: Update a price list.
      operationId: updatePriceListById
      parameters:
        - in: body
          name: PriceList
          description: 'The price list. An offer is part of a trading position container, which is owned by a member. A trading position container contains trading positions. The position container can be made available to all customers, or to only customers in certain groups. To make the container available to customers use the trading agreements or contracts, and the terms and conditions in the contracts. Under a contract, a trading position container is a price business object that can be referenced by multiple price business policies. The container, as a price business object, can be shared by a store or all stores in a store group. A trading position container is also referred to as a price list. In some business models, you can have multiple standard price lists, which could be based on either cost, or on list prices.'
          required: true
          schema:
            $ref: '#/definitions/PriceList'
        - name: workspace.name
          in: query
          description: The unique system-generated code for identifying the workspace. This identifier is not the name that is assigned to the workspace by the Workspace Manager.
          required: false
          type: string
        - name: workspace.taskGroup
          in: query
          description: The unique system-generated code for identifying the task group. This identifier is not the name that is assigned to the task group by the Workspace Manager.
          required: false
          type: string
        - name: workspace.task
          in: query
          description: The unique system-generated code for identifying the task. This identifier is not the name that is assigned to the task by the Workspace Manager.
          required: false
          type: string
      responses:
        '200':
          description: The operation was successful.
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '404':
          description: The resource was not found.
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    parameters:
      - name: id
        in: path
        description: The unique generated ID of the price list item.
        required: true
        type: integer
        format: int64
  '/price-lists/{id}/offers':
    get:
      tags:
        - price-lists
      description: ''
      operationId: getOffersOfPriceList
      parameters:
        - name: offset
          in: query
          description: 'The position within the resulting dataset where the query begins returning item records. If the offset is "5", the records that returned begin with the sixth record that matches the query parameters. If the offset is "0", the records that are returned begin with the first record that matches the query parameters.'
          required: false
          type: integer
          format: int32
        - name: limit
          in: query
          description: The maximum number of records to return.
          required: false
          type: integer
          format: int32
        - name: fields
          in: query
          description: 'The comma-separated set of properties to be returned. If no properties are specified, all properties are returned.'
          required: false
          type: string
        - name: expand
          in: query
          description: 'The comma-separated set of related resources referenced in the links to be returned. If no related resources are specified, no related resources are returned.'
          required: false
          type: string
        - name: sort
          in: query
          description: 'The comma-separated set of properties which controls the order of the items being listed, prefixed by either (-) to sort by descending order, or optionally (+) to sort by ascending order. For example, sort=name,-d which means, order the items based on the name value in ascending order, then by the id value in descending order.'
          required: false
          type: string
      responses:
        '200':
          description: A collection of offers.
          schema:
            $ref: '#/definitions/OfferCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    parameters:
      - name: id
        in: path
        description: The unique generated ID of the price list item.
        required: true
        type: integer
        format: int64
definitions:
  Link:
    type: object
    properties:
      href:
        type: string
        format: uri
        description: The URL of the link.
    description: Links to related resources.
  Error:
    type: object
    properties:
      code:
        type: string
        description: The error message code.
      message:
        type: string
        description: The error message.
      messageKey:
        type: string
        description: The error message key.
      messageArguments:
        type: array
        description: The arguments used to construct the error message.
        items:
          type: object
      correlationId:
        type: string
        description: The unique identifier for the request.
      locale:
        type: string
        description: The locale of the error message.
    description: The error message item model.
  ErrorResponseContainer:
    type: object
    properties:
      requestId:
        type: string
        description: The request identifier.
      errors:
        type: array
        description: The errors.
        items:
          $ref: '#/definitions/Error'
    description: The error message model.
  PriceList:
    type: object
    properties:
      id:
        type: integer
        format: int64
        description: The unique generated ID of the price list item.
      organizationId:
        type: integer
        format: int64
        description: The owner organization of the price list.
      productSetId:
        type: integer
        format: int32
        description: The product set the specifies the list of products contained in the price list.
      description:
        type: string
        description: 'A brief description of the  price list, suitable for display to an administrator managing a price list.'
      identifier:
        type: string
        description: 'A mnemonic name for the price list, unique for a particular owner.'
      markForDelete:
        type: integer
        format: int32
        description: 'Indicates if this the price list is marked for deletion:\n0 = No.\n1 = Yes, the TradingPositionContainer has been marked for deletion and should not be used.'
      precedence:
        type: number
        format: double
        description: 'When more than one price lists are qualified at a particular time, the one with the highest precedence is used.'
      type:
        type: string
        description: 'The Trading Position Container type:\nS = standard price list which contains the base prices for the products in the store catalog\nC = custom price list which specifies the list of products and their customized prices\nE = external price list imported from an external system. The external price list specifies the list of products and their customized prices.\nThe difference between external price list and custom price list is that the former allows the user interface to only pass any updates to the server, and does not need to send the entire price list definition.'
      flags:
        type: integer
        format: int32
        description: 'This column contains the following bit flag indicating special processing to be performed by task commands that find prices for customers- \n1 = restricted. To use price lists in this price list container, the customer must be in one of the associated MemberGroups. The associated MemberGroups are recognized by the Store as customer groups (see MGPTRDPSCN and STOREMBRGP). Use the TermAndCondition and Participant objects to limit the use of TradingPositionContainers to certain customers.No other bit flags can be stored in this column. This column is deprecated and is provided for backward compatibility only.'
      links:
        type: object
        description: Links to related resources.
        properties:
          offers:
            type: object
            description: ''
            properties:
              href:
                type: string
                description: The URL of the link.
    description: 'The price list. An offer is part of a trading position container, which is owned by a member. A trading position container contains trading positions. The position container can be made available to all customers, or to only customers in certain groups. To make the container available to customers use the trading agreements or contracts, and the terms and conditions in the contracts. Under a contract, a trading position container is a price business object that can be referenced by multiple price business policies. The container, as a price business object, can be shared by a store or all stores in a store group. A trading position container is also referred to as a price list. In some business models, you can have multiple standard price lists, which could be based on either cost, or on list prices.'
  PriceListCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/PriceList'
    description: A collection of price lists.
  Offer:
    type: object
    properties:
      id:
        type: integer
        format: int64
        description: The Offer ID.
      startDate:
        type: string
        format: date-time
        description: 'The start of the time range during which this Offer is effective. This is a valid ISO 8601 date 2018-05-29T11:00:00Z.'
      catalogEntryId:
        type: integer
        format: int64
        description: The catalog entry offered for sale. Please see the catalog entry data API for details.
      endDate:
        type: string
        format: date-time
        description: 'The end of the time range during which this Offer is effective. This is a valid ISO 8601 date 2018-05-29T11:00:00Z.'
      precedence:
        type: number
        format: double
        description: 'When more than one Offer is effective at a particular time, the one with the highest precedence is used.'
      published:
        type: integer
        format: int32
        description: 'Describes whether or not the offer has been published as follows: \n0 = not published (temporarily disabled).\n1 = published.\n2 = marked for deletion (and not published).'
      updatedDate:
        type: string
        format: date-time
        description: The last time this Offer was updated.
      minimumQuantity:
        type: number
        format: double
        description: The minimum quantity that can be purchased in a single Order under this Offer.
      maximumQuantity:
        type: number
        format: double
        description: The maximum quantity that can be purchased in a single Order under this Offer.
      field1:
        type: string
        description: A customizable field.
      field2:
        type: string
        description: A customizable field.
      flags:
        type: integer
        format: int32
        description: A field reserved for internal use only.
      identifier:
        type: integer
        format: int64
        description: A number that uniquely identifies this Offer along with its specified catalog entry and price list identifier.
      quantityUnit:
        type: string
        description: 'A unit of measure for minimumQuantity and maximumQuantity. If the value is NULL, then the minimumQuantity and maximumQuantity are multiplied by nominal quantity for a product, used for pricing and the unit of measure of the results.'
      priceListId:
        type: integer
        format: int64
        description: The trading position container or price list this Offer is part of.  Please see the trading position container data API for details.
      links:
        type: object
        description: Links to related resources.
        properties:
          prices:
            type: object
            description: ''
            properties:
              href:
                type: string
                description: The URL of the link.
          descriptions:
            type: object
            description: ''
            properties:
              href:
                type: string
                description: The URL of the link.
    description: The offer.
  OfferCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/Offer'
    description: A collection of offers.
