Receiving E-Document XML Files from Web Service

XML files sent through web service are received by NetSuite and are displayed in the Electronic Documents dashboard portlet. But before receiving e-documents, you must first set up and select the appropriate inbound e-document templates to be used. For more information about setting up inbound templates, see Understanding Inbound E-Document Templates in JSON Format and Understanding XSD in Inbound E-Document Templates.

XML e-documents received by NetSuite through web service are validated and checked if the information they contain is complete. The system automatically identifies the sender using the Token ID and Token Secret provided in the request. The Web Service ID is used to identify the vendor or customer whom the e-document should be associated with. The integrity of the XML file is also checked. The transaction type in the web service request is also validated. The results of these validations determine if an inbound e-document record will be created from the received XML file. If created, the inbound e-document record will indicate Web Service in the Source field, and bill or bill credit in the Transaction Type field. The inbound e-document is added to the queue corresponding its processing status displayed on the Electronic Documents dashboard portlet.

NetSuite responds to web service requests by confirming the success or failure of e-document creation. You can view web service requests and responses by going to Customization > Scripting > Scripts, then click the View link of the Inbound E-Document Web Service RL script. The logs are on the Execution Log subtab.

Note:

When an inbound e-document is created using web services, the inbound e-document template is not auto populated and selected for that inbound e-document. So, the administrators receive an email stating that the inbound e-document is incomplete. You need to manually edit that inbound e-document record by navigating into the record from the dashboard portlet's Incomplete Inbound E-Document section and select the preferable template.

Web Service Errors

The following tables list the web service errors that can be encountered by the recipient and sender of web service requests. The recipient is the user in your company who can receive the XML files from web service. The sender is the vendor you authorized to issue web service requests to NetSuite to send XML files.

Errors Encountered by Web Service Recipients

Error Message

Description and Solution

The Web Service ID is already being used by another vendor. Enter a different Web Service ID.

This message is displayed when user tries to save a vendor record that has a web service identifier that is already being used by another vendor.

A different web service identifier must be entered.

The inbound e-document is incomplete, as the correct template cannot be determined. Either select a template in the inbound e-document record, or set up the XSD in the e-document template record to enable template autoselection.

This message is sent through email to the Recipient of E-Document Notifications, informing the recipient that an inbound e-document record was created but is incomplete.

Either manually set the template in the inbound e-document record, or set up the template's XSD to enable template auto selection.

The inbound e-document is incomplete, as the correct vendor cannot be determined. Either select a vendor in the inbound e-document record, or set the Web Service ID in the associated vendor record.

This message is sent through email to the Recipient of E-Document Notifications, informing the recipient that an inbound e-document record was created but is incomplete.

Either manually set the vendor in the inbound e-document record, or correctly set up the vendor's web service ID field.

Errors Encountered by Web Service Sender

Error Message

Description and Solution

The following keys are missing: {KEYS}, which you must provide in the web service request.

The web service request failed because any of the following keys is missing:

  • identifier

  • filename

  • content

Ensure that the missing keys are provided in the web service request.

The body of the web service request must be a JSON object or an of JSON objects using Content-Type: 'application/json'.

The web service request failed.

The content of the web service request must be JSON objects.

The selected XML File Reference is not a valid XML file. Ensure that the file you select has the .xml extension.

The web service request failed.

Provide a valid XML file for the XML File Reference.

No vendor is associated with the Web Service ID: {IDENTIFIER}. Ensure that the correct Web Service ID is used.

The web service request failed.

Ensure that the Web Service ID is associated with a vendor or the party sending XML files.

The selected XML File Reference is not a well-formed XML document.

The web service request failed.

Check the XML File Reference and ensure that content adheres to XML syntax, with properly defined content, structure and tags.

Invalid transaction type. Send a valid request parameter based on the transaction type.

This error message is displayed when you try to send invalid transaction type in the request parameters.

Either bill or billCredit must be sent as tranType in the request parameters.

No such customer is associated with the web service ID: {IDENTIFIER}. Enter a valid web service ID.

The web service request failed. Ensure that the Web Service ID is associated with a customer or the party sending XML files.

Related Topics

General Notices