Inventory Management

API Endpoint

The Inventory Management API allows you to search for sku based inventory or update inventory.

Inventory

GET /api/json/manage_inventory/find
RequestsFind inventory records modified since 1st October 2018
Body
field=5
condition=4
date1=2018-10-01T00:00:00
username=fred123
password=password123
Responses200
Headers
Content-Type: application/json
Body
{
  "response_status": {
    "code": 10001,
    "severity": "SUCCESS",
    "description": "."
  },
  "inventories": [
    {
      "product_id": "19617",
      "product_code": "5170",
      "product_name": "ComfortSoft 50/50 Cotton/Poly T Shirt",
      "supplier": "Sanmar",
      "sku": "312033",
      "vendor_sku": "312033",
      "dn_sku_id": "19617_1378",
      "dn_vsku_id": "1064_1378",
      "product_size": {
        "option_id": 2,
        "name": "Medium",
        "code": "M",
        "sub_sizes": []
      },
      "product_color": {
        "id": 35345,
        "name": "White"
      },
      "inv_on": true,
      "inv_lvl": 3,
      "inv_warn": 2,
      "inv_reorder_to": 3,
      "inv_on_order_po": 4,
      "inv_on_order_stk": 1,
      "inv_on_order_total": 5,
      "inv_last_modified": "2018-10-01T00:00:00"
    }
  ],
  "total": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "response_status": {
      "type": "object",
      "properties": {
        "code": {
          "type": "number",
          "description": "the status code."
        },
        "severity": {
          "type": "string",
          "description": "either SUCCESS or ERROR"
        },
        "description": {
          "type": "string",
          "description": "A description of the error. Blank when SUCCESS."
        }
      },
      "required": [
        "code"
      ]
    },
    "inventories": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "string",
            "enum": [
              "19617"
            ],
            "description": "The product Id."
          },
          "product_code": {
            "type": "string",
            "enum": [
              "5170"
            ],
            "description": "The product code."
          },
          "product_name": {
            "type": "string",
            "enum": [
              "ComfortSoft 50/50 Cotton/Poly T Shirt"
            ],
            "description": "The product name."
          },
          "supplier": {
            "type": "string",
            "enum": [
              "Sanmar"
            ],
            "description": "The product supplier."
          },
          "sku": {
            "type": "string",
            "enum": [
              "312033"
            ],
            "description": "The sku code of the product"
          },
          "vendor_sku": {
            "type": "string",
            "enum": [
              "312033"
            ],
            "description": "The vendor's sku code"
          },
          "dn_sku_id": {
            "type": "string",
            "enum": [
              "19617_1378"
            ],
            "description": "The unique DecoNetwork identifier for the sku"
          },
          "dn_vsku_id": {
            "type": "string",
            "enum": [
              "1064_1378"
            ],
            "description": "The unique DecoNetwork identifier for the vendor sku"
          },
          "product_size": {
            "type": "object",
            "properties": {
              "option_id": {
                "type": "number",
                "enum": [
                  2
                ],
                "description": "The id of the product size option"
              },
              "name": {
                "type": "string",
                "enum": [
                  "Medium"
                ],
                "description": "The option label"
              },
              "code": {
                "type": "string",
                "enum": [
                  "M"
                ],
                "description": "The option value"
              },
              "sub_sizes": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": false
                },
                "description": "The chosen sub sizes if the size has sub options"
              }
            },
            "required": [
              "option_id",
              "name",
              "code",
              "sub_sizes"
            ],
            "additionalProperties": false,
            "description": "The blank products's size"
          },
          "product_color": {
            "type": "object",
            "properties": {
              "id": {
                "type": "number",
                "enum": [
                  35345
                ],
                "description": "The id of the product color"
              },
              "name": {
                "type": "string",
                "enum": [
                  "White"
                ],
                "description": "The name of the product Color"
              }
            },
            "required": [
              "id",
              "name"
            ],
            "additionalProperties": false,
            "description": "The blank products's color"
          },
          "inv_on": {
            "type": "boolean",
            "enum": [
              true
            ],
            "description": "True if inventory tracking is on for this sku."
          },
          "inv_lvl": {
            "type": "number",
            "enum": [
              3
            ],
            "description": "The inventory on hand amount."
          },
          "inv_warn": {
            "type": "number",
            "enum": [
              2
            ],
            "description": "The inventory low stock waning amount."
          },
          "inv_reorder_to": {
            "type": "number",
            "enum": [
              3
            ],
            "description": "The inventory reorder to level amount."
          },
          "inv_on_order_po": {
            "type": "number",
            "enum": [
              4
            ],
            "description": "The amount of inventory that is currently on order via purchase orders to be allocated to orders."
          },
          "inv_on_order_stk": {
            "type": "number",
            "enum": [
              1
            ],
            "description": "The amount of inventory that is currently on order via purchase orders to be allocated to stock."
          },
          "inv_on_order_total": {
            "type": "number",
            "enum": [
              5
            ],
            "description": "The total amount of inventory that is currently on order via purchase orders for this sku."
          },
          "inv_last_modified": {
            "type": "string",
            "enum": [
              "2018-10-01T00:00:00"
            ],
            "description": "The date (ISO-8601 date format) the inventory was last modified."
          }
        },
        "required": [
          "product_id",
          "product_code",
          "product_name",
          "supplier",
          "sku",
          "vendor_sku",
          "dn_sku_id",
          "dn_vsku_id",
          "product_size",
          "product_color",
          "inv_on",
          "inv_lvl",
          "inv_warn",
          "inv_reorder_to",
          "inv_on_order_po",
          "inv_on_order_stk",
          "inv_on_order_total",
          "inv_last_modified"
        ],
        "additionalProperties": false
      },
      "description": "An array of inventory objects"
    },
    "total": {
      "type": "number",
      "description": "The total number of inventory objects found."
    }
  },
  "required": [
    "response_status",
    "inventories"
  ]
}

