Magento2

Tags:

Updated:

4 minute read

Application configuration is an integral activity prior to the process of integration. If your choosen application is Magento 2, providing the API Path, User name and Password is essential for configuring the agent.

Here you will find the detailed description on how to configure the agents for the application of Magento 2, the Integration Techniques and the Troubleshooting issues.

Pre-requisites for Magento2 Configuration

Get the API Path

  1. Check into Magento2 account.
  2. As Magento is a cloud-based application, therefore it has an URL. The API Path is your - URL/index.php/rest/V1/
  3. For all Magento Activities, Template bar is required, therefore the API Path in this case should be.

API Path: - http://templatebar.com/Individual/soumi/magento1/index.php/rest/V1/

The Username and Password will be - Magento2 Login Username and Password.

Configure the Agent

To Know about Agent Configuration, Click here

Configure the Magento Application in the Agent

  1. The API Path, Username and Password is now generated.
  2. Next, configure On-Premise AEC Agent before Integrating and executing the Touchpoints in the Cloud Portal.
  3. Create and Publish Connection in the cloud portal.
  4. Update the Configuration in your On-Premise AEC Agent. You will find your Connection present in the agent.
  5. Move into the App Configurations window in your agent and configure the details.

Protip: Uncheck the Show in Sync Panel checkbox before proceeding with the App Configurations

  1. Enter details - API Path, User Name and Password.
  2. Click Validate and Save.

After validation, you will get the message Successfully Validated and Saved.

Troubleshooting

ISSUE 1:

Some of the basic troubleshooting issue happens due to improper validations or even if it is accurately validated, and if touchpoints do not sync, this basic issue resolves after removing the Temp and Cache files from the portal and from your system. Therefore, after clearing all this publish the touchpoints again along with Update Configuration on the agent.

For E.g. If the Source Application Not Found in the log file appears, the probable cause is due to the presence of the Temp and Cache Files.

ISSUE 2:

You have an API for Magento, but the API is not accessible from your server

  • Discuss how to check API from local server.
  • Discuss about firewall settings

ISSUE 3: Customer Address issue with sourcelib: SetCustomerAddressItems(addresses) - NAV-Magento2.

SetCustomerAddressItems(addresses) is creating an issue with customer address sync which has one address both as bill to and ship to set as default. Checking the SAP address push scenario, this function was developed. This function transforms extra node to push the address in ship to section of SAP. The structure is as below:

addresses

"default_shipping": true, "default_billing": true

After transform through sourcelib:SetCustomerAddressItems (addresses)

addresses

"default_shipping": false, "default_billing": true "default_shipping": true, "default_billing": true

This extra node is creating an issue in NAV with multiple Address Line which is not allowed and resulting in failure of the data.

Solution: - Simple mapping should be done. No need to call the method SetCustomerAddressItems(). This method is developed only for SAP B1

Protip: While working with SAP B1 Integrations, SAP Business One DI Server ON/OFF is needed to be done for proper syncing if any errors like the above one persists

Attributes and Actions

While defining a connect to a particular API endpoint in Magento, you require clear understanding about the data requirements and endpoint configurations. You can refer to this document to find all the endpoint details of your magento installation. To define the endpoint in APPSeCONNECT, you need Actions and Entities. Actions are specifically targetted for a particular endpoint while schema is the data needed to execute the API. Here are the list of some of the prepackaged API actions defined for you which you can easily plug and play while doing your integrations.

Endpoint Action Action Type Schema UI Help API Help
/customers/search customers/search Get Customer It will search customer from magento. You can specify filter criteria based on type of customer customer_type and /or created_at or updated_at fields. The API also supports limit filters. Click here Search Customers
customers/CustomerId/Password resetPasswordLinkToken GET Customer It Checks if the password reset token is valid or invalid CustomerResetPassword
guest-carts/cartId itemId PUT Guest-carts Add/Update the specified item in cart guest-carts/cartId
orders orders GET order Magento gives user the privelage to add Orders from the front end of the application as well as backend of the application.Login to Magento2.0 front end with the valid credentials of a contact person.Now select certain items and place an order as per requirement. After the order is successfully placed the order ID should be generated. This will get orders from Magento2 for posting in any destination application from the backend order
product POST.json POST product This will Create order in Magento 2 from Source Application product
stockItem PUT.json PUT stockItem This will update inventory in Magento2 from any source Application stockItem
Customers/isEmailAvailable isEmailAvailable POST Customer Check if given email is associated with a customer account in given website Customers/isEmailAvailable
guest-carts/cartId itemId DELETE Guest-carts To Remove items from the specified cart guest-carts/cartId

Protip: Working on SAP B1 and Magento 2 (B2C) needs a SAP B1 add-on and Magento B2C extension for its integration. Customers and Orders can be created and placed from the Front-End also. For Placing orders from front end, visit the E-Commerce store and follow the generic steps for placing orders and creating customers.