Back to Aligni.com

Note: This API endpoint is presently in BETA and subject to change.

The search does an 'OR' match and is case insensitive.

Supports specifying multiple search params through indexes. The indexes must be specified in order (0, 1, 2…). Skipping an index will result in later search params being ignored. For example, if three search params are to be combined, there would be three fields 'field0', 'field1', and 'field2' required.

Deprecation Warning

Using bin is deprecated, please use sublocation_bin instead.

Examples

# Standard request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/inventory_units/search?field0=sublocation_bin&comparison0=contains&term0=shelf

# Paginated request
# The pagination information is included in the response X-Pagination header.
# {
#   "total_entries": 8,
#   "total_pages": 4,
#   "per_page": 2,
#   "current_page": 1,
#   "first_page": true,
#   "last_page": false,
#   "previous_page": null,
#   "next_page": 2,
#   "out_of_range": false
# }
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' -v \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/inventory_units/search?field0=sublocation_bin&comparison0=contains&term0=shelf&field1=sublocation_bin&comparison1=contains&term1=Box&page=1&per_page=2

# Request with defaults
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' -v \
http://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/inventory_units/search?term0=shelf&term1=Box

# Example of a Sucess Response
<?xml version="1.0" encoding="UTF-8"?>
<inventory_units>
  <inventory_unit>
    <id>214</id>
    <part_id>754</part_id>
    <inventory_sublocation_id>2</inventory_sublocation_id>
    <unit_id>2</unit_id>
    <sublocation_bin>Top Shelf</sublocation_bin>
    <bin>Top Shelf</bin>
    <quantity>0.10</quantity>
    <quantity_available>0.10</quantity_available>
    <cost_per_unit>12.0</cost_per_unit>
    <currency>USD</currency>
    <asset_id/>
    <serial_number/>
    <lot_code/>
    <datecode/>
    <details/>
    <purchase_order_number>1022</purchase_order_number>
    <created_at>2018-04-04T08:49:09-05:00</created_at>
    <updated_at>2018-04-04T08:57:20-05:00</updated_at>
  </inventory_unit>
  <inventory_unit>
    <id>162</id>
    <part_id>768</part_id>
    <inventory_sublocation_id>15</inventory_sublocation_id>
    <unit_id>2</unit_id>
    <sublocation_bin>Box</sublocation_bin>
    <bin>Box</bin>
    <quantity>1.00</quantity>
    <quantity_available>1.00</quantity_available>
    <cost_per_unit>159.55</cost_per_unit>
    <currency>USD</currency>
    <asset_id>A0000000</asset_id>
    <serial_number>000001</serial_number>
    <lot_code>XKG982MAL</lot_code>
    <datecode>20180401</datecode>
    <details/>
    <purchase_order_number/>
    <created_at>2017-11-10T18:34:43-05:00</created_at>
    <updated_at>2018-04-10T16:10:02-05:00</updated_at>
  </inventory_unit>
</inventory_units>

# Error Responses
If there are any invalid search params, the search is not performed and
the invalid search params are listed in an error response:
"<?xml version="1.0"?>
<search_params type="array">
  <search_param>
    <index>0</index>
    <errors type="array">
      <error>Invalid comparison.</error>
    </errors>
  </search_param>
  <search_param>
    <index>2</index>
    <errors type="array">
      <error>Invalid field.</error>
    </errors>
  </search_param>
</search_params>"

Providing no search params also results in an error response:
<?xml version="1.0"?>
<errors type="array">
  <error>No search params specified.</error>
</errors>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
fieldN
required

Search field. Currently, only the 'sublocation_bin' is supported as the search field. Defaults to 'sublocation_bin'.


Value: Must be a String
comparisonN
required

Search comparison. Currently, only the 'contains' is supported as the search comparison. Defaults to 'contains'.


Value: Must be a String
termN
required

Search term. Currently, only the bin name is supported as the search term.


Value: Must be a String
page
optional

Fetch requested page.


Value: Must be a String
per_page
optional

Fetch a specific number of entries per page.


Value: Must be a String