2

I'm trying to connect Netsuite vía SOAP using Postman. I already made a connection with GET but all I get in the response is always the same: "You have successfully connected to the NetSuite SOAP Server. The Server is operational." Idk if I'm making something wrong, the endpoint is: https://myAccountId.suitetalk.api.netsuite.com/services/NetSuitePort_2021_1

The body I'm sending:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
  <soap-env:Header>
    <tokenPassport xmlns="urn: messages_2017_2.platform.webservices.netsuite.com" xmlns:ns1="urn:core_2017_2.platform.webservices.netsuite.com">
      <account>{{ACCOUNT}}</account>
      <consumerKey>{{CONSUMER_KEY}}</consumerKey>
      <token>{{TOKEN_ID}}</token>
      <nonce>{{nonce}}</nonce>
      <timestamp>{{timestamp}}</timestamp>
      <signature algorithm="HMAC-SHA1">{{signature}}</signature>
    </tokenPassport>
    <preferences>
      <runServerSuiteScriptAndTriggerWorkflows>
        false
      </runServerSuiteScriptAndTriggerWorkflows>
    </preferences>
    <searchPreferences>
      <pageSize>1000</pageSize>
      <bodyFieldsOnly>false</bodyFieldsOnly>
    </searchPreferences>
  </soap-env:Header>
  <soap-env:Body>
     <urn:get xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:platformCore="urn:core_2017_2.platform.webservices.netsuite.com">
         <urn:baseRef internalId="46" type="invoice" xsi:type="platformCore:RecordRef">
         </urn:baseRef>
      </urn: get>   

  </soap-env:Body>
</soap-env:Envelope>
Luken
  • 23
  • 3

1 Answers1

0

Make sure to not mix versions. You state your endpoint is (...)NetSuitePort_2021_1 while in your body you are using core_2017_2.

I've started assigning

WEBSERVICES_URL to {{COMPANY_URL}}/services/NetSuitePort_{{SOAP_VERSION}}

and

SOAP_VERSION to 2022_1

I couldn't get authentication to work with HMAC-SHA1 hence I switched to HMAC-SHA256

This body works for me:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
  <soap-env:Header>
    <tokenPassport>
      <account>{{ACCOUNT_ID}}</account>
      <consumerKey>{{CONSUMER_KEY}}</consumerKey>
      <token>{{TOKEN_ID}}</token>
      <nonce>{{nonce}}</nonce>
      <timestamp>{{timestamp}}</timestamp>
      <signature algorithm="HMAC-SHA256">{{signature}}</signature>
    </tokenPassport>
    <preferences>
      <runServerSuiteScriptAndTriggerWorkflows>
        false
      </runServerSuiteScriptAndTriggerWorkflows>
    </preferences>
    <searchPreferences>
      <pageSize>1000</pageSize>
      <bodyFieldsOnly>false</bodyFieldsOnly>
    </searchPreferences>
  </soap-env:Header>
  <soap-env:Body>
    <get xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xmlns:platformCore="urn:core_{{SOAP_VERSION}}.platform.webservices.netsuite.com">
      <baseRef internalId="{{lastInvoice}}" type="invoice" xsi:type="platformCore:RecordRef">
        <platformCore:name/>
      </baseRef>
    </get>
  </soap-env:Body>
</soap-env:Envelope>
zellers
  • 186
  • 5