Inventory Search
GET/api/json/manage_inventory/find

Retrieve a list of sku based inventory rows based upon your search parameters.
The maximum number of rows returned is 100. Use the returned “total” value to determine if you need to paginate using the offset parameter.
You can specify multiple conditions in which case the conditions will be join with a logical ‘AND’.
To use multiple conditions you will need to pass the parameters using the multi condition parameter format:
conditions[n][parameter name] where n starts at 1 and “parameter name” is the name of the parameter as below.

URI Parameters
HideShow
field
number (required) Example: 1

The Field the condition is tested against.
Multi condition parameter format: conditions[n][field]

Choices: 1: Product Code 2: Product Name 3: Supplier 4: Product Id 5: Date Modified

condition
number (required) Example: 1

The logical test to use.
Multi condition parameter name: conditions[n][condition]

Choices: 1: == 2: != 3: < 4: > 5: <= 6: >= 7: Between

date1
date (optional) Example: 2016-03-28T22:01:46

The date to test against (Required when field is Date Modified).
The date is in ISO-8601 date format in UTC timezone (YYYY-MM-DDTHH:MM:SS).
Multi condition parameter name: conditions[n][date1]

date2
date (optional) Example: 2016-03-28T22:01:46

The end date to test against (Required when field is Date Modified and condition is 7: Between).
The date is in ISO-8601 date format in UTC timezone (YYYY-MM-DDTHH:MM:SS).
Multi condition parameter name: conditions[n][date2]

string
string (optional) Example: 2000

The string to test against (Required when field is Product Code, Product Name, Supplier, or Product Id).
Multi condition parameter name: conditions[n][string]

limit
number (optional) Default: 100 Example: 100

Limit the number of results returned. The maximum limit is 100.

offset
number (optional) Default: 0 Example: 0

Offset of the results to allow pagination.

sortby
number (optional) Default: 1 Example: 1

What field to sort the results by.

Choices: 1: Product Code 2: Product Name 5: Date Modified

username
string (required) Example: fred123

The username of the account to use when connecting to the API.

password
string (required) Example: password123

The password of the account to use when connecting to the API.


Update Inventory

POST /api/json/manage_inventory/update
RequestsUpdate the inventory amounts for a particular sku
Headers
Content-Type: application/x-www-form-urlencoded
Body
dn_sku_id=19617_1378
inv_on=true
inv_lvl=10
inv_warn=2
inv_reorder_to=5
operator_login=bob123
username=fred123
password=password123
Responses200
Headers
Content-Type: application/json
Body
{
  "response_status": {
    "code": 10001,
    "severity": "SUCCESS",
    "description": "."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "response_status": {
      "type": "object",
      "properties": {
        "code": {
          "type": "number",
          "description": "the status code."
        },
        "severity": {
          "type": "string",
          "description": "either SUCCESS or ERROR"
        },
        "description": {
          "type": "string",
          "description": "A description of the error. Blank when SUCCESS."
        }
      },
      "required": [
        "code"
      ]
    }
  },
  "required": [
    "response_status"
  ]
}

Update Inventory
POST/api/json/manage_inventory/update

Update the inventory amounts and turn inventory tracking on or off for an individual sku.
Multiple skus can be specified in one request using the “multi change format”:
changes[n][parameter name] where “n” starts at 1, and “parameter name” is the name of the parameter as below.

URI Parameters
HideShow
dn_sku_id
string (required) Example: 19617_1378

The unique sku identifier.
Multi change parameter format: changes[n][dn_sku_id]

inv_on
boolean (required) Example: true

Turn inventory tracking on or off for the sku.
Multi change parameter format: changes[n][inv_on]

inv_lvl
number (optional) Example: 5

The inventory on hand amount for the sku.
Multi change parameter format: changes[n][inv_lvl]

inv_warn
number (optional) Example: 5

The inventory low stock warning amount for the sku.
Multi change parameter format: changes[n][inv_warn]

inv_reorder_to
number (optional) Example: 5

The inventory reorder to amount for the sku.
Multi change parameter format: changes[n][inv_reorder_to]

operator_id
number (optional) Example: 12332423

The id of the operator making the change. If not specified, the operator with the username/password sent will be used.
Multi change parameter format: changes[n][operator_id]

operator_login
string (optional) Example: bob123

The login of the operator making the change. Can be used if the id of the operator is unknown.
Multi change parameter format: changes[n][operator_login]

username
string (required) Example: fred123

The username of the account to use when connecting to the API.

password
string (required) Example: password123

The password of the account to use when connecting to the API.


Generated by aglio on 13 Dec 2018