Inventory > Inventory > variantInventoryCreate
Commerce APIInventoryInventoryvariantInventoryCreate
variantInventoryCreate
POST:variant_inventory.json

Description

Create inventory entry for a particular product variant. Inventory is stored on the orders service DB and hence has a separate API endpoint.

Permission bit: "variant_inventory.modify"

Topic: Inventory

Arguments

data: [VariantInventoryCreate!]!

Main argument for mutations.


shop_id: String!

Unique shop identifier. See also: Unique Identifiers

Example: "sh_EQzGqWoY"


variant_id: String!

Unique variant identifier. See also: Unique Identifiers

Example: "va_EQzGqWoY"


Data Argument Fields

add: Int

Amount of items to add to inventory (can be negative to subtract items)

Example: 5


bin_location: String

Physical location of the inventory item in a shops warehouse

Example: "Level 3 Shelf 14 A"

Valid when: bin_location's length doesn't exceed 30 characters


inventory_location_id: String!

Unique inventory location identifier. See also: Unique Identifiers

Example: "il_EQzGqWoY"

Valid when: inventory_location_id matches regexp pattern: ^il_


low_stock_level: Int

Low stock level (if non-zero, when to notify shop owner about low stock level)

Example: 50

Valid when: low_stock_level is a non-negative integer


set: Int

Amount of items to set inventory to

Example: 5


Result

VariantInventory

Preview (typescript)

Loading module