HTTP
Frends templates for HTTP. HTTP is a communication protocol between web browsers and servers for transmitting data.
This template process retrieves order data from Adobe Commerce / Magento and uploads each order into Zoho CRM as sales orders.
This template assumes that the following prerequisites are in place:
ZohoCRM.modules.salesorders.READ
, ZohoCRM.modules.salesorders.CREATE
, ZohoCRM.modules.contacts.READ
and ZohoCRM.modules.products.READ
.Before retrieving the Magento order data, an access token for authenticating the request is obtained from the Magento API. This template filters out Magento orders with the status "canceled".
Accessing the Zoho CRM API also requires an access token, which is obtained with a refresh token provided in the process variables. To generate a refresh token, you can use the corresponding "Zoho CRM - Exchange grant token for refresh token" template. The refresh token does not have an expiration time, so it can be used multiple times.
Zoho CRM has separate API domains for different geographical areas, and requests need to be sent to the same domain as the instance. The domain URLs can be set in the process variables.
The template only handles the insertion of new orders in Zoho CRM. Orders are matched by the subject attribute, which includes the prefix "Magento Order" followed by the order's Magento entity ID. If an order with a matching subject is found, it will be ignored, and the process will continue to the next order.
This template links the orders to contacts and order items to products by retrieving their Zoho IDs in separate requests. For this reason, the template loops through each order item, performs the necessary mapping and stores them in an array for insertion. The rest of the created order's attributes are mapped in the insert task's message field, where they can be customized if needed.
This template does not handle transient errors separately. Each request to Magento and Zoho CRM is checked for errors. If uploading an individual order fails, the process moves on to the next one, and an error notification is added to the result message.
MagentoBaseUrl | The base URL for the Magento instance. |
MagentoUser | The user for Magento. |
MagentoPassword 🗝 | The password for the Magento user. |
ZohoClientId | The client ID for Zoho CRM. |
ZohoClientSecret 🗝 | The client secret for Zoho CRM. |
ZohoApiUrl | The regional domain for accessing the Zoho CRM API. |
ZohoAccountsUrl | The regional domain for accessing the Zoho CRM authentication tokens. |
ZohoRefreshToken 🗝 | The token used for generating a new access token for authorizing Zoho CRM API requests. |