SOAP Operation – asyncUpsertList

Scenario: Create a location record and update a sales order in a single request asynchronously.

Request

<soapenv:Envelope
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:platformCore='urn:core_2021_2.platform.webservices.netsuite.com'
    xmlns:listRel='urn:relationships_2021_2.lists.webservices.netsuite.com'
    xmlns:listAcct='urn:accounting_2021_2.lists.webservices.netsuite.com'
    xmlns:platformMsgs='urn:messages_2021_2.platform.webservices.netsuite.com'>
    <soapenv:Header>
        <tokenPassport xsi:type='platformCore:TokenPassport'>
            <account xsi:type='xsd:string'>{{accountId}}</account>
            <consumerKey xsi:type='xsd:string'>{{consumerKey}}</consumerKey>
            <token xsi:type='xsd:string'>{{tokenId}}</token>
            <nonce xsi:type='xsd:string'>{{nonce}}</nonce>
            <timestamp xsi:type='xsd:long'>{{timestamp}}</timestamp>
            <signature algorithm='HMAC_SHA256' xsi:type='platformCore:TokenPassportSignature'>{{signature}}</signature>
        </tokenPassport>
    </soapenv:Header>
    <soapenv:Body>
          <soapenv:Body>
        <asyncUpsertList xsi:type='platformMsgs:AsyncUpsertListRequest'>
            <record xsi:type='tranSales:SalesOrder' externalId='12354789'>
                <memo xsi:type='xsd:string'>Sales order is again updated.</memo>
            </record>
            <record xsi:type='listAcct:Location' externalId='46463453'>
                <name xsi:type='xsd:string'>Test SOAP Location</name>
                <locationType xsi:type='xsd:string'>_store</locationType>
            </record>
        </asyncUpsertList>
    </soapenv:Body>
</soapenv:Envelope>

Response

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <asyncUpsertListResponse
            xmlns="">
            <platformCore:asyncStatusResult
                xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com">
                <platformCore:jobId>ASYNCWEBSERVICES_TSTDRV2782962_080720238250252901145396_fac1</platformCore:jobId>
                <platformCore:status>pending</platformCore:status>
                <platformCore:percentCompleted>0.0</platformCore:percentCompleted>
                <platformCore:estRemainingDuration>0.0</platformCore:estRemainingDuration>
            </platformCore:asyncStatusResult>
        </asyncUpsertListResponse>
    </soapenv:Body>
</soapenv:Envelope>

getAsyncResult

Request

<soapenv:Envelope
    xmlns:xsd='http://www.w3.org/2001/XMLSchema'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:platformCore='urn:core_2021_2.platform.webservices.netsuite.com'
    xmlns:listRel='urn:relationships_2021_2.lists.webservices.netsuite.com'
    xmlns:listAcct='urn:accounting_2021_2.lists.webservices.netsuite.com'
    xmlns:platformMsgs='urn:messages_2021_2.platform.webservices.netsuite.com'>
    <soapenv:Header>
        <tokenPassport xsi:type='platformCore:TokenPassport'>
            <account xsi:type='xsd:string'>{{accountId}}</account>
            <consumerKey xsi:type='xsd:string'>{{consumerKey}}</consumerKey>
            <token xsi:type='xsd:string'>{{tokenId}}</token>
            <nonce xsi:type='xsd:string'>{{nonce}}</nonce>
            <timestamp xsi:type='xsd:long'>{{timestamp}}</timestamp>
            <signature algorithm='HMAC_SHA256' xsi:type='platformCore:TokenPassportSignature'>{{signature}}</signature>
        </tokenPassport>
    </soapenv:Header>
    <soapenv:Body>
         <soapenv:Body>
        <getAsyncResult xsi:type='platformMsgs:GetAsyncResultRequest'>
            <jobId xsi:type='xsd:string'>ASYNCWEBSERVICES_TSTDRV2782962_080720238250252901145396_fac1</jobId>
            <pageIndex xsi:type='xsd:int'>1</pageIndex>
        </getAsyncResult>
    </soapenv:Body>
</soapenv:Envelope>

Response

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <platformMsgs:documentInfo
            xmlns:platformMsgs="urn:messages_2021_2.platform.webservices.netsuite.com">
            <platformMsgs:nsId>ASYNCWEBSERVICES_TSTDRV2782962_080720238250252901145396_fac1</platformMsgs:nsId>
        </platformMsgs:documentInfo>
    </soapenv:Header>
    <soapenv:Body>
        <getAsyncResultResponse
            xmlns="">
            <platformMsgs:asyncResult xsi:type="AsyncUpsertListResult"
                xmlns:platformMsgs="urn:messages_2021_2.platform.webservices.netsuite.com">
                <platformMsgs:writeResponseList>
                    <platformMsgs:writeResponse>
                        <platformCore:status isSuccess="true"
                            xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com">
                            <platformCore:statusDetail>
                                <platformCore:afterSubmitFailed>false</platformCore:afterSubmitFailed>
                            </platformCore:statusDetail>
                        </platformCore:status>
                        <platformMsgs:baseRef internalId="1" externalId="12354789" type="salesOrder" xsi:type="platformCore:RecordRef"
                            xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com"/>
                        </platformMsgs:writeResponse>
                        <platformMsgs:writeResponse>
                            <platformCore:status isSuccess="true"
                                xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com">
                                <platformCore:statusDetail>
                                    <platformCore:afterSubmitFailed>false</platformCore:afterSubmitFailed>
                                </platformCore:statusDetail>
                            </platformCore:status>
                            <platformMsgs:baseRef internalId="2" externalId="46463453" type="location" xsi:type="platformCore:RecordRef"
                                xmlns:platformCore="urn:core_2021_2.platform.webservices.netsuite.com"/>
                            </platformMsgs:writeResponse>
                        </platformMsgs:writeResponseList>
                    </platformMsgs:asyncResult>
                </getAsyncResultResponse>
            </soapenv:Body>
        </soapenv:Envelope>

Leave a comment

Your email address will not be published. Required fields are marked *