Back to Aligni.com

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