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.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
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