SOAP Web services can be used for extracting item receipts details from the NetSuite account. We need to define the SOAP request with the body to fetch the data. With the SOAP request, we can directly fetch the data from the NetSuite. SOAP is a standard NetSuite API.
Following are the steps for the extraction of Item Receipt details from the NetSuite:
- ITEM_RECEIPT_SEARCH – extract all item receipt internal ids using the ITEM_RECEIPT_SEARCH SOAP Request. The response result page size is 1000.
- SEARCH_MORE_PAGE – Send the SEARCH_MORE_PAGE request if the ITEM_RECEIPT_SEARCH response has multiple pages. Search id for the request will be fetched from the initial request(ITEM_RECEIPT_SEARCH) response. Multiple calls needed for the request which depend on pagesize.
- ITEM_RECEIPT_GETLIST – after getting all the internal ids of the Item Receipt, need to send the ITEM_RECEIPT_GETLIST request for extracting all the Item Receipt details. In the request we can specify up to 200 record ids to fetch the datas.
The payload for the ITEM_RECEIPT_SEARCH:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:messages_2021_2.platform.webservices.netsuite.com"
xmlns:urn1="urn:core_2021_2.platform.webservices.netsuite.com"
xmlns:listRel="urn:relationships_2021_2.lists.webservices.netsuite.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<urn:preferences>
<urn1:bodyFieldsOnly>false</urn1:bodyFieldsOnly>
<urn1:pageSize>10</urn1:pageSize>
</urn:preferences>
<urn:partnerInfo></urn:partnerInfo>
<urn:tokenPassport>
<urn1:account>{{ACCOUNT_ID}}</urn1:account>
<urn1:consumerKey>{{CONSUMER_KEY}}</urn1:consumerKey>
<urn1:token>{{TOKEN_ID}}</urn1:token>
<urn1:nonce>{{nonce}}</urn1:nonce>
<urn1:timestamp>{{timestamp}}</urn1:timestamp>
<urn1:signature algorithm="HMAC-SHA256">{{signature}}</urn1:signature>
</urn:tokenPassport>
</soapenv:Header>
<soapenv:Body>
<search
xmlns="urn:messages_2021_2.platform.webservices.netsu ite.com">
<searchRecord xsi:type="ns9:TransactionSearchBasic"
xmlns:ns9="urn:common_2021_2.platform.webservices.netsuite.com">
<ns9:type operator="anyOf" xsi:type="ns12:SearchEnumMultiSelectField"
xmlns:ns12="urn:core_2021_2.platform.webservices.netsuite.com">
<ns12:searchValue xsi:type="xsd:string">itemReceipt</ns12:searchValue>
</ns9:type>
<ns9:lastModifiedDate operator="within" xsi:type="ns3:SearchDateField"
xmlns:ns3="urn:core_2021_2.platform.webservices.netsuite.com">
<ns3:searchValue xsi:type="xsd:dateTime">2017-05-21T00:16:17.750Z</ns3:searchValue>
<ns3:searchValue2 xsi:type="xsd:dateTime">2022-02-22T00:17:53.015Z</ns3:searchValue2>
</ns9:lastModifiedDate>
</searchRecord>
</search>
</soapenv:Body>
</soapenv:Envelope>
The sample payload for SEARCH_MORE_PAGE:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:messages_2021_2.platform.webservices.netsuite.com"
xmlns:urn1="urn:core_2021_2.platform.webservices.netsuite.com"
xmlns:listRel="urn:relationships_2021_2.lists.webservices.netsuite.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<urn:preferences></urn:preferences>
<urn:partnerInfo></urn:partnerInfo>
<urn:tokenPassport>
<urn1:account>{{ACCOUNT_ID}}</urn1:account>
<urn1:consumerKey>{{CONSUMER_KEY}}</urn1:consumerKey>
<urn1:token>{{TOKEN_ID}}</urn1:token>
<urn1:nonce>{{nonce}}</urn1:nonce>
<urn1:timestamp>{{timestamp}}</urn1:timestamp>
<urn1:signature algorithm="HMAC-SHA256">{{signature}}</urn1:signature>
</urn:tokenPassport>
</soapenv:Header>
<soapenv:Body>
<urn:searchMoreWithId>
<searchId>{search_id}</searchId>
<pageIndex>2</pageIndex>
</urn:searchMoreWithId>
</soapenv:Body>
</soapenv:Envelope>
The Sample payload for ITEM_RECEIPT_GETLIST:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:messages_2021_2.platform.webservices.netsuite.com"
xmlns:urn1="urn:core_2021_2.platform.webservices.netsuite.com"
xmlns:listRel="urn:relationships_2021_2.lists.webservices.netsuite.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<urn:preferences></urn:preferences>
<urn:partnerInfo></urn:partnerInfo>
<urn:tokenPassport>
<urn1:account>{{ACCOUNT_ID}}</urn1:account>
<urn1:consumerKey>{{CONSUMER_KEY}}</urn1:consumerKey>
<urn1:token>{{TOKEN_ID}}</urn1:token>
<urn1:nonce>{{nonce}}</urn1:nonce>
<urn1:timestamp>{{timestamp}}</urn1:timestamp>
<urn1:signature algorithm="HMAC-SHA256">{{signature}}</urn1:signature>
</urn:tokenPassport>
</soapenv:Header>
<soapenv:Body>
<urn:getList>
<urn.baseRef internalId="2504" type="itemReceipt" xsi:type="platformCore:RecordRef"
xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com"/>
<urn.baseRef internalId="2544" type="itemReceipt" xsi:type="platformCore:RecordRef"
xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com"/>
</urn:getList>
</soapenv:Body>
</soapenv:Envelope>