Download Item
A download item record exposes a download item to REST web services.
This record:
-
is not a subrecord
-
contains the following subrecords:
-
billingSchedule
-
class
-
deferredRevenueAccount
-
department
-
incomeAccount
-
itemType
-
location
-
outOfStockBehavior
-
revRecSchedule
-
siteMapPriority
-
storeDisplayImage
-
storeDisplayThumbnail
-
storeItemTemplate
-
subtype
-
taxSchedule
-
-
contains the following sublists:
-
itemOptions
-
presentationItem
-
price
-
siteCategory
-
The REST API Browser includes information about the field names and field types of the download item record, and about the HTTP methods, request parameters, and operations available to this record. For details, see the REST API Browser's DownloadItem reference page.
For information about using the REST API Browser, see The REST API Browser.
Record IDs
The record ID for a download item REST record is downloadItem.
Prerequisites
You must enable the Sell Download Files feature before you can use this record through REST web services. For more information, see Download Item.
For using all the fields on the record, the following features are required: Classes, Departments, Locations, Advanced Partner Access, Subsidiaries, Assembly Items, Matrix Items, Advanced Revenue Management (Essentials),Advanced Revenue Management (Revenue Allocation), Advanced Billing, Advanced Receiving, Advanced Shipping, Gross Profit, Accounting, Issue Management, Not SuiteTax, Multiple Prices, VAT without SuiteTax, Tax Inclusive Pricing, Advanced Pricing, Quantity Pricing, Advanced Revenue Recognition, Revenue Recognition, Revenue and Expense Management, VSOE, Amortization, Advanced Expense Management, Customer Support and Service, Advanced Taxes, Multi-Language,and Item Options.
Some of these features are exclusive of others. This is intentional because different fields are available on the record depending on the user's settings.
Additional Details
Consider the following when working with the download item record:
-
The itemType subrecord is read-only and set to the value: DwnLdItem.
-
For the string fields: featuredDescription, relatedItemsDescription, storeDescription, and storeDetailedDescription, the string value must be enclosed in HTML paragraph tags (<p>). For example:
-
featuredDescription: <p>featured description</p>
-
relatedItemsDescription: <p>related items description</p>
-
-
For the presentationItem sublist, the itemType field must have the value: INVTITEM.
The following is an example of a complete presentationItem sublist for a POST request:
'presentationItem': { 'items': [ { 'item': { 'id': '99' }, 'itemType': { 'id': 'INVTITEM' } } ] } -
For the translations sublist, the locale field is accessed as a subrecord for PATCH and GET requests.
The following is an example of a complete translations sublist request:
'translations': { 'items': [ { 'locale': { 'id': 'es_ES' }, 'description': 'updated description', 'displayName': 'updated displayName', 'language': 'Spanish', 'pageTitle': 'updated pageTitle' } ] }
Code Samples
The following samples show common use cases for download items. The example ID is 4.
Creating a Download Item Using a POST Request
POST https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/downloadItem
{ "itemId": "download item", "subsidiary": { "items": [ { "id": "5" } ] }
}
Retrieving a Download Item Using a GET Request
GET https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/downloadItem/4
Updating a Download Item Using a PATCH Request
PATCH https://demo123.suitetalk.api.snap.netsuite.com/services/rest/record/v1/downloadItem/4
{ "parent": {"id": 315}
}
Updating Translations using a PATCH Request:
PATCH /services/rest/record/v1/downloaditem/1?replace=translations HTTP/1.1
Host: 3619616.suitetalk.api.netsuite.com
Content-Type: application/json
suiteScriptLog: true
Authorization: OAuth realm="",oauth_consumer_key="",oauth_token="",oauth_signature_method="",oauth_timestamp="",oauth_nonce="",oauth_version="",oauth_signature=""
Content-Length: 918
{
"translations": {
"items": [
{
"displayName": "czech displayname updated",
"locale": {
"id": "cs_CZ"
},
"language": "Czech",
"pageTitle": "czech pagetitle updated"
},{
"displayName": "spanish displayname updated",
"language": "Spanish",
"locale": {
"id": "es_ES"
},
"pageTitle": "spanish pagetitle updated"
},{
"displayName": "french displayname updated",
"language": "French (France)",
"locale": {
"id": "fr_FR"
},
"pageTitle": "french pagetitle updated"
},{
"displayName": "japanese displayname updated",
"language": "Japanese",
"locale": {
"id": "ja_JP"
},
"pageTitle": "japanese pagetitle updated"
}
]
}
}