Creating custom properties that the Unific Connector extension can detect for orders and customers in a Magento 2 store.
Things to check to ensure the custom properties were added successfully:
- The attribute should be visible in the rest API request to /V1/customers/:customer-ID
- If it is not visible in the rest API endpoint, the attribute was likely not set property. So, the attribute was likely not set to the customer object and would not appear on regular API requests.
- The attributes should be present in the eav_attribute table.
- If they are not, or if they are saved to a different table (extension attributes table), the attributes will not load from the database since the attributes are likely not set on the customer object.
How it works:
Unific converts custom_attributes arrays from multidimensional to key-value pairs by encoding the value of each custom attribute. Extension attributes if set, are added to the custom_attributes array in the same way.
Once everything is set correctly, the customer attributes will be sent in the "custom_attributes" field of the Customer object.
Order attributes will be directly added on the root level of the Order object.