Page 1 of 1

Payments POST - Change PayType

Posted: Mon Jan 23, 2023 3:43 pm
by cridertechdev
When POSTing a new payment, can we add functionality to set the PayType by name? It would reduce the number of queries made if I don't have to first query the definitions table for the Credit Card payment type and then parse the DefNum to add to the payment POST.

Re: Payments POST - Change PayType

Posted: Tue Jan 24, 2023 9:07 am
by SLeon
Good morning,

The contents of Definition table in Open Dental does not change often, so most developers cache this data. When their software launches, they will run Definitions GET and hold this data in memory to reference later. This eliminates the need to GET them before each Payments POST request.

If you are calling Definitions GET before each and every method to get the definition.DefNum, you would have to continue doing this to get the definition name anyway. This is not recommended as the name of a definition can be changed by the dental office at any time. The DefNum is the Primary Key to the definition table and cannot be changed.