Error While Importing invoice to Sage 50 using SDK - "Reference number is not unique for this customer or vendor"

While creating and saving invoice to Sage 50 using SDK i occasionally get below error message - 

"Reference number is not unique for this customer or vendor.

Reference number is used by another customer or vendor."

Not sure what this error message means. Need help to understand this error and how to resolve this.

Thanks,

Sai