How To: Extend Entities to Reflect Changes in the API

Here are some simple rules to follow if your third-party add-on adds, removes, or changes any data of an entity, and you need those changes to be received in the API.

  1. Perform all data processing only with the help of hooks. For example, your add-on adds a new closed_date field to the order entity. Here this new field must be processed in the fn_get_order_info function hook.
  2. Do not use pre and post controllers for data processing.
  3. Do not wrap a code block with data processing in the API to the condition:
if (!defined('API')) {
    // Some code
}
  1. Do not add data in the processor_params array for the payment systems entity, as this is private data and it is removed at the API level.

If a third-party add-on adds, removes, or changes any data in email notifications, this does not affect the data set in the API response.