Back to Aligni.com

GET /api/v2/:api_token/inventory_units/search
Search inventory units.


GET /api/v2/:api_token/parts/:part_id/inventory_units/:id
Show an inventory unit.

Retrieve one particular inventory unit.

Examples

# request
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/728/inventory_units/52

# response
<inventory_unit>
  <id>52</id>
  <quantity>3600</quantity>
  <quantity_available>3600</quantity_available>
  <unit>each</unit>
  <cost_per_unit>0.009</cost_per_unit>
  <currency>USD</currency>
  <inventory_location>CDHQ - General Storage</inventory_location>
  <sublocation_bin/>
  <asset_id>A0000000</asset_id>
  <serial_number></serial_number>
  <lot_code>XKG982MAL</lot_code>
  <datecode>201019</datecode>
  <details/>
  <purchase_order_number/>
  <purchase_quantity/>
  <purchase_price/>
  <vendor/>
  <created_at>2013-11-14T10:34:00+00:00</created_at>
  <updated_at>2014-03-13T06:39:00+00:00</updated_at>
</inventory_unit>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Inventory unit ID.


Value: Must be a Integer
part_id
required

ID of the part to which the inventory unit belongs.


Value: Must be a Integer

PUT /api/v2/:api_token/parts/:part_id/inventory_units/:id
Update an inventory unit.

Update an inventory unit.

Examples

# request
curl -X PUT -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<inventory_unit>
  <cost_per_unit>100</cost_per_unit>
  <serial_number>IU-42</serial_number>
  <lot_code>LC-223</lot_code>
  <datecode>DC-002</datecode>
</inventory_unit>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/728/inventory_units/52

# response
<inventory_unit>
  <id>52</id>
  <quantity>100</quantity>
  <quantity_available>100</quantity_available>
  <unit>each</unit>
  <cost_per_unit>0.009</cost_per_unit>
  <currency>USD</currency>
  <inventory_location>CDHQ - General Storage</inventory_location>
  <sublocation_bin/>
  <asset_id>A0000000</asset_id>
  <serial_number></serial_number>
  <lot_code>XKG982MAL</lot_code>
  <datecode>201019</datecode>
  <details/>
  <purchase_order_number/>
  <purchase_quantity/>
  <purchase_price/>
  <vendor/>
  <created_at>2013-11-14T10:34:00+00:00</created_at>
  <updated_at>2014-03-13T06:39:00+00:00</updated_at>
</inventory_unit>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Inventory unit ID.


Value: Must be a Integer
part_id
required

ID of the part to which the inventory unit belongs.


Value: Must be a Integer
inventory_unit
required

Value: Must be a Hash
inventory_unit[cost_per_unit]
optional

Cost per unit.


Value: Must be a number.
inventory_unit[serial_number]
optional

Serial number.


Value: Must be a String
inventory_unit[lot_code]
optional

Lot code.


Value: Must be a String
inventory_unit[datecode]
optional

Datecode.


Value: Must be a String
inventory_unit[details]
optional

Details


Value: Must be a String
inventory_unit[purchase_order_number]
optional

PO #


Value: Must be a String

PUT /api/v2/:api_token/parts/:part_id/inventory_units/:id/adjust_quantity
Adjust an inventory unit.

Adjust an inventory unit quantity.

Examples

# request
curl -X PUT -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<inventory_unit>
  <quantity>100</quantity>
  <inventory_record>
    <comment>Transfered from Albany.</comment>
  </inventory_record>
</inventory_unit>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/728/inventory_units/52/adjust_quantity

# response
<inventory_unit>
  <id>52</id>
  <quantity>100</quantity>
  <quantity_available>100</quantity_available>
  <unit>each</unit>
  <cost_per_unit>0.009</cost_per_unit>
  <currency>USD</currency>
  <inventory_location>CDHQ - General Storage</inventory_location>
  <sublocation_bin/>
  <asset_id>A0000000</asset_id>
  <serial_number></serial_number>
  <lot_code>XKG982MAL</lot_code>
  <datecode>201019</datecode>
  <details/>
  <purchase_order_number/>
  <purchase_quantity/>
  <purchase_price/>
  <vendor/>
  <created_at>2013-11-14T10:34:00+00:00</created_at>
  <updated_at>2014-03-13T06:39:00+00:00</updated_at>
</inventory_unit>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Inventory unit ID.


Value: Must be a Integer
part_id
required

