> ## Documentation Index
> Fetch the complete documentation index at: https://voucherify-mk-free-shipping.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Validation Rule Object

<div class="prose dark:prose-invert custom-html">
  <h2 id="validation-rule">Validation Rule</h2>
  <p>All of:</p>

  <ol>
    <li>
      <a href="#validation-rule-base">Validation Rule Base</a>
    </li>

    <li>
      <h3>Validation Rule</h3>

      <table>
        <thead>
          <tr>
            <th>Attributes</th>
            <th>Description</th>
          </tr>
        </thead>

        <tbody>
          <tr>
            <td>
              <p>
                id

                <br />

                <code>string</code>
              </p>
            </td>

            <td>
              <p>Unique validation rule ID.</p>

              <p>
                <strong>Example:</strong>
                val\_eR1c41hu0vUU
              </p>
            </td>
          </tr>

          <tr>
            <td>
              <p>
                created\_at

                <br />

                <code>string</code>
              </p>
            </td>

            <td>
              <p>Timestamp representing the date and time when the validation rule was created. The value is shown in the ISO 8601 format.</p>

              <p>
                <strong>Example:</strong>
                2022-03-23T07:44:00.444Z
              </p>
            </td>
          </tr>

          <tr>
            <td>
              <p>
                updated\_at

                <br />

                <code>string</code>
              </p>
            </td>

            <td>
              <p>Timestamp representing the date and time when the validation rule was updated. The value is shown in the ISO 8601 format.</p>

              <p>
                <strong>Example:</strong>
                2022-04-26T08:35:54.960Z
              </p>
            </td>
          </tr>

          <tr>
            <td>
              <p>
                assignments\_count

                <br />

                <code>integer</code>
              </p>
            </td>

            <td>
              <p>The number of instances the validation rule has been assigned to different types of redeemables.</p>
            </td>
          </tr>

          <tr>
            <td>
              <p>
                object

                <br />

                <code>string</code>
              </p>
            </td>

            <td>
              <p>The type of the object represented by JSON. This object stores information about the validation rule.</p>
            </td>
          </tr>
        </tbody>
      </table>
    </li>
  </ol>

  <h2 id="validation-rule-base">Validation Rule Base</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>
            name

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Custom, unique name for set of validation rules.</p>

          <p>
            <strong>Example:</strong>
            Business Validation Rule
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>rules</p>
        </td>

        <td>
          See:
          <a href="#validation-rule-rules">Validation Rule Rules</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>bundle\_rules</p>
        </td>

        <td>
          See:
          <a href="#validation-rule-bundle-rules">Validation Rule Bundle Rules</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            error

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>Contains the error message returned from API when validation / redemption fails to meet requirements of defined rules.</p>

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    message

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>The error message returned from API when validation / redemption fails to meet requirements of defined rules.</p>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            applicable\_to

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    excluded

                    <br />

                    <code>array</code>
                  </p>
                </td>

                <td>
                  <p>Defines which items are excluded from a discount.</p>
                  Array of
                  <a href="#applicable-to">Applicable To</a>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    included

                    <br />

                    <code>array</code>
                  </p>
                </td>

                <td>
                  <p>Defines which items are included in a discount.</p>
                  Array of
                  <a href="#applicable-to">Applicable To</a>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    included\_all

                    <br />

                    <code>boolean</code>
                  </p>
                </td>

                <td>
                  <p>Indicates whether all items are included in the discount.</p>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            type

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Type of validation rule.</p>

          <p>
            Available values:
            <code>expression</code>,
            <code>basic</code>,
            <code>advanced</code>,
            <code>complex</code>
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            context\_type

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Validation rule context type.</p>

          <table>
            <thead>
              <tr>
                <th>
                  <strong>Context Type</strong>
                </th>

                <th>
                  <strong>Definition</strong>
                </th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>earning\_rule.order.paid</td>

                <td />
              </tr>

              <tr>
                <td>earning\_rule.custom\_event</td>

                <td />
              </tr>

              <tr>
                <td>earning\_rule.customer.segment.entered</td>

                <td />
              </tr>

              <tr>
                <td>campaign.discount\_coupons</td>

                <td />
              </tr>

              <tr>
                <td>campaign.discount\_coupons.discount.apply\_to\_order</td>

                <td />
              </tr>

              <tr>
                <td>campaign.discount\_coupons.discount.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>campaign.discount\_coupons.discount.apply\_to\_items\_proportionally</td>

                <td />
              </tr>

              <tr>
                <td>campaign.discount\_coupons.discount.apply\_to\_items\_proportionally\_by\_quantity</td>

                <td />
              </tr>

              <tr>
                <td>campaign.discount\_coupons.discount.fixed.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>campaign.gift\_vouchers</td>

                <td />
              </tr>

              <tr>
                <td>campaign.gift\_vouchers.gift.apply\_to\_order</td>

                <td />
              </tr>

              <tr>
                <td>campaign.gift\_vouchers.gift.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>campaign.referral\_program</td>

                <td />
              </tr>

              <tr>
                <td>campaign.referral\_program.discount.apply\_to\_order</td>

                <td />
              </tr>

              <tr>
                <td>campaign.referral\_program.discount.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>campaign.referral\_program.discount.apply\_to\_items\_proportionally</td>

                <td />
              </tr>

              <tr>
                <td>campaign.referral\_program.discount.apply\_to\_items\_proportionally\_by\_quantity</td>

                <td />
              </tr>

              <tr>
                <td>campaign.referral\_program.discount.fixed.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>campaign.promotion</td>

                <td />
              </tr>

              <tr>
                <td>campaign.promotion.discount.apply\_to\_order</td>

                <td />
              </tr>

              <tr>
                <td>campaign.promotion.discount.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>campaign.promotion.discount.apply\_to\_items\_proportionally</td>

                <td />
              </tr>

              <tr>
                <td>campaign.promotion.discount.apply\_to\_items\_proportionally\_by\_quantity</td>

                <td />
              </tr>

              <tr>
                <td>campaign.promotion.discount.fixed.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>campaign.loyalty\_program</td>

                <td />
              </tr>

              <tr>
                <td>voucher.discount\_voucher</td>

                <td />
              </tr>

              <tr>
                <td>voucher.discount\_voucher.discount.apply\_to\_order</td>

                <td />
              </tr>

              <tr>
                <td>voucher.discount\_voucher.discount.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>voucher.discount\_voucher.discount.apply\_to\_items\_proportionally</td>

                <td />
              </tr>

              <tr>
                <td>voucher.discount\_voucher.discount.apply\_to\_items\_proportionally\_by\_quantity</td>

                <td />
              </tr>

              <tr>
                <td>voucher.discount\_voucher.discount.fixed.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>voucher.gift\_voucher</td>

                <td />
              </tr>

              <tr>
                <td>voucher.gift\_voucher.gift.apply\_to\_order</td>

                <td />
              </tr>

              <tr>
                <td>voucher.gift\_voucher.gift.apply\_to\_items</td>

                <td />
              </tr>

              <tr>
                <td>voucher.loyalty\_card</td>

                <td />
              </tr>

              <tr>
                <td>distribution.custom\_event</td>

                <td />
              </tr>

              <tr>
                <td>reward\_assignment.pay\_with\_points</td>

                <td />
              </tr>

              <tr>
                <td>global</td>

                <td />
              </tr>
            </tbody>
          </table>

          <p>
            Available values:
            <code>earning\_rule.order.paid</code>,
            <code>earning\_rule.custom\_event</code>,
            <code>earning\_rule.customer.segment.entered</code>,
            <code>earning\_rule.customer.tier.joined</code>,
            <code>earning\_rule.customer.tier.left</code>,
            <code>earning\_rule.customer.tier.upgraded</code>,
            <code>earning\_rule.customer.tier.downgraded</code>,
            <code>earning\_rule.customer.tier.prolonged</code>,
            <code>campaign.discount\_coupons</code>,
            <code>campaign.discount\_coupons.discount.apply\_to\_order</code>,
            <code>campaign.discount\_coupons.discount.apply\_to\_items</code>,
            <code>campaign.discount\_coupons.discount.apply\_to\_items\_proportionally</code>,
            <code>campaign.discount\_coupons.discount.apply\_to\_items\_proportionally\_by\_quantity</code>,
            <code>campaign.discount\_coupons.discount.apply\_to\_items\_by\_quantity</code>,
            <code>campaign.discount\_coupons.discount.fixed.apply\_to\_items</code>,
            <code>campaign.discount\_coupons.discount.percent.apply\_to\_items</code>,
            <code>campaign.gift\_vouchers</code>,
            <code>campaign.gift\_vouchers.gift.apply\_to\_order</code>,
            <code>campaign.gift\_vouchers.gift.apply\_to\_items</code>,
            <code>campaign.referral\_program</code>,
            <code>campaign.referral\_program.discount.apply\_to\_order</code>,
            <code>campaign.referral\_program.discount.apply\_to\_items</code>,
            <code>campaign.referral\_program.discount.apply\_to\_items\_proportionally</code>,
            <code>campaign.referral\_program.discount.apply\_to\_items\_proportionally\_by\_quantity</code>,
            <code>campaign.referral\_program.discount.apply\_to\_items\_by\_quantity</code>,
            <code>campaign.referral\_program.discount.fixed.apply\_to\_items</code>,
            <code>campaign.referral\_program.discount.percent.apply\_to\_items</code>,
            <code>campaign.promotion</code>,
            <code>campaign.promotion.discount.apply\_to\_order</code>,
            <code>campaign.promotion.discount.apply\_to\_items</code>,
            <code>campaign.promotion.discount.apply\_to\_items\_proportionally</code>,
            <code>campaign.promotion.discount.apply\_to\_items\_proportionally\_by\_quantity</code>,
            <code>campaign.promotion.discount.apply\_to\_items\_by\_quantity</code>,
            <code>campaign.promotion.discount.fixed.apply\_to\_items</code>,
            <code>campaign.promotion.discount.percent.apply\_to\_items</code>,
            <code>campaign.loyalty\_program</code>,
            <code>voucher.discount\_voucher</code>,
            <code>voucher.discount\_voucher.discount.apply\_to\_order</code>,
            <code>voucher.discount\_voucher.discount.apply\_to\_items</code>,
            <code>voucher.discount\_voucher.discount.apply\_to\_items\_proportionally</code>,
            <code>voucher.discount\_voucher.discount.apply\_to\_items\_proportionally\_by\_quantity</code>,
            <code>voucher.discount\_voucher.discount.apply\_to\_items\_by\_quantity</code>,
            <code>voucher.discount\_voucher.discount.fixed.apply\_to\_items</code>,
            <code>voucher.discount\_voucher.discount.percent.apply\_to\_items</code>,
            <code>voucher.gift\_voucher</code>,
            <code>voucher.gift\_voucher.gift.apply\_to\_order</code>,
            <code>voucher.gift\_voucher.gift.apply\_to\_items</code>,
            <code>voucher.loyalty\_card</code>,
            <code>distribution.custom\_event</code>,
            <code>distribution.order.paid</code>,
            <code>distribution.order.created</code>,
            <code>distribution.order.canceled</code>,
            <code>distribution.order.updated</code>,
            <code>reward\_assignment.pay\_with\_points</code>,
            <code>global</code>
          </p>
        </td>
      </tr>
    </tbody>
  </table>

  <h2 id="validation-rule-rules">Validation Rule Rules</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>
            logic

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Defines the logic between the rules.</p>

          <p>
            <strong>Example:</strong>
            (1 and 2) and (3)
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            \[propertyName]

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>Contains the name of the validation rule.</p>

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    name

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>Voucherify's specific rule name. The list of available names is provided below.</p>

                  <table>
                    <thead>
                      <tr>
                        <th>
                          <strong>Type</strong>
                        </th>

                        <th>
                          <strong>Name</strong>
                        </th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <strong>Customer</strong>
                        </td>

                        <td>
                          customer.segment

                          <br />

                          customer.metadata\*
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Order</strong>
                        </td>

                        <td>
                          order.amount

                          <br />

                          order.initial\_amount

                          <br />

                          order.items.count

                          <br />

                          order.items.price\_any

                          <br />

                          order.items.price\_each

                          <br />

                          order.items.metadata\_any

                          <br />

                          order.items.metadata\_each

                          <br />

                          order.metadata\*
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Campaign</strong>
                        </td>

                        <td>
                          campaign.orders.amount\_discounted

                          <br />

                          campaign.orders.amount

                          <br />

                          campaign.redemptions.count

                          <br />

                          campaign.redemptions.count.daily

                          <br />

                          campaign.redemptions.count.monthly

                          <br />

                          campaign.redemptions.customers\_count

                          <br />

                          campaign.redemptions.customers\_count.daily

                          <br />

                          campaign.redemptions.customers\_count.monthly
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Redemption</strong>
                        </td>

                        <td>
                          redemption.gift.amount

                          <br />

                          redemption.count.daily

                          <br />

                          redemption.count.monthly

                          <br />

                          redemption.count.per\_customer

                          <br />

                          redemption.count.per\_customer.daily

                          <br />

                          redemption.count.per\_customer.monthly

                          <br />

                          redemption.api\_key

                          <br />

                          redemption.count.per\_api\_key

                          <br />

                          redemption.user.login

                          <br />

                          redemption.count.per\_user

                          <br />

                          redemption.metadata

                          <br />

                          redemption.reward.pay\_with\_points.points\_used
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Product</strong>
                        </td>

                        <td>
                          product.id

                          <br />

                          product.price

                          <br />

                          product.quantity

                          <br />

                          product.discount\_applicable

                          <br />

                          product.metadata\*

                          <br />

                          product.metadata.aggregated\_quantity

                          <br />

                          product.metadata.aggregated\_amount

                          <br />

                          product.metadata.discount\_applicable

                          <br />

                          product.metadata.match\_all
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>SKU</strong>
                        </td>

                        <td>
                          sku.id

                          <br />

                          sku.price

                          <br />

                          sku.quantity

                          <br />

                          sku.discount\_applicable
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Publication</strong>
                        </td>

                        <td>publication.redeemable\_by\_linked\_customer</td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Custom Event</strong>
                        </td>

                        <td>custom\_event.metadata\*</td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Order items</strong>
                        </td>

                        <td>
                          order.items.every

                          <br />

                          order.items.any

                          <br />

                          order.items.none

                          <br />

                          order.items.cheapest

                          <br />

                          order.items.most\_expensive
                        </td>
                      </tr>
                    </tbody>
                  </table>

                  <p>
                    \*Requires the
                    <code>property</code>
                    field to be defined.
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    property

                    <br />

                    <code>string</code>,
                    <code>null</code>
                  </p>
                </td>

                <td>
                  <p>
                    Custom name for a metadata property associated with the condition to be satisfied.
                    <strong>Required</strong>
                    if the property
                    <code>name</code>
                    is any of the following:

                    <br />

                    customer\_metadata

                    <br />

                    custom\_event\_metadata

                    <br />

                    order\_items\_metadata

                    <br />

                    order\_metadata

                    <br />

                    product\_metadata

                    <br />

                    redemption\_metadata
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>conditions</p>
                </td>

                <td>
                  See:
                  <a href="#validation-rule-conditions">Validation Rule Conditions</a>
                </td>
              </tr>

              <tr>
                <td>
                  <p>rules</p>
                </td>

                <td>
                  See:
                  <a href="#validation-rule-rules">Validation Rule Rules</a>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    error

                    <br />

                    <code>object</code>
                  </p>
                </td>

                <td>
                  <p>Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.</p>

                  <table>
                    <thead>
                      <tr>
                        <th>Attributes</th>
                        <th>Description</th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <p>
                            message

                            <br />

                            <code>string</code>
                          </p>
                        </td>

                        <td>
                          <p>The error message returned from API when validation / redemption fails to meet requirements of defined rule.</p>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
    </tbody>
  </table>

  <h2 id="validation-rule-bundle-rules">Validation Rule Bundle Rules</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>
            limit

            <br />

            <code>integer</code>,
            <code>null</code>
          </p>
        </td>

        <td>
          <p>
            Defines how many bundles can be identified in the order and the maximum multiplier of the discount per identified bundle. For example, if the order meets 3 bundles, but
            <code>limit: 2</code>,
            the discount will be multiplied by 2.
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            \[propertyName]

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>Contains the name of the bundle rule.</p>

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    name

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>
                    Voucherify's specific bundle rule name. Currently, it is only
                    <code>order.items.any</code>.
                  </p>

                  <p>
                    Available values:
                    <code>order.items.any</code>
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    conditions

                    <br />

                    <code>object</code>
                  </p>
                </td>

                <td>
                  <p>
                    Defines the conditions of the bundle rule. The order items in the customer's cart must meet the conditions. Because the rule concerns order items, the only permissible condition is
                    <code>\$is</code>.
                  </p>

                  <table>
                    <thead>
                      <tr>
                        <th>Attributes</th>
                        <th>Description</th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <p>
                            \$is

                            <br />

                            <code>array</code>
                          </p>
                        </td>

                        <td>
                          Array of:

                          <table>
                            <thead>
                              <tr>
                                <th>Attributes</th>
                                <th>Description</th>
                              </tr>
                            </thead>

                            <tbody>
                              <tr>
                                <td>
                                  <p>
                                    id

                                    <br />

                                    <code>string</code>
                                  </p>
                                </td>

                                <td>
                                  <p>Unique identifier of the product, SKU, or collection assigned by Voucherify.</p>
                                </td>
                              </tr>

                              <tr>
                                <td>
                                  <p>
                                    type

                                    <br />

                                    <code>string</code>
                                  </p>
                                </td>

                                <td>
                                  <p>
                                    Type of the order item. It can be a
                                    <code>product\_or\_sku</code>
                                    or
                                    <code>products\_collection</code>
                                  </p>

                                  <p>
                                    Available values:
                                    <code>product\_or\_sku</code>,
                                    <code>products\_collection</code>
                                  </p>
                                </td>
                              </tr>

                              <tr>
                                <td>
                                  <p>
                                    object

                                    <br />

                                    <code>string</code>
                                  </p>
                                </td>

                                <td>
                                  <p>
                                    Object used in the bundle rule. It can be a
                                    <code>products\_collection</code>,
                                    <code>product</code>,
                                    or
                                    <code>sku</code>.
                                  </p>

                                  <p>
                                    Available values:
                                    <code>products\_collection</code>,
                                    <code>product</code>,
                                    <code>sku</code>
                                  </p>
                                </td>
                              </tr>
                            </tbody>
                          </table>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </td>
              </tr>

              <tr>
                <td>
                  <p>rules</p>
                </td>

                <td />
              </tr>

              <tr>
                <td>
                  <p>
                    error

                    <br />

                    <code>object</code>
                  </p>
                </td>

                <td>
                  <p>
                    <strong>CURRENTLY UNSUPPORTED</strong>.
                    Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.
                  </p>

                  <table>
                    <thead>
                      <tr>
                        <th>Attributes</th>
                        <th>Description</th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <p>
                            message

                            <br />

                            <code>string</code>
                          </p>
                        </td>

                        <td>
                          <p>The error message returned from API when validation / redemption fails to meet requirements of defined rule.</p>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
    </tbody>
  </table>

  <h2 id="applicable-to">Applicable To</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>
            object

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>This object stores information about the resource to which the discount is applicable.</p>

          <p>
            Available values:
            <code>product</code>,
            <code>sku</code>,
            <code>products\_collection</code>
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            id

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Unique product collection, product, or SKU identifier assigned by Voucherify.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            source\_id

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>The source identifier from your inventory system.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            product\_id

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Parent product's unique ID assigned by Voucherify.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            product\_source\_id

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Parent product's source ID from your inventory system.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            price

            <br />

            <code>number</code>
          </p>
        </td>

        <td>
          <p>New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the price\_formula parameter is present in the fixed price definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            price\_formula

            <br />

            <code>number</code>
          </p>
        </td>

        <td>
          <p>Formula used to dynamically calculate the discounted price of an item.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>effect</p>
        </td>

        <td>
          <p>Defines how the discount is applied to the customer's order.</p>
          <a href="#applicable-to-effect">Applicable To Effect</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            quantity\_limit

            <br />

            <code>integer</code>
          </p>
        </td>

        <td>
          <p>The maximum number of units allowed to be discounted per order line item.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            aggregated\_quantity\_limit

            <br />

            <code>integer</code>
          </p>
        </td>

        <td>
          <p>The maximum number of units allowed to be discounted combined across all matched order line items.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            amount\_limit

            <br />

            <code>integer</code>
          </p>
        </td>

        <td>
          <p>Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount is written as 600.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            aggregated\_amount\_limit

            <br />

            <code>integer</code>
          </p>
        </td>

        <td>
          <p>Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a \$6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects:</p>

          <ul>
            <li>
              <code>APPLY\_TO\_ITEMS</code>
              (each item subtotal is discounted equally)
            </li>

            <li>
              <code>APPLY\_TO\_ITEMS\_BY\_QUANTITY</code>
              (each unit of matched products has the same discount value)
            </li>
          </ul>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            order\_item\_indices

            <br />

            <code>array</code>
          </p>
        </td>

        <td>
          <p>
            Lists which order lines are (not) covered by the discount. The order in the array is determined by the sequence of applied discounts, while the numbers correspond to the order lines sent in the
            <code>order</code>
            object in the request. The first order line is assigned
            <code>0</code>,
            the second order line is assigned
            <code>1</code>,
            and so on.
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            order\_item\_units

            <br />

            <code>array</code>
          </p>
        </td>

        <td>
          <p>
            Lists which units within order lines are covered by the discount. The order line items are listed according to sequence of applied discounts while the
            <code>index</code>
            corresponds to the order line sent in the
            <code>order</code>
            object in the request.
          </p>

          Array of:

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    index

                    <br />

                    <code>integer</code>
                  </p>
                </td>

                <td>
                  <p>Number assigned to the order line item in accordance with the order sent in the request.</p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    units

                    <br />

                    <code>array</code>
                  </p>
                </td>

                <td>
                  <p>
                    Numbers of units in the order line covered by the discount; e.g.
                    <code>2, 5, 8</code>
                    for 10 units with the setting
                    <code>"skip\_initially": 1</code>,
                    <code>"repeat": 3</code>.
                    The counting of units starts from
                    <code>1</code>.
                    The maximum quantity of all handled units is 1000. If the quantity of all order items exceeds 1000, this array is not returned, but
                    <code>units\_limit\_exceeded: true</code>.
                    However, the discount is calculated properly for all relevant units.
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    units\_limit\_exceeded

                    <br />

                    <code>boolean</code>
                  </p>
                </td>

                <td>
                  <p>
                    Returned as
                    <code>true</code>
                    only when the sum total of
                    <code>quantity</code>
                    of all order items exceeds 1000.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            repeat

            <br />

            <code>integer</code>
          </p>
        </td>

        <td>
          <p>
            Determines the recurrence of the discount, e.g.
            <code>"repeat": 3</code>
            means that the discount is applied to every third item.
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            skip\_initially

            <br />

            <code>integer</code>
          </p>
        </td>

        <td>
          <p>Determines how many items are skipped before the discount is applied.</p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            target

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>
            Determines to which kinds of objects the discount is applicable.
            <code>ITEM</code>
            includes products and SKUs.
            <code>UNIT</code>
            means particular units within an order line.
          </p>

          <p>
            Available values:
            <code>ITEM</code>,
            <code>UNIT</code>
          </p>
        </td>
      </tr>
    </tbody>
  </table>

  <h2 id="validation-rule-conditions">Validation Rule Conditions</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>\$is</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$is\_not</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$in</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$not\_in</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$less\_than</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$less\_than\_or\_equal</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$more\_than</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$more\_than\_or\_equal</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$starts\_with</p>
        </td>

        <td>
          See:
          <a href="#any-string">Any String</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$ends\_with</p>
        </td>

        <td>
          See:
          <a href="#any-string">Any String</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$contains</p>
        </td>

        <td>
          See:
          <a href="#any-string">Any String</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$timeframe</p>
        </td>

        <td>
          See:
          <a href="#any-string">Any String</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$timeframe\_absolute</p>
        </td>

        <td>
          See:
          <a href="#any-string">Any String</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$timeframe\_daily\_hours</p>
        </td>

        <td>
          See:
          <a href="#any-string">Any String</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            \$dow

            <br />

            <code>array</code>
          </p>
        </td>

        <td />
      </tr>

      <tr>
        <td>
          <p>\$count</p>
        </td>

        <td>
          See:
          <a href="#any-number">Any Number</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$count\_more</p>
        </td>

        <td>
          See:
          <a href="#any-number">Any Number</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$count\_less</p>
        </td>

        <td>
          See:
          <a href="#any-number">Any Number</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$not\_differ</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$not\_intersect</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$from</p>
        </td>

        <td>
          See:
          <a href="#any">Any</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$after</p>
        </td>

        <td>
          See:
          <a href="#any-date-and-date-time">Any Date and Date-Time</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$before</p>
        </td>

        <td>
          See:
          <a href="#any-date-and-date-time">Any Date and Date-Time</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$more\_than\_ago</p>
        </td>

        <td>
          See:
          <a href="#any-number">Any Number</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$less\_than\_ago</p>
        </td>

        <td>
          See:
          <a href="#any-number">Any Number</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$is\_days\_ago</p>
        </td>

        <td>
          See:
          <a href="#any-number">Any Number</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$more\_than\_future</p>
        </td>

        <td>
          See:
          <a href="#any-number">Any Number</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$less\_than\_future</p>
        </td>

        <td>
          See:
          <a href="#any-number">Any Number</a>
        </td>
      </tr>

      <tr>
        <td>
          <p>\$is\_days\_in\_future</p>
        </td>

        <td>
          See:
          <a href="#any-number">Any Number</a>
        </td>
      </tr>
    </tbody>
  </table>

  <h2 id="validation-rule-rules">Validation Rule Rules</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>
            logic

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Defines the logic between the rules.</p>

          <p>
            <strong>Example:</strong>
            (1 and 2) and (3)
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            \[propertyName]

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>Contains the name of the validation rule.</p>

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    name

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>Voucherify's specific rule name. The list of available names is provided below.</p>

                  <table>
                    <thead>
                      <tr>
                        <th>
                          <strong>Type</strong>
                        </th>

                        <th>
                          <strong>Name</strong>
                        </th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <strong>Customer</strong>
                        </td>

                        <td>
                          customer.segment

                          <br />

                          customer.metadata\*
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Order</strong>
                        </td>

                        <td>
                          order.amount

                          <br />

                          order.initial\_amount

                          <br />

                          order.items.count

                          <br />

                          order.items.price\_any

                          <br />

                          order.items.price\_each

                          <br />

                          order.items.metadata\_any

                          <br />

                          order.items.metadata\_each

                          <br />

                          order.metadata\*
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Campaign</strong>
                        </td>

                        <td>
                          campaign.orders.amount\_discounted

                          <br />

                          campaign.orders.amount

                          <br />

                          campaign.redemptions.count

                          <br />

                          campaign.redemptions.count.daily

                          <br />

                          campaign.redemptions.count.monthly

                          <br />

                          campaign.redemptions.customers\_count

                          <br />

                          campaign.redemptions.customers\_count.daily

                          <br />

                          campaign.redemptions.customers\_count.monthly
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Redemption</strong>
                        </td>

                        <td>
                          redemption.gift.amount

                          <br />

                          redemption.count.daily

                          <br />

                          redemption.count.monthly

                          <br />

                          redemption.count.per\_customer

                          <br />

                          redemption.count.per\_customer.daily

                          <br />

                          redemption.count.per\_customer.monthly

                          <br />

                          redemption.api\_key

                          <br />

                          redemption.count.per\_api\_key

                          <br />

                          redemption.user.login

                          <br />

                          redemption.count.per\_user

                          <br />

                          redemption.metadata

                          <br />

                          redemption.reward.pay\_with\_points.points\_used
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Product</strong>
                        </td>

                        <td>
                          product.id

                          <br />

                          product.price

                          <br />

                          product.quantity

                          <br />

                          product.discount\_applicable

                          <br />

                          product.metadata\*

                          <br />

                          product.metadata.aggregated\_quantity

                          <br />

                          product.metadata.aggregated\_amount

                          <br />

                          product.metadata.discount\_applicable

                          <br />

                          product.metadata.match\_all
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>SKU</strong>
                        </td>

                        <td>
                          sku.id

                          <br />

                          sku.price

                          <br />

                          sku.quantity

                          <br />

                          sku.discount\_applicable
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Publication</strong>
                        </td>

                        <td>publication.redeemable\_by\_linked\_customer</td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Custom Event</strong>
                        </td>

                        <td>custom\_event.metadata\*</td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Order items</strong>
                        </td>

                        <td>
                          order.items.every

                          <br />

                          order.items.any

                          <br />

                          order.items.none

                          <br />

                          order.items.cheapest

                          <br />

                          order.items.most\_expensive
                        </td>
                      </tr>
                    </tbody>
                  </table>

                  <p>
                    \*Requires the
                    <code>property</code>
                    field to be defined.
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    property

                    <br />

                    <code>string</code>,
                    <code>null</code>
                  </p>
                </td>

                <td>
                  <p>
                    Custom name for a metadata property associated with the condition to be satisfied.
                    <strong>Required</strong>
                    if the property
                    <code>name</code>
                    is any of the following:

                    <br />

                    customer\_metadata

                    <br />

                    custom\_event\_metadata

                    <br />

                    order\_items\_metadata

                    <br />

                    order\_metadata

                    <br />

                    product\_metadata

                    <br />

                    redemption\_metadata
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>conditions</p>
                </td>

                <td>
                  See:
                  <a href="#validation-rule-conditions">Validation Rule Conditions</a>
                </td>
              </tr>

              <tr>
                <td>
                  <p>rules</p>
                </td>

                <td>
                  See:
                  <a href="#validation-rule-rules">Validation Rule Rules</a>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    error

                    <br />

                    <code>object</code>
                  </p>
                </td>

                <td>
                  <p>Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.</p>

                  <table>
                    <thead>
                      <tr>
                        <th>Attributes</th>
                        <th>Description</th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <p>
                            message

                            <br />

                            <code>string</code>
                          </p>
                        </td>

                        <td>
                          <p>The error message returned from API when validation / redemption fails to meet requirements of defined rule.</p>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
    </tbody>
  </table>

  <h2 id="applicable-to-effect">Applicable To Effect</h2>

  <p>
    Available values:
    <code>APPLY\_TO\_EVERY</code>,
    <code>APPLY\_TO\_CHEAPEST</code>,
    <code>APPLY\_FROM\_CHEAPEST</code>,
    <code>APPLY\_TO\_MOST\_EXPENSIVE</code>,
    <code>APPLY\_FROM\_MOST\_EXPENSIVE</code>
  </p>

  <h2 id="any">Any</h2>
  <p>Array any of:</p>

  <ol>
    <li>string</li>
    <li>string</li>
    <li>string</li>
    <li>number</li>
    <li>object</li>
  </ol>

  <h2 id="any">Any</h2>
  <p>Array any of:</p>

  <ol>
    <li>string</li>
    <li>string</li>
    <li>string</li>
    <li>number</li>
    <li>object</li>
  </ol>

  <h2 id="any-string">Any String</h2>
  <h2 id="any-number">Any Number</h2>
  <h2 id="any-date-and-date-time">Any Date and Date-Time</h2>
  <p>Array any of:</p>

  <ol>
    <li>string</li>
    <li>string</li>
  </ol>

  <h2 id="validation-rule-rules">Validation Rule Rules</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>
            logic

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Defines the logic between the rules.</p>

          <p>
            <strong>Example:</strong>
            (1 and 2) and (3)
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            \[propertyName]

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>Contains the name of the validation rule.</p>

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    name

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>Voucherify's specific rule name. The list of available names is provided below.</p>

                  <table>
                    <thead>
                      <tr>
                        <th>
                          <strong>Type</strong>
                        </th>

                        <th>
                          <strong>Name</strong>
                        </th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <strong>Customer</strong>
                        </td>

                        <td>
                          customer.segment

                          <br />

                          customer.metadata\*
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Order</strong>
                        </td>

                        <td>
                          order.amount

                          <br />

                          order.initial\_amount

                          <br />

                          order.items.count

                          <br />

                          order.items.price\_any

                          <br />

                          order.items.price\_each

                          <br />

                          order.items.metadata\_any

                          <br />

                          order.items.metadata\_each

                          <br />

                          order.metadata\*
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Campaign</strong>
                        </td>

                        <td>
                          campaign.orders.amount\_discounted

                          <br />

                          campaign.orders.amount

                          <br />

                          campaign.redemptions.count

                          <br />

                          campaign.redemptions.count.daily

                          <br />

                          campaign.redemptions.count.monthly

                          <br />

                          campaign.redemptions.customers\_count

                          <br />

                          campaign.redemptions.customers\_count.daily

                          <br />

                          campaign.redemptions.customers\_count.monthly
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Redemption</strong>
                        </td>

                        <td>
                          redemption.gift.amount

                          <br />

                          redemption.count.daily

                          <br />

                          redemption.count.monthly

                          <br />

                          redemption.count.per\_customer

                          <br />

                          redemption.count.per\_customer.daily

                          <br />

                          redemption.count.per\_customer.monthly

                          <br />

                          redemption.api\_key

                          <br />

                          redemption.count.per\_api\_key

                          <br />

                          redemption.user.login

                          <br />

                          redemption.count.per\_user

                          <br />

                          redemption.metadata

                          <br />

                          redemption.reward.pay\_with\_points.points\_used
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Product</strong>
                        </td>

                        <td>
                          product.id

                          <br />

                          product.price

                          <br />

                          product.quantity

                          <br />

                          product.discount\_applicable

                          <br />

                          product.metadata\*

                          <br />

                          product.metadata.aggregated\_quantity

                          <br />

                          product.metadata.aggregated\_amount

                          <br />

                          product.metadata.discount\_applicable

                          <br />

                          product.metadata.match\_all
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>SKU</strong>
                        </td>

                        <td>
                          sku.id

                          <br />

                          sku.price

                          <br />

                          sku.quantity

                          <br />

                          sku.discount\_applicable
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Publication</strong>
                        </td>

                        <td>publication.redeemable\_by\_linked\_customer</td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Custom Event</strong>
                        </td>

                        <td>custom\_event.metadata\*</td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Order items</strong>
                        </td>

                        <td>
                          order.items.every

                          <br />

                          order.items.any

                          <br />

                          order.items.none

                          <br />

                          order.items.cheapest

                          <br />

                          order.items.most\_expensive
                        </td>
                      </tr>
                    </tbody>
                  </table>

                  <p>
                    \*Requires the
                    <code>property</code>
                    field to be defined.
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    property

                    <br />

                    <code>string</code>,
                    <code>null</code>
                  </p>
                </td>

                <td>
                  <p>
                    Custom name for a metadata property associated with the condition to be satisfied.
                    <strong>Required</strong>
                    if the property
                    <code>name</code>
                    is any of the following:

                    <br />

                    customer\_metadata

                    <br />

                    custom\_event\_metadata

                    <br />

                    order\_items\_metadata

                    <br />

                    order\_metadata

                    <br />

                    product\_metadata

                    <br />

                    redemption\_metadata
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>conditions</p>
                </td>

                <td>
                  See:
                  <a href="#validation-rule-conditions">Validation Rule Conditions</a>
                </td>
              </tr>

              <tr>
                <td>
                  <p>rules</p>
                </td>

                <td>
                  See:
                  <a href="#validation-rule-rules">Validation Rule Rules</a>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    error

                    <br />

                    <code>object</code>
                  </p>
                </td>

                <td>
                  <p>Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.</p>

                  <table>
                    <thead>
                      <tr>
                        <th>Attributes</th>
                        <th>Description</th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <p>
                            message

                            <br />

                            <code>string</code>
                          </p>
                        </td>

                        <td>
                          <p>The error message returned from API when validation / redemption fails to meet requirements of defined rule.</p>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
    </tbody>
  </table>

  <h2 id="validation-rule-rules">Validation Rule Rules</h2>

  <table>
    <thead>
      <tr>
        <th>Attributes</th>
        <th>Description</th>
      </tr>
    </thead>

    <tbody>
      <tr>
        <td>
          <p>
            logic

            <br />

            <code>string</code>
          </p>
        </td>

        <td>
          <p>Defines the logic between the rules.</p>

          <p>
            <strong>Example:</strong>
            (1 and 2) and (3)
          </p>
        </td>
      </tr>

      <tr>
        <td>
          <p>
            \[propertyName]

            <br />

            <code>object</code>
          </p>
        </td>

        <td>
          <p>Contains the name of the validation rule.</p>

          <table>
            <thead>
              <tr>
                <th>Attributes</th>
                <th>Description</th>
              </tr>
            </thead>

            <tbody>
              <tr>
                <td>
                  <p>
                    name

                    <br />

                    <code>string</code>
                  </p>
                </td>

                <td>
                  <p>Voucherify's specific rule name. The list of available names is provided below.</p>

                  <table>
                    <thead>
                      <tr>
                        <th>
                          <strong>Type</strong>
                        </th>

                        <th>
                          <strong>Name</strong>
                        </th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <strong>Customer</strong>
                        </td>

                        <td>
                          customer.segment

                          <br />

                          customer.metadata\*
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Order</strong>
                        </td>

                        <td>
                          order.amount

                          <br />

                          order.initial\_amount

                          <br />

                          order.items.count

                          <br />

                          order.items.price\_any

                          <br />

                          order.items.price\_each

                          <br />

                          order.items.metadata\_any

                          <br />

                          order.items.metadata\_each

                          <br />

                          order.metadata\*
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Campaign</strong>
                        </td>

                        <td>
                          campaign.orders.amount\_discounted

                          <br />

                          campaign.orders.amount

                          <br />

                          campaign.redemptions.count

                          <br />

                          campaign.redemptions.count.daily

                          <br />

                          campaign.redemptions.count.monthly

                          <br />

                          campaign.redemptions.customers\_count

                          <br />

                          campaign.redemptions.customers\_count.daily

                          <br />

                          campaign.redemptions.customers\_count.monthly
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Redemption</strong>
                        </td>

                        <td>
                          redemption.gift.amount

                          <br />

                          redemption.count.daily

                          <br />

                          redemption.count.monthly

                          <br />

                          redemption.count.per\_customer

                          <br />

                          redemption.count.per\_customer.daily

                          <br />

                          redemption.count.per\_customer.monthly

                          <br />

                          redemption.api\_key

                          <br />

                          redemption.count.per\_api\_key

                          <br />

                          redemption.user.login

                          <br />

                          redemption.count.per\_user

                          <br />

                          redemption.metadata

                          <br />

                          redemption.reward.pay\_with\_points.points\_used
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Product</strong>
                        </td>

                        <td>
                          product.id

                          <br />

                          product.price

                          <br />

                          product.quantity

                          <br />

                          product.discount\_applicable

                          <br />

                          product.metadata\*

                          <br />

                          product.metadata.aggregated\_quantity

                          <br />

                          product.metadata.aggregated\_amount

                          <br />

                          product.metadata.discount\_applicable

                          <br />

                          product.metadata.match\_all
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>SKU</strong>
                        </td>

                        <td>
                          sku.id

                          <br />

                          sku.price

                          <br />

                          sku.quantity

                          <br />

                          sku.discount\_applicable
                        </td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Publication</strong>
                        </td>

                        <td>publication.redeemable\_by\_linked\_customer</td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Custom Event</strong>
                        </td>

                        <td>custom\_event.metadata\*</td>
                      </tr>

                      <tr>
                        <td>
                          <strong>Order items</strong>
                        </td>

                        <td>
                          order.items.every

                          <br />

                          order.items.any

                          <br />

                          order.items.none

                          <br />

                          order.items.cheapest

                          <br />

                          order.items.most\_expensive
                        </td>
                      </tr>
                    </tbody>
                  </table>

                  <p>
                    \*Requires the
                    <code>property</code>
                    field to be defined.
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    property

                    <br />

                    <code>string</code>,
                    <code>null</code>
                  </p>
                </td>

                <td>
                  <p>
                    Custom name for a metadata property associated with the condition to be satisfied.
                    <strong>Required</strong>
                    if the property
                    <code>name</code>
                    is any of the following:

                    <br />

                    customer\_metadata

                    <br />

                    custom\_event\_metadata

                    <br />

                    order\_items\_metadata

                    <br />

                    order\_metadata

                    <br />

                    product\_metadata

                    <br />

                    redemption\_metadata
                  </p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>conditions</p>
                </td>

                <td>
                  See:
                  <a href="#validation-rule-conditions">Validation Rule Conditions</a>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    rules

                    <br />

                    <code>object</code>
                  </p>
                </td>

                <td>
                  <p>Another set of validation rules. If you need to create complex rules with more nested rules, use the validation rule builder in the dashboard.</p>
                </td>
              </tr>

              <tr>
                <td>
                  <p>
                    error

                    <br />

                    <code>object</code>
                  </p>
                </td>

                <td>
                  <p>Contains the error message returned from API when validation / redemption fails to meet requirements of defined rule.</p>

                  <table>
                    <thead>
                      <tr>
                        <th>Attributes</th>
                        <th>Description</th>
                      </tr>
                    </thead>

                    <tbody>
                      <tr>
                        <td>
                          <p>
                            message

                            <br />

                            <code>string</code>
                          </p>
                        </td>

                        <td>
                          <p>The error message returned from API when validation / redemption fails to meet requirements of defined rule.</p>
                        </td>
                      </tr>
                    </tbody>
                  </table>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
    </tbody>
  </table>
</div>
