Inventory Event Management API (1.0)

The Inventory Event Management API allows you to search for inventory events by id or date

Common Authorization Parameters

Each request is authorized using username and password fields passed either as query parameters (for GET/POST operations) or part of the application/x-www-form-urlencoded body (for POST operations).

Error Codes

Each response contains a response_status field containing the following error codes.

Code Severity Description
10001 SUCCESS
30001 ERROR Authentication failed
31000 ERROR API not enabled on your site
40004 WARNING Product ID Not Found
50002 ERROR No conditions specified
50003 ERROR Condition N 'field' is missing
50003 ERROR Condition N 'condition' is missing
50003 ERROR date1 is invalid
50003 ERROR date2 is invalid
50004 ERROR Invalid limit or offset
50005 ERROR Invalid request parameters

Inventory Event Search

Retrieve a list of inventory events 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 joined 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.

Request Body schema: application/x-www-form-urlencoded
field
required
integer

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

Values

  • 1: Date Created
  • 2: Inventory Id
condition
required
integer

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

Values

  • 1: ==
  • 2: !=
  • 3: <
  • 4: >
  • 5: <=
  • 6: >=
  • 7: Between
date1
string

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

date2
string

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

number1
number

The number to test against (Required when field is Inventory Id). *Multi condition parameter name: conditions[n][number1]

number2
number

The end number to test against (Required when field is Inventory Id). *Multi condition parameter name: conditions[n][number2]

limit
integer [ 0 .. 100 ]
Default: 100

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

offset
integer
Default: 0

Offset of the results to allow pagination

sortby
integer
Default: 1

What field to sort the results by
Values

  • 1: Date Created
  • 2: Inventory Id

Responses

Response Schema: application/json
object (ResponseStatus)
code
required
number

the status code

severity
required
string
Enum: "SUCCESS" "ERROR"

either SUCCESS or ERROR

description
string

A description of the error. Blank when SUCCESS

Array of objects (InventoryEvent)
Array
inventory_id
required
number

The inventory Id.

product_id
required
number

The product Id.

dn_sku_id
required
string

The unique DecoNetwork identifier for the sku.

change_type
required
number

The type of change causing the event.

Values

  • 1: initial_value
  • 2: allocated_to_order
  • 3: restocked_from_cancelled_order
  • 4: restocked_from_po
  • 5: manual_change
  • 6: import
  • 7: api_change
  • 8: unallocated_from_order
  • 9: waste_recorded
message
string

Message entered during manual adjustment.

workflow_item_id
required
number

The id of the workflow item

order_id
number

The invoice id of the order

po_line_id
required
number

The id of the purchase order line (will match PurchaseOrderLine.id from purchase order api).

po_number
string

The Purchase Order number (will match PurchaseOrder.po number from purchase order api).

old_qty
required
number

The inventory amount before the event.

new_qty
required
number

The inventory amount after the event.

object (User)
user_id
required
integer

Id of user

email
string

Email address of user

firstname
string

First name of user

lastname
string

Last name of user

country_code
string

2 letter country code

state
string

Name of state

city
string

Name of city

street
string

Name of street

postcode
string

zip/post code

company
string

Company name

company_id
integer

Id of company

salutation
string
ph_number
string

Phone number

Array of objects (CustomField)

An array of custom fields

Array
caption
required
string

The caption of the field

value
string

The value of the field

created_at
required
string

The date/time (ISO-8601 format, UTC timezone) the event occured.

total
integer

Request samples

Content type
application/x-www-form-urlencoded
field=1&condition=4&date1=2018-10-01T00%3A00%3A00

Response samples

Content type
application/json
{
  • "response_status": {
    • "code": 10001,
    • "severity": "SUCCESS",
    • "description": "string"
    },
  • "inventory_events": [
    • {
      • "product_id": 3453453,
      • "dn_sku_id": "13_691",
      • "created_at": "2022-01-19T03:34:18",
      • "change_type": 4,
      • "po_number": "172680",
      • "inventory_id": 2435345,
      • "po_line_id": 46756,
      • "old_qty": 0,
      • "new_qty": 1,
      • "user": {
        • "user_id": 113452,
        • "salutation": null,
        • "firstname": "David",
        • "lastname": "Smith",
        • "company_id": null,
        • "street": "1522 Junior Avenue",
        • "city": "San Francisco",
        • "state": "California",
        • "ph_number": "+1 518-555-0191",
        • "country_code": "US",
        • "postcode": "94103",
        • "email": "dsmith@testing.test",
        • "company": null
        }
      }
    ],
  • "total": 1
}