ID of the part to which the inventory unit belongs.


Value: Must be a Integer
inventory_unit
required

Value: Must be a Hash
inventory_unit[quantity]
required

New quantity of the inventory unit.


Value: Must be a number.
inventory_unit[inventory_record]
optional

Value: Must be a Hash
inventory_unit[inventory_record][comment]
optional

Each adjustment will be logged. The comment will accompany the log entry.


Value: Must be a String
inventory_unit[inventory_record][adjustment_type]
optional

This parameter can be used to mark the inventory as consumed. The default value of the parameter is 'Adjust'.


Value: Must be one of: <code>adjust</code>, <code>consume</code>.

POST /api/v2/:api_token/parts/:part_id/inventory_units
Create an inventory unit.

Create a part inventory unit.

Examples

# request
curl -X POST -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<inventory_unit>
  <inventory_sublocation_id>3</inventory_sublocation_id>
  <unit_id>2</unit_id>
  <quantity>10</quantity>
  <cost_per_unit>14</cost_per_unit>
  <datecode>022016</datecode>
  <lot_code>AB-LOT-CODE</lot_code>
  <sublocation_bin>Bottom Shelf</sublocation_bin>
  <generate_asset_id>true</generate_asset_id>
  <inventory_record>
    <comment>December shipment</comment>
  </inventory_record>
</inventory_unit>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/728/inventory_units

# response
<inventory_unit>
  <id>145</id>
  <quantity>10</quantity>
  <quantity_available>10</quantity_available>
  <unit>each</unit>
  <cost_per_unit>14.0</cost_per_unit>
  <currency>USD</currency>
  <inventory_location>CDHQ - Bin 14</inventory_location>
  <sublocation_bin>Bottom Shelf</sublocation_bin>
  <asset_id>A0000004</asset_id>
  <serial_number/>
  <lot_code>AB-LOT-CODE</lot_code>
  <datecode>022016</datecode>
  <details/>
  <purchase_order_number/>
  <purchase_quantity/>
  <purchase_price/>
  <vendor/>
  <created_at>2016-12-07T12:47:09-08:00</created_at>
  <updated_at>2016-12-07T12:47:09-08:00</updated_at>
</inventory_unit>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
part_id
required

ID of the part we creating an inventory unit for.


Value: Must be a Integer
inventory_unit
required

Value: Must be a Hash
inventory_unit[inventory_sublocation_id]
required

Inventory sublocation ID


Value: Must be a Integer
inventory_unit[unit_id]
required

Unit ID


Value: Must be a Integer
inventory_unit[quantity]
required

Quantity


Value: Must be a number.
inventory_unit[cost_per_unit]
optional

Cost per unit


Value: Must be a number.
inventory_unit[asset_id]
optional

Asset ID


Value: Must be a String
inventory_unit[serial_number]
optional

Serial number


Value: Must be a String
inventory_unit[datecode]
optional

Datecode


Value: Must be a String
inventory_unit[lot_code]
optional

Lot code


Value: Must be a String
inventory_unit[sublocation_bin]
optional

Sublocation bin


Value: Must be a String
inventory_unit[details]
optional

Details


Value: Must be a String
inventory_unit[purchase_order_number]
optional

PO #


Value: Must be a String
inventory_unit[generate_asset_id]
optional

Generate Asset ID if set to 'true'.


Value: Must be a String
inventory_unit[inventory_record]
optional

Value: Must be a Hash
inventory_unit[inventory_record][comment]
optional

The new inventory will be logged. The comment will accompany the log entry.


Value: Must be a String

PUT /api/v2/:api_token/parts/:part_id/inventory_units/:id/move
Move an inventory unit.

Move an inventory unit to another inventory sublocation.

Examples

# request
curl -X PUT -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<inventory_unit>
  <inventory_sublocation_id>3</inventory_sublocation_id>
  <sublocation_bin>Top Shelf</sublocation_bin>
  <inventory_record>
    <comment>Moving to a new storage.</comment>
  </inventory_record>
</inventory_unit>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/728/inventory_units/104/move

# response
<inventory_unit>
  <id>104</id>
  <quantity>1247</quantity>
  <quantity_available>1247</quantity_available>
  <unit>each</unit>
  <cost_per_unit>0.009</cost_per_unit>
  <currency>USD</currency>
  <inventory_location>CDHQ - Bin 14</inventory_location>
  <sublocation_bin>Top Shelf</sublocation_bin>
  <asset_id></asset_id>
  <serial_number/>
  <lot_code></lot_code>
  <datecode></datecode>
  <details/>
  <purchase_order_number/>
  <purchase_quantity/>
  <purchase_price/>
  <vendor/>
  <created_at>2016-12-07T12:47:09-08:00</created_at>
  <updated_at>2016-12-07T12:47:09-08:00</updated_at>
