Download Item

Create download item records for files you want customers to purchase and download in your Web store. Customers are charged per download item as opposed to per item. For example, if you want to charge customers for music downloads per song, you would create a download item record for each song. If you want to charge customers per album, you would create one download item record and attach each song on the album to the record.

In SOAP web services, the download item record is defined in the listAcct (accounting) XSD.

Important:

The download item record type is not accessible until the Sell Download Files feature is enabled in your account. In SOAP web services an error is thrown if you attempt create, update, delete or search for a Download Item without first enabling the Sell Download Files feature. To enable this feature, a NetSuite administrator can go to Setup > Company > Enable Features and select the Items & Inventory subtab, select the Sell Downloadable Files check box and click Save.

For general information on the download item record, see these topics in the NetSuite Help Center:

Supported Operations

add | addList | delete | deleteList | get | getList | getSavedSearch | getSelectValue | search | searchMoreWithId | update | updateList | upsert | upsertList

Note:

You can also use the asynchronous equivalents of SOAP web services list operations. For information about asynchronous operations, see SOAP Web Services Asynchronous Operations. For more information about request processing, see Synchronous Versus Asynchronous Request Processing.

Field Definitions

The SOAP Schema Browser includes definitions for all body fields, sublist fields, search filters, and search joins available to this record. For details, see the SOAP Schema Browser’s download item reference page.

Note:

For information on using the SOAP Schema Browser, see SOAP Schema Browser.

Usage Notes

Please note the following when working with the download items record:

Note:

You can create both the download item record and file record in one step using the addList operation. However, to attach any file to the download item record, you will still need to call the attach operation.

Sample Code

C#

            NetSuiteService nss = new NetSuiteService();
 
         ItemSearchAdvanced itemSearchAdv = new ItemSearchAdvanced();
 
         // Create search criteria
         ItemSearch itemSearch = new ItemSearch();
         ItemSearchBasic itemSearchBasic = new ItemSearchBasic();
 
         // Set item search type to downloadItem
         SearchEnumMultiSelectField itemTypeFld = new SearchEnumMultiSelectField();
         String [] itemTypes = new String[1];
         itemTypes[0] = "_downloadItem";
         itemTypeFld.searchValue = itemTypes;
         itemTypeFld.operatorSpecified = true;
         itemTypeFld.@operator = SearchEnumMultiSelectFieldOperator.anyOf;
         itemSearchBasic.type = itemTypeFld;
 
         // Select search return columns
         ItemSearchRow itemRow = new ItemSearchRow();
 
         // Select to return file internal id
         FileSearchRowBasic fileRowBasic = new FileSearchRowBasic();
 
         SearchColumnSelectField [] selectColumns = new SearchColumnSelectField[1];
         SearchColumnSelectField selectColumn = new SearchColumnSelectField();
         selectColumns[0] = selectColumn;
         fileRowBasic.internalId = selectColumns;
 
         // Select to return file name
         SearchColumnStringField [] stringColumns = new SearchColumnStringField[1];
         SearchColumnStringField stringColumn = new SearchColumnStringField();
         stringColumns[0] = stringColumn;
         fileRowBasic.name = stringColumns;
 
         // Set file join
         itemRow.fileJoin = fileRowBasic;
         
         // Select to return item internalId
         ItemSearchRowBasic itemRowBasic = new ItemSearchRowBasic();
         itemRowBasic.internalId = selectColumns; // column definition can be reused
         itemRow.basic = itemRowBasic;
 
         // Set item search criteria
         itemSearch.basic = itemSearchBasic;
         itemSearchAdv.criteria = itemSearch;
 
         // Set item return columns
         itemSearchAdv.columns = itemRow;
 
         // Perform search
         SearchResult searchResult = nss.search(itemSearchAdv); 

        

SOAP Request

                   <search xmlns="urn:messages_2017_1.platform.webservices.netsuite.com">
            <searchRecord xmlns:q1="urn:accounting_2017_1.lists.webservices.netsuite.com" xsi:type="q1:ItemSearchAdvanced">
               <q1:criteria>
                  <q1:basic>
                     <type operator="anyOf" xmlns="urn:common_2017_1.platform.webservices.netsuite.com">
                        <searchValue xmlns="urn:core_2017_1.platform.webservices.netsuite.com">_downloadItem</searchValue>
                     </type>
                  </q1:basic>
               </q1:criteria>
               <q1:columns>
                  <q1:basic>
                     <internalId xmlns="urn:common_2017_1.platform.webservices.netsuite.com" />
                  </q1:basic>
                  <q1:fileJoin>
                     <internalId xmlns="urn:common_2017_1.platform.webservices.netsuite.com" />
                     <name xmlns="urn:common_2017_1.platform.webservices.netsuite.com" />
                  </q1:fileJoin>
               </q1:columns>
            </searchRecord>
         </search> 

        

SOAP Response

                         <platformCore:searchRowList>
                  <platformCore:searchRow xsi:type="listAcct:ItemSearchRow" xmlns:listAcct="urn:accounting_2017_1.lists.webservices.netsuite.com">
                     <listAcct:basic xmlns:platformCommon="urn:common_2017_1.platform.webservices.netsuite.com">
                        <platformCommon:internalId>
                           <platformCore:searchValue internalId="105"/>
                        </platformCommon:internalId>
                     </listAcct:basic>
                     <listAcct:fileJoin xmlns:platformCommon="urn:common_2017_1.platform.webservices.netsuite.com">
                        <platformCommon:internalId>
                           <platformCore:searchValue internalId="239"/>
                        </platformCommon:internalId>
                        <platformCommon:name>
                           <platformCore:searchValue>IDreamedADreamLyrics.txt</platformCore:searchValue>
                        </platformCommon:name>
                     </listAcct:fileJoin>
                  </platformCore:searchRow>
               </platformCore:searchRowList> 

        

Related Topics

General Notices