Create an order rule that will apply to qualified orders
  • 22 Nov 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light

Create an order rule that will apply to qualified orders

  • Dark
    Light

Article summary

Post
/rules

Create an order rule that will apply to qualified orders

Security
HTTP
Type bearer
Body parameters
object
nextBox
boolean

Apply this rule to the very next order received, regardless of the order number.

orderId
integer

Order id associated with rule

boxNumber
integer

The order number associated with a rule. Represents the sequential order number of the customer's lifetime orders under a specific contract, starting at 1 and incrementing with every committed order.

isActive
integer

The active status of a rule. Inactive rules are editable and visible in the admin UI, but are not run against orders. 1 is active and 0 is inactive.

itemId
string Required

Id of the product to be added by this order rule.

type
string Required

Type of item given by the order rule. Gift is a free item, while Product is a paid item.

Valid values[ "Gift", "Product" ]
quantity
integer

Quantity of the product to be added by this order rule

exclusive
integer

The exclusive status of a rule. If there is an exclusive rule for a given order, no other rules will be applied to that order. 1 is exclusive and 0 is not exclusive.

startDate
string (date)

The earliest order delivery date this rule will be valid for (inclusive).

endDate
string (date)

The latest order delivery date this rule will be valid for (inclusive).

comment
string

A field to store any additional information about the rule.

subscriptionType
string

The name of the subscription type that this rule will apply for. Note this is only for display purposes and does not affect the rule.

priority
integer

The rule's priority determines the order in which it is applied. A priority of 1 means it has the highest priority and will be applied before others.

alwaysInclude
boolean

Always include rules will always be applied to orders, regardless of the order number.

subscriptionTypeId
string

The id of the subscription type this rule will apply for. If undefined or null, the order rule will apply to all subscription types.

Responses
200

Successful response

Expand All
object
status
string

Status of the response

Valid values[ "ok", "error" ]
data
object (Rule)
nextBox
boolean

Apply this rule to the very next order received, regardless of the order number.

orderId
integer

Order id associated with rule

boxNumber
integer

The order number associated with a rule. Represents the sequential order number of the customer's lifetime orders under a specific contract, starting at 1 and incrementing with every committed order.

isActive
integer

The active status of a rule. Inactive rules are editable and visible in the admin UI, but are not run against orders. 1 is active and 0 is inactive.

itemId
string

Id of the product to be added by this order rule.

type
string

Type of item given by the order rule. Gift is a free item, while Product is a paid item.

Valid values[ "Gift", "Product" ]
quantity
integer

Quantity of the product to be added by this order rule

exclusive
integer

The exclusive status of a rule. If there is an exclusive rule for a given order, no other rules will be applied to that order. 1 is exclusive and 0 is not exclusive.

startDate
string (date)

The earliest order delivery date this rule will be valid for (inclusive).

endDate
string (date)

The latest order delivery date this rule will be valid for (inclusive).

comment
string

A field to store any additional information about the rule.

subscriptionType
string

The name of the subscription type that this rule will apply for. Note this is only for display purposes and does not affect the rule.

priority
integer

The rule's priority determines the order in which it is applied. A priority of 1 means it has the highest priority and will be applied before others.

alwaysInclude
boolean

Always include rules will always be applied to orders, regardless of the order number.

subscriptionTypeId
string

The id of the subscription type this rule will apply for. If undefined or null, the order rule will apply to all subscription types.

401

Unauthorized response

object
status
string

Status of the response, in this case "error".

message
string

Unauthorized error message.

500

Error response

object
status
string

Status of the response, in this case "error"

error
string

A short error summary.

message
string

A detailed message about the error.


Was this article helpful?