Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Is there a good example somewhere of an invoice in XML format to use with Electronic Invoicing?
EDIT: For anybody else who runs into this problem here is a schema (xsd) and field mapping (JSON) that worked for me for importing invoices to automatically create bills.
Here is the JSON Template:
[CODE]
{
"tranid": "${XML.edoc.edocType.tranid}",
"item":[
<#list XML.edoc.edocType.items.item as current>
{
"vendorcode":"${current.vendorcode}",
"quantity":"${current.quantity}",
"rate":"${current.rate}",
"amount":"${current.amount}",
"location":"${current.location}",
},
<#if item_has_next>,</#if>
</#list> ],
"expense":[
<#list XML.edoc.edocType.expenses as current>
{
"category":"${current.expense.category}",
"account":"${current.expense.account}",
"amount": "$current.expense.amount}",
Here is the JSON Template:
[CODE]
{
"tranid": "${XML.edoc.edocType.tranid}",
"item":[
<#list XML.edoc.edocType.items.item as current>
{
"vendorcode":"${current.vendorcode}",
"quantity":"${current.quantity}",
"rate":"${current.rate}",
"amount":"${current.amount}",
"location":"${current.location}",
},
<#if item_has_next>,</#if>
</#list> ],
"expense":[
<#list XML.edoc.edocType.expenses as current>
{
"category":"${current.expense.category}",
"account":"${current.expense.account}",
"amount": "$current.expense.amount}",
0