getItemAvailability

The getItemAvailability operation can be used to retrieve the inventory availability for a specific list of items.

You can filter the returned list using a lastQtyAvailableChange filter. If set, only items with quantity available changes recorded as of this date are returned.

If the Multi-Location Inventory feature is enabled, this operation returns results for all locations. For locations that do not have any items available, only location IDs and names are listed in results.

Warning:

This operation supports up to 10,000 records. If this limit is exceeded, an error is returned.

Request

The GetItemAvailabilityRequest type is used for the request.

Element Name

XSD Type

Notes

itemAvailabilityFilter

ItemAvailabilityFilter

You can filter the returned itemAvailability using this filter.

ItemAvailabilityFilter

Element Name

XSD Type

Notes

item

RecordRefList

References an exiting item record in NetSuite.

lastQtyAvailableChange

dateTime

If set, only items with quantity available changes recorded as of the specified date are returned.

Response

The GetItemAvailabilityResult type is used for the response.

Element Name

XSD Type

Notes

status

Status

The status for this operation. All applicable errors or warnings are listed within this type.

itemAvailabilityList

List

Returns a list of available items.

ItemAvailabilityList

Element Name

XSD Type

Notes

item

RecordRef

References an existing item record.

lastQtyAvailableChange

dateTime

If set, only items with quantity available changes recorded as of this date are returned.

locationId

RecordRef

References a location in a user defined list at Lists > Accounting > Locations.

quantityOnHand

double

The number of units of an item in stock.

onHandValueMli

double

 

reorderPoint

double

The stock level at which a new order for the item needs to be placed

preferredStockLevel

double

The preferred quantity of this item maintained in inventory for a specific location.

quantityOnOrder

double

The number of units of an item pending receipt from a vendor.

quantityCommitted

double

The number of units of an item reserved by unfulfilled sales orders.

quantityBackOrdered

double

The number of units of an item reserved by unfulfilled sales orders.

quantityAvailable

double

The number of units in stock that have not been committed to fulfill sales.

ItemAvailabilityFilter

Element Name

XSD Type

Notes

item

RecordRefList

 

lastQtyAvailableChange

dateTime

 

Faults

This operation can throw one of the following faults. See SOAP Fault Status Codes for more information on faults.

Sample Code

SOAP Request (for C# sample)

          <soap:Body>
<platformMsgs:getItemAvailability>
   <platformMsgs:itemAvailabilityFilter>
      <platformCore:item>
         <platformCore:recordRef internalId="390" type="inventoryItem">
            <platformCore:name/>
         </platformCore:recordRef>
      </platformCore:item>
      <platformCore:lastQtyAvailableChange/>
   </platformMsgs:itemAvailabilityFilter>
</platformMsgs:getItemAvailability>
</soap:Body> 

        

SOAP Response (for C# sample)

          <soapenv:Body>
<getItemAvailabilityResponse xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
   <getItemAvailabilityResult 
      xmlns="urn:core_2017_1.platform.webservices.netsuite.com">
      <status isSuccess="true"/>
      <itemAvailabilityList>
         <itemAvailability>
            <item internalId="390" type="inventoryItem">
               <name>testItem</name>
            </item>
            <locationId internalId="1" type="location">
               <name>East Coast</name>
            </locationId>
            <quantityOnHand>20.0</quantityOnHand>
            <onHandValueMli>0.0</onHandValueMli>
            <quantityCommitted>0.0</quantityCommitted>
            <quantityAvailable>20.0</quantityAvailable>
         </itemAvailability>
         <itemAvailability>
            <item internalId="390" type="inventoryItem">
               <name>testItem</name>
            </item>
            <locationId internalId="2" type="location">
               <name>West Coast</name>
            </locationId>
         </itemAvailability>
      </itemAvailabilityList>
   </getItemAvailabilityResult>
</getItemAvailabilityResponse>
</soapenv:Body> 

        

C# Sample

          private void getItemAvailability()
        {
            this.login(true);
 
            RecordRef item1 = new RecordRef();
            item1.internalId = "59";
            item1.type = RecordType.inventoryItem;
            item1.typeSpecified = true;
 
            RecordRef[] recordrefs = new RecordRef[1];
            recordrefs[0] = item1;
 
            ItemAvailabilityFilter filter = new ItemAvailabilityFilter();
            filter.item = recordrefs;
            GetItemAvailabilityResult res = _service.getItemAvailability(filter);
                    
        } 

        

Java Sample

          public void getItemAvailability() throws RemoteException {
                this.login(true);
                
                RecordRef item1 = new RecordRef();
                item1.setInternalId("25");
                item1.setType(RecordType.inventoryItem);
                
                RecordRef item2 = new RecordRef();
                item2.setInternalId("76");
                item2.setType(RecordType.giftCertificateItem);
                
                RecordRef[] recordRefArray = new RecordRef[2];
                recordRefArray[0] = item1;
                recordRefArray[1] = item2;
                
                RecordRefList itemRefList = new RecordRefList();
                itemRefList.setRecordRef(recordRefArray);
                
                ItemAvailabilityFilter itemAvailability = new ItemAvailabilityFilter();
                itemAvailability.setItem(itemRefList);
                
                GetItemAvailabilityResult response = _port.getItemAvailability(itemAvailability);
        } 

        

Related Topics

General Notices