Magento
Main assumptions of integration
In the YetiForce system, you can use the built-in integration with Magento. The integration works on the principle of data synchronization in cron using API (Magento Admin REST endpoints), which synchronizes data between YetiForce and Magento. Flexible design allows for multi-shop functionality, i.e. you can integrate many stores based on the Magento engine with the YetiForce system. Regardless of the number of stores, the YetiForce system is always the master system that centralizes data from various sub-systems [eg. Magento].
Communication between the systems is one-way [the YetiForce system queries the Magento API, downloading and updating data in two directions]. Theoretically, there is no need to install any extensions for Magento, however, in practice, we recommend adjusting the mapping and unifying the types of fields and dictionaries between systems [more information later in the document].
Integration largely protects itself from changes in Magento [as described in the sections below], however, keep in mind that it is an integration between large systems that often process thousands of information daily. Each modification of values in the picklists, removal of a product, or removal of a client may affect both systems, so employees with administrative rights should be trained.
Synchronization
The system synchronizes many elements, the most important of which are: currencies, categories, products, customers, orders. If, during synchronization, a product, category or customer that does not exist in YetiForce appears in the order, the mechanism will automatically apply the missing data.
Synchronization requires a user with administrator privileges for all elements that are synchronized.
Magento > YetiForce
Currencies
By default, both systems have the same list of supported currencies. Adding a currency in Magento requires verification if the new currency is also properly supported in the other system. If a currency is enabled in the Magento store, which is not included in YetiForce, then the integration adds a new currency to the list of supported currencies [this can only be done when the new currency is on the list of currencies supported by the system, which can be checked in the system configuration panel].
**If the currency is removed on the Magento side, then nothing will change in the YetiForce system. **
Categories
All categories are synchronized only in one direction [from Magento to YetiForce], thus category management can be done on the store's side. In case of a new category, the synchronization mechanism will add this category to the YetiForce system [currently only the necessary fields are synchronized, according to the field mapping described in the sections below].
For the security of integration, a change of category in one system does not change the category in the other system [e.g. when we change the name of the category] in this way, the systems will not affect each other, e.g. changing the name of the category could affect filters, charts in the YetiForce system and categories in other stores, which should not happen, especially when the stores are managed by different teams of people. During synchronization, the system ignores the category status, and deleting a category in Magento does not delete it in YetiForce.
Category synchronization is based on the unique category ID in the Magento system, while in the YetiForce system, apart from the category ID, the store ID is also taken into account [the combination of these two IDs is a unique value in the YetiForce system]. The Magento system cannot allow more than one category with the same ID.
Products
Product Synchronization is technically very similar to Category Synchronization. The unique field by which products are synchronized between systems is SKU. An important difference is that categories in YetiForce are unique on the basis of category ID + store ID, and in the case of products, only the SKU field is a unique value, so two stores selling a product with the same SKU will have the same product in YetiForce [but may have different categories].
Contacts
Synchronization of contacts works technically very much like synchronization of categories. The unique field after which contacts between systems are synchronized is the email field. The contact is synchronized when synchronizing customers and when creating an order/invoice [the system checks the contact details and creates a new contact in the YetiForce system if it does not exist, or links the contact to an order if it already exists].
Accounts
Accounts synchronization works technically very much like category synchronization. The unique field after which the accounts are synchronized between the systems is the TAX ID field or the e-mail address. The account is synchronized when synchronizing customers and when creating an order/invoice [the system checks the account's data on the contact - if it does not exist in the YetiForce system, it creates it, and if it does, it links it with the order].
Unfortunately, the Magento system itself has very complicated mechanics of creating an account [data about the account can be completed in different places and at different times of creating an order], therefore the following logic has been implemented when it comes to searching and associating accounts between the systems:
- [Magento] We check if the TAX ID number has been entered in the "Default billing address" block
- [Magento] We check if the TAX ID number has been entered in the "Default delivery address" block;
- If we do not find the TAX ID number, we look for an e-mail address in all fields of the "E-mail" type Account module;
If we do not find an account, it is created; if we find an account in YetiForce, it is linked to the order.
Orders
Synchronization of an order is performed similarly to the synchronization of products, with the following differences:
-
Synchronization takes place when YetiForce downloads information about a new order in the store from the API.
-
The system determines the uniqueness of the order on the Magento side based on the "Order number" field, and on the YetiForce side based on the combination of the "Magento order ID" + "Magento Store ID" fields. Both fields are system fields and cannot be edited.
-
If there is no contact/account/product/category, they are created based on data from Magento.
-
If the order contains additional services [listed below], then additional services will be added to the YetiForce order and the price will be taken from the Magento order:
- Shipping
- Paypal payment service
- Cash on delivery
- Creating/editing an order with the "Completed" status will automatically create a delivery note (the mechanism is disabled by default, you must enable it in the admin panel → “Workflows”). After creating the delivery note, remember that both documents [Order and delivery note] are independent; changing one of them does not affect the other, the only exception is when the status of the order receives a value other than "Completed", then all the delivery notes for this order are canceled.
Comments:
- If the order does not have the required information, e.g. a currency supported by YetiForce, then the order will be skipped.
- If the order contains a product that does not exist in YetiForce and does not exist in Magento [the product was removed after the order was created], then the order will be skipped.
Sales invoices
Synchronization of invoices is carried out in the same way as the synchronization of orders, only delivery note documents are not generated.
YetiForce > Magento
Stock levels (based on delivery note documents)
One of the most important integration elements is the synchronization of stock levels from YetiForce to Magento. Each store can have its own "warehouse" on the YetiForce side and the information about the stock level can come either from the warehouse assigned to the store or directly from the product [i.e. stock from all warehouses together]. It is required to enable the generation of a delivery note when creating/editing an order.
Magento itself also affects the YetiForce system inventory, only through orders [the change in Magento inventory does not affect the YetiForce inventory in any way] on the basis of which the YetiForce system creates a delivery note, which is a warehouse document reducing the inventory of products. The system associates the products and their inventory on the basis of the EAN/SKU field, which should be a unique field in both systems [more information in the field mapping section].
In practice, this means that Magento itself should not change the inventory locally [in Magento], but even if it does [and in the default version of the system without modifying the code, this is exactly how Magento works], then the YetiForce system will overwrite the Magento inventory to the one in YetiForce. Information about the stock is synchronized in a short period of time [it depends on the configuration of the CRON action, by default the action is performed once a minute when the entire CRON mechanism is triggered every minute].