How does the QuickBooks Online Invoice Number get populated?
The Invoices API endpoint has a DocNumber attribute which is the reference number for an Invoice. You have 2 options when uploading Invoices to QuickBooks Online:
- leave this blank - the DocNumber attribute is populated automatically by the data service if not supplied
- populate this with a value from a FileMaker field
In the fmAccounting Link (QuickBooks Online Edition) file we are using the 2nd option to populate this with the value from the DocNumber field (an auto-enter serial number field). If you wish to change this to have QuickBooks Online auto-generate the number for you just comment out this line:
["DocNumber" ; Invoices::DocNumber; JSONString];<br>
in the Upload Invoice to QuickBooks script when it sets the $json variable with this value.
If your invoices are uploading with an empty QuickBooks Online invoice number after commenting this line out please read the notes about the DocNumber field here and how the value of the Preferences:CustomTxnNumber field can result in null DocNumber values.
We have a separate field in the Invoices table named QuickBooksInvoiceNumber which we populate with the QuickBooks Online Invoice Number value, regardless of the above settings.
You can get more information about handling duplicate DocNumber errors when uploading to QuickBooks Online here.