This is an old revision of the document!


UpdateInventoryRq (Request)

The UpdateInventoryRq request allows users to update quantity-on-hand information for items in the Fortune3 database. It can be used to update a single item's inventory or multiple items at the same time within 1 request.

Updating Inventory

In order to update an item's inventory you will need to provide a SKU (so the system knows which item to update), and a Qty tag for each item. The SKU must already exist in the store's product database and exactly match the string being sent for the SKU in order for the update to succeed. Proceed as Follows:

Sample Code (updating inventory for a single item):

<sendRequestXML>
<authenticate>
<APIUsername>TWmY6WBft</APIUsername>
<APIPassword>SKW8ssAmDu6xTGDl</APIPassword>
</authenticate>
<UpdateInventoryRq RequestID="1">
        <Item>
		<SKU>ABC123</SKU>
		<QTY>14</QTY>
	</Item>
</UpdateInventoryRq>
</sendRequestXML>

Multiple Updates within 1 Request

In order to send multiple inventory updates within the same request, simply repeat the <Item> node for every item you want to update, as the following sample code shows:

<sendRequestXML>
<authenticate>
<APIUsername>TWmY6WBft</APIUsername>
<APIPassword>SKW8ssAmDu6xTGDl</APIPassword>
</authenticate>
<UpdateInventoryRq RequestID="1">
        <Item>
		<SKU>ABC123</SKU>
		<QTY>14</QTY>
	</Item>
        <Item>
		<SKU>XYZ7</SKU>
		<QTY>29</QTY>
	</Item>
</UpdateInventoryRq>
</sendRequestXML>

The "Operation" Tag

The “Operation” XML tag allows users to adjust an item's inventory quantity instead of replacing it. By using the Operation tag, you can request the API to Increase or Decrease the Quantity-On-Hand for an item, rather than replacing the value, as the following sample code shows:

<sendRequestXML>
<authenticate>
<APIUsername>TWmY6WBft</APIUsername>
<APIPassword>SKW8ssAmDu6xTGDl</APIPassword>
</authenticate>
<UpdateInventoryRq RequestID="1">
        <Item>
		<SKU>ABC123</SKU>
		<QTY>8</QTY>
		<Operation>increase</Operation>
	</Item>
        <Item>
		<SKU>XYZ7</SKU>
		<QTY>3</QTY>
		<Operation>decrease</Operation>
	</Item>
</UpdateInventoryRq>
</sendRequestXML>

Please note that if you do not send an “Operation” tag, the quantity will simply be replaced for the new quantity.

Tag Name Sub-Tag Of Description Field Type Is Required
Item UpdateInventoryRq Each Item's Node Node True
SKU Item The SKU of the item to update the inventory for. Must match existing SKU in store. String True
QTY Item The New Qty or Adjustment Qty for the item Integer True
Operation Item Specifies the type of operation being performed String
Allowed Values:
“replace”
“increase”
“decrease”
Default: replace
False - “replace” used if not provided

Next: Reading the Response (UpdateInventoryRs)

Print/export