Back to Aligni.com

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