I'm not able to find anything online about this issue, but when I create records in my application, I first do a check to see if they're on here, and if they are, it skips the step to create the record here. For instance, I created a purchase invoice and it recreated the supplier that it was associated with by the contact_id. They are two separate records in the sage database, one has 0.0 money owed, and the second has the amount from the purchase invoice as it's money owned. But they are the same contact/supplier. I'm referencing everything by the id, which I assumed was unique. I'm at a loss as to why this did not trigger a unique validation issue
supplier entries are unique in Sage Accounting. You can always reference them by their ID via the API. It is possible though to create 2 supplier entries with the same name (as there are scenarios where is might be needed). Then, of course, each of these entries do have their own unique ID.
I hope this makes sense.
It does, but what about email being unique? Right now, I'm making a get and if the response is good I skip the create, otherwise I create the record. But that seems like it might be too many requests? I haven't been able to find anything about limits or batch creating records though either
The flow would be for me:
1. Create a contact if it does not exist yet
2. Select contact ID for next invoice creation
3. Use saved contact ID in the new invoice
The limits of the API are fairly high, so it should be no issue to do the requests. Of course it is always a good idea to have data of Sage Accounting cached in your app that you don't need to request the needed data all the time.
Cool thanks! Ya that's how I'm doing it now. Just wanted to make sure it was inline with the better practices of your api :D