swagger: '2.0'
info:
  version: '2.0'
  title: currency-formats
consumes:
  - application/json
produces:
  - application/json
paths:
  /currency-formats:
    get:
      tags:
        - currency-formats
      description: Get a collection of currency formats.
      operationId: getCurrencyFormats
      parameters:
        - name: storeEntityId
          in: query
          description: The StoreEntity this formatting rule is part of.
          required: false
          type: integer
          format: int32
        - name: currency
          in: query
          description: The currency. This is a currency code as per ISO 4217 standards.
          required: false
          type: string
        - name: roundingMultiple
          in: query
          description: 'Rounding multiple according to national law or practice. For example, specify 5 to round dollars to the nearest five cent piece. The default value is 1.'
          required: false
          type: integer
          format: int32
        - name: numberUsg
          in: query
          description: This currency formatting rule should be used when formatting monetary amounts for this usage.
          required: false
          type: integer
          format: int32
        - name: roundingMethod
          in: query
          description: 'How to round to a multiple of ROUNDINGMULTIPLE R = round normally - up or down - to the nearest multiple T = truncate - round down for positive amounts, round up for negative amounts.'
          required: false
          type: string
        - name: decimalPlaces
          in: query
          description: The number of decimal places in a rounded or truncated monetary amount.
          required: false
          type: integer
          format: int32
        - name: minimumApproveAmount
          in: query
          description: 'A small amount to be authorized when a backorder is initially submitted, to check that a successful authorization can be obtained. The full amount of the Order will not be authorized until sufficient inventory is allocated to release the backorder.'
          required: false
          type: number
        - 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 currency formats.
          schema:
            $ref: '#/definitions/CurrencyFormatCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    post:
      tags:
        - currency-formats
      description: Create a currency format.
      operationId: createCurrencyFormat
      parameters:
        - in: body
          name: CurrencyFormat
          description: Language-independent part of a currency formatting rule.
          required: true
          schema:
            $ref: '#/definitions/CurrencyFormat'
      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'
  '/currency-formats/storeEntityId:{storeEntityId},currency:{currency},numberUsg:{numberUsg}':
    get:
      tags:
        - currency-formats
      description: Get a currency format.
      operationId: getCurrencyFormatById
      parameters:
        - 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: Language-independent part of a currency formatting rule.
          schema:
            $ref: '#/definitions/CurrencyFormat'
        '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:
        - currency-formats
      description: Delete a currency format.
      operationId: deleteCurrencyFormatById
      parameters: []
      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:
        - currency-formats
      description: Update a currency format.
      operationId: updateCurrencyFormatById
      parameters:
        - in: body
          name: CurrencyFormat
          description: Language-independent part of a currency formatting rule.
          required: true
          schema:
            $ref: '#/definitions/CurrencyFormat'
      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: storeEntityId
        in: path
        description: The StoreEntity this formatting rule is part of.
        required: true
        type: integer
        format: int32
      - name: currency
        in: path
        description: The currency. This is a currency code as per ISO 4217 standards.
        required: true
        type: string
      - name: numberUsg
        in: path
        description: This currency formatting rule should be used when formatting monetary amounts for this usage.
        required: true
        type: integer
        format: int32
  '/currency-formats/storeEntityId:{storeEntityId},currency:{currency},numberUsg:{numberUsg}/descriptions':
    get:
      tags:
        - currency-formats
      description: ''
      operationId: getDescriptionsOfCurrencyFormat
      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 currency format descriptions.
          schema:
            $ref: '#/definitions/CurrencyFormatDescriptionCollection'
        '400':
          description: There was a client error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
        '500':
          description: There was a server error.
          schema:
            $ref: '#/definitions/ErrorResponseContainer'
    parameters:
      - name: storeEntityId
        in: path
        description: The StoreEntity this formatting rule is part of.
        required: true
        type: integer
        format: int32
      - name: currency
        in: path
        description: The currency. This is a currency code as per ISO 4217 standards.
        required: true
        type: string
      - name: numberUsg
        in: path
        description: This currency formatting rule should be used when formatting monetary amounts for this usage.
        required: true
        type: integer
        format: int32
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.
  CurrencyFormat:
    type: object
    properties:
      storeEntityId:
        type: integer
        format: int32
        description: The StoreEntity this formatting rule is part of.
      currency:
        type: string
        description: The currency. This is a currency code as per ISO 4217 standards.
      roundingMultiple:
        type: integer
        format: int32
        description: 'Rounding multiple according to national law or practice. For example, specify 5 to round dollars to the nearest five cent piece. The default value is 1.'
      numberUsg:
        type: integer
        format: int32
        description: This currency formatting rule should be used when formatting monetary amounts for this usage.
      roundingMethod:
        type: string
        description: 'How to round to a multiple of ROUNDINGMULTIPLE R = round normally - up or down - to the nearest multiple T = truncate - round down for positive amounts, round up for negative amounts.'
      decimalPlaces:
        type: integer
        format: int32
        description: The number of decimal places in a rounded or truncated monetary amount.
      minimumApproveAmount:
        type: number
        description: 'A small amount to be authorized when a backorder is initially submitted, to check that a successful authorization can be obtained. The full amount of the Order will not be authorized until sufficient inventory is allocated to release the backorder.'
      links:
        type: object
        description: Links to related resources.
        properties:
          descriptions:
            type: object
            description: ''
            properties:
              href:
                type: string
                description: The URL of the link.
    description: Language-independent part of a currency formatting rule.
  CurrencyFormatCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/CurrencyFormat'
    description: A collection of currency formats.
  CurrencyFormatDescription:
    type: object
    properties:
      languageId:
        type: integer
        format: int32
        description: 'The language. For a list of language components, see the LANGUAGE table.'
      currencySymbol:
        type: string
        description: The currency symbol.
      customizedCurrencyCode:
        type: string
        description: An alternate currency code. WebSphere Commerce does not use this value. You may supply a value and write your JSP macros to use it.
      currencyPrefixPositive:
        type: string
        description: The prefix to use when the monetary amount is positive. If this field and CURRENCYSUFFIXPOS are null then the positivePrefix of the NumberFormat will be used.
      currencyPrefixNegative:
        type: string
        description: The prefix to use when the monetary amount is negative. If this field and CURRENCYSUFFIXNEG are null then the negativePrefix of the NumberFormat will be used.
      currencySuffixPositive:
        type: string
        description: The suffix to use when the monetary amount is positive. If this field and CURRENCYPREFIXPOS are null then the positiveSuffix of the NumberFormat will be used.
      currencySuffixNegative:
        type: string
        description: The suffix to use when the monetary amount is negative. If this field and CURRENCYPREFIXNEG are null then the negativeSuffix of the NumberFormat will be used.
      displayLocale:
        type: string
        description: The Java locale used to create a currency NumberFormat object that is used to do the formatting. If this is NULL then the locale associated with the LANGUAGE_ID (see the LANGUAGE table) is used.
      radixPoint:
        type: string
        description: 'The radix point for the NumberFormat object. For example, when formatting dollars for the U.S. English Language, this would be the decimal point character. If this is null, then the decimal separator of the currency NumberFormat, associated with the DisplayLocale, will be used.'
      groupingCharacter:
        type: string
        description: 'The grouping character used by the NumberFormat object. For example, when formatting dollars for the U.S. English Language this would be the thousands separator. If this is null, then the grouping separator of the currency NumberFormat, associated with the DisplayLocale, will be used.'
      numberPattern:
        type: string
        description: The number pattern to be applied to the NumberFormat object. The number pattern is described in the JDK documentation for the class java.text.DecimalFormat. If this is NULL then the default number pattern of the NumberFormat object is used.
      description:
        type: string
        description: 'A description of the currency, suitable for display to customers in a currency selection list.'
      currencyFormat:
        type: object
        description: This currency formatting rule should be used when formatting monetary amounts for this usage.
    description: Language-dependent part of a currency formatting rule.
  CurrencyFormatDescriptionCollection:
    type: object
    properties:
      count:
        type: integer
        format: int64
        description: The total number of items.
      items:
        type: array
        description: The items.
        items:
          $ref: '#/definitions/CurrencyFormatDescription'
    description: A collection of currency format descriptions.
