Application Load

IPromoDefinition

The physical TypeScript declaration from the Nuxt starter, with linked types and field comments.

IPromoDefinition

Customer-facing promotion definition.

interfaces/orionplace/cart/ICartData.ts
TypeScript
export interface IPromoDefinition {
  // Promotion-type ID.
  id: number;
  // Translated promotion names.
  locale: Record<string, {
    // Optional value of name; it may be omitted.
    name?: string;
  }>;
  // For EPromoType.FIXED: amounts by currency ID, with the number in
  // transform_value. For EPromoType.PERCENTAGE: the remaining-price multiplier;
  // 0.8 means pay 80%, a 20% discount. For EPromoType.FREE_SHIPPING: display
  // free shipping instead of a monetary discount.
  promo_value: number | ICurrencyAmounts;
  // Promotion calculation type.
  promo_type: EPromoType;
  // Products explicitly linked to the promotion, when present.
  products?: IProduct[];
  // Categories linked to the promotion, when present.
  categories?: ICategoryDirectoryEntry[];
  // Sellers linked to the promotion, when present.
  sellers?: ISellerDirectoryEntry[];
  /**
   * Minimum order amount: the products the code covers must cost at least
   * this much together in one order (the whole cart when the promotion names
   * no products, categories or sellers). Present only when the promotion has
   * a minimum.
   */
  minimum_order_amount?: ICurrencyAmounts;
  /**
   * @deprecated Alias of `minimum_order_amount` with the same value; read it
   * only when `minimum_order_amount` is absent (older backends).
   */
  min_price?: ICurrencyAmounts;
  /**
   * Largest discount a percentage code gives on one order. Present only when
   * the promotion has a maximum discount.
   */
  maximum_discount?: ICurrencyAmounts;
  /** The code works only on the customer's first purchase in the store. */
  first_order_only?: boolean;
  // Rule for combining with product discounts and its translated label.
  behaviour_with_product_discount: {
    // Value of int.
    int: EPromoProductDiscount;
    // Value of text.
    text: string;
  };
  // Formatted promotion start date.
  date_start: IApiDateTime | null;
  // Formatted promotion finish date.
  date_finish: IApiDateTime | null;
  // Whether the promotion type is active. This is not proof that a particular
  // code can be applied.
  promo_type_is_active: boolean;
}