We have an application that creates accounts on Salesforce using REST API populating them with data from an external database.
The problem we have encountered is that if the client (the owner of the Salesforce org we are creating accounts in) has defined custom required fields in his account object, we get an error that we are missing fields. This is expected behavior, after all. We only provide the fields we know about: the standard Account object fields.
One solution is to call the "describe" REST query for the Account object, scan all the fields for required ones, check the type, and add the field and some default value to our Account object before sending it to Salesforce. (In the case of a picklist field, we'd have to scan the list of valid choices and choose one). The problem with this solution is that it needs to be done for every created account, since we never can know when the admin has added a new custom required field.
My question is, has anyone dealt with this kind of issue, and if so, what was your solution?