List all order rules
  • 22 Nov 2024
  • 2 Minutes to read
  • Contributors
  • Dark
    Light

List all order rules

  • Dark
    Light

Article summary

Get
/rules

Fetch order rules with pagination and optional filters

Security
HTTP
Type bearer
Query parameters
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.

boxNumber
integer

Filter order rules by order number. If undefined or null, the API will fetch all rules regardless of order number.

subscription_type_id
string

The id of the subscription type this rule will apply for. If undefined or null, the API will fetch all rules regardless of subscription type.

limit
integer

Maximum number of order rules to return.

Default250
offset
integer

Used to specify the starting point from which order rules should be retrieved in a paginated API response.

Default0
Responses
200

Successful response

Expand All
object
status
string

Status of the response

Valid values[ "ok", "error" ]
meta
object (Meta)
offset
integer

Number of order rules to skip before starting to fetch.

limit
integer

The maximum number of order rules to return.

count
integer

The total number of order rules that match the search.

total
integer

The total number of order rules that match the search.

data
Array of object (Rule)
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

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.


Was this article helpful?