</inventory_unit>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Inventory unit ID.


Value: Must be a Integer
part_id
required

ID of the part to which the inventory unit belongs.


Value: Must be a Integer
inventory_unit
required

Value: Must be a Hash
inventory_unit[inventory_sublocation_id]
required

Inventory sublocation ID


Value: Must be a Integer
inventory_unit[sublocation_bin]
optional

Sublocation bin


Value: Must be a String
inventory_unit[inventory_record]
optional

Value: Must be a Hash
inventory_unit[inventory_record][comment]
optional

The movement will be logged. The following will accompany the log entry.


Value: Must be a String

POST /api/v2/:api_token/parts/:part_id/inventory_units/:id/split
Split an inventory unit.

Split an inventory unit. Returns both the original inventory unit and the new inventory unit.

Errors

422 Quantity must be a positive number.
422 Quantity can't be greater than the quantity available.
422 Quantity must be less than the quantity available.
422 A new Asset ID is required.
422 Asset ID must be unique.

Examples

# request
curl -X POST -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d "
<inventory_unit>
  <inventory_sublocation_id>3</inventory_sublocation_id>
  <quantity>75</quantity>
  <asset_id>B000001</asset_id>
  <sublocation_bin>Top Shelf</sublocation_bin>
  <inventory_record>
    <comment>Splitting...</comment>
  </inventory_record>
</inventory_unit>" \
https://demo.aligni.com/api/v2/oid3vLgynoy_Yl1gZkrgkLEq3J/parts/728/inventory_units/104/split

# response
<inventory_units>
  <inventory_unit>
    <id>104</id>
    <quantity>1200</quantity>
    <quantity_available>1200</quantity_available>
    <unit>each</unit>
    <cost_per_unit/>
    <currency>USD</currency>
    <inventory_location>FUN - Bin 34A</inventory_location>
    <sublocation_bin/>
    <asset_id></asset_id>
    <serial_number></serial_number>
    <lot_code></lot_code>
    <datecode></datecode>
    <details/>
    <purchase_order_number/>
    <purchase_quantity/>
    <purchase_price/>
    <vendor/>
    <created_at>2016-12-13T02:58:14-08:00</created_at>
    <updated_at>2016-12-14T05:24:48-08:00</updated_at>
  </inventory_unit>
  <inventory_unit>
    <id>160</id>
    <quantity>75</quantity>
    <quantity_available>75</quantity_available>
    <unit>each</unit>
    <cost_per_unit/>
    <currency>USD</currency>
    <inventory_location>CDHQ - Bin 14 - Top Shelf</inventory_location>
    <sublocation_bin>Top Shelf</sublocation_bin>
    <asset_id>B000001</asset_id>
    <serial_number/>
    <lot_code></lot_code>
    <datecode></datecode>
    <details/>
    <purchase_order_number/>
    <purchase_quantity/>
    <purchase_price/>
    <vendor/>
    <created_at>2016-12-13T02:58:14-08:00</created_at>
    <updated_at>2016-12-14T14:24:49+01:00</updated_at>
  </inventory_unit>
</inventory_units>

Params

Param name Description
api_token
required

Your API token.


Value: Must be a String
id
required

Inventory unit ID.


Value: Must be a Integer
part_id
required

ID of the part to which the inventory unit belongs.


Value: Must be a Integer
inventory_unit
required

Value: Must be a Hash
inventory_unit[inventory_sublocation_id]
required

Inventory sublocation ID


Value: Must be a Integer
inventory_unit[quantity]
required

Quantity. Must be a positive number less than the quantity available.


Value: Must be a number.
inventory_unit[asset_id]
optional

Asset ID


Value: Must be a String
inventory_unit[sublocation_bin]
optional

Sublocation bin


Value: Must be a String
inventory_unit[generate_asset_id]
optional

Generate Asset ID if set to 'true'.


Value: Must be a String
inventory_unit[inventory_record]
optional

Value: Must be a Hash
inventory_unit[inventory_record][comment]
optional

The split will be logged. The following will accompany the log entry.


Value: Must be a String