Inventory > Inventory Rules > inventoryRulesCreate
Commerce APIInventoryInventory RulesinventoryRulesCreate
inventoryRulesCreate
POST:inventory_rules.json

Description

Create one or multiple inventory rules.

Permission bit: "inventory_rules.create"

Topic: Inventory Rules

Arguments

data: [InventoryRuleCreate!]!

Main argument for mutations.


shop_id: String!

Unique shop identifier. See also: Unique Identifiers

Example: "sh_EQzGqWoY"


Data Argument Fields

components: String

Inventory rule components (custom JSON format)

Example: "[]"


inventory_strategy: InventoryStrategy

How inventory location should be picked


multiple_locations: Boolean

Whether to allow picking multiple locations per order

Example: true


name: String!

Name of the inventory rule

Example: "New York Local Tax"

Valid when: name is not empty

Valid when: name's length doesn't exceed 250 characters


prefer_pickup_location: Boolean

Whether to consider customer selected pickup location before anything else

Example: true


priority: Int

Priority of the rule (rule with higher priority is to be evaluated first)

Example: 0


split_bundle_items: Boolean

Whether to allow splitting bundle line items across multiple locations

Example: false


split_line_items: Boolean

Whether to allow splitting individual line items across multiple locations

Example: false


zones: [ZoneCreate!]


Result

[InventoryRule!]

Preview (typescript)

Loading module