Class: module:models/PriceAdjustment

module:models/PriceAdjustment()

new module:models/PriceAdjustment()

Constructs a new PriceAdjustment. Document representing a price adjustment within a basket or order. Price adjustments can be assigned at the order, product, or shipping level. They can be created by the promotion engine (if the custom flag is set to false) or can be added by custom logic (if the custom flag is set to true). For custom price adjustments created by a user, the manual flag should be set to true; this is always the case for price adjustments created using OCAPI.

Source:

Members

(readonly) ReasonCodeEnum :String

Allowed values for the reason_code property.

Type:
  • String
Source:

(inner) applied_discount :module:models/Discount

A price adjustment that provides details of the discount that was applied. This is null for custom price adjustments created without discount details.

Type:
Source:

(inner, constant) BACKORDER

value: "BACKORDER"

Source:

(inner) coupon_code :String

The coupon code that triggered the promotion, provided the price adjustment was created as the result of a promotion being triggered by a coupon.

Type:
  • String
Source:

(inner) created_by :String

The user who created the price adjustment.

Type:
  • String
Source:

(inner) creation_date :Date

Returns the value of attribute 'creationDate'.

Type:
  • Date
Source:

(inner) custom :Boolean

A flag indicating whether this price adjustment was created by custom logic. This flag is set to true unless the price adjustment was created by the promotion engine.

Type:
  • Boolean
Source:

(inner, constant) EVEN_EXCHANGE

value: "EVEN_EXCHANGE"

Source:

(inner) item_text :String

The text describing the item in more detail.

Type:
  • String
Source:

(inner) last_modified :Date

Returns the value of attribute 'lastModified'.

Type:
  • Date
Source:

(inner) manual :Boolean

A flag indicating whether this price adjustment was created in a manual process. For custom price adjustments created using the shop API, this always returns true. Using the scripting API, however, it is possible to set this to true or false, according to the use case.

Type:
  • Boolean
Source:

(inner) price :Number

The adjustment price.

Type:
  • Number
Source:

(inner) price_adjustment_id :String

The price adjustment id (uuid).

Type:
  • String
Source:

(inner, constant) PRICE_MATCH

value: "PRICE_MATCH"

Source:

(inner) promotion_id :String

The id of the related promotion. Custom price adjustments can be assigned any promotion id so long it is not used by a price adjustment belonging to the same item and is not used by promotion defined in the promotion engine. If not specified, a promotion id is generated.

Type:
  • String
Source:

The URL addressing the related promotion.

Type:
  • String
Source:

(inner) reason_code :module:models/PriceAdjustment.ReasonCodeEnum

The reason why this price adjustment was made.

Type:
  • module:models/PriceAdjustment.ReasonCodeEnum
Source:

Methods

(static) constructFromObject(data, obj) → {module:models/PriceAdjustment}

Constructs a PriceAdjustment from a plain JavaScript object, optionally creating a new instance. Copies all relevant properties from data to obj if supplied or a new instance if not.

Parameters:
Name Type Description
data Object

The plain JavaScript object bearing properties of interest.

obj module:models/PriceAdjustment

Optional instance to populate.

Source:
Returns:

The populated PriceAdjustment instance.

Type
module:models/PriceAdjustment