Magento 2 Integration - Magento API Connection
In Magento 2, the API Credentials required for use of the Subscribe Pro extension are generated through the Integrations feature.
The required credentials are:
- Consumer Key
- Consumer Secret
- Access Token
- Access Token Secret
The steps below will show you how to generate these credentials.
Note: Your server must be publicly accessible or must whitelist the Subscribe Pro server IPs in order for Subscribe Pro to connect. You can find the IP addresses in the Subscribe Pro Merchant App Environment configuration under System > Payment Gateway Accounts > IP Addresses. We do not support connecting to servers that are protected by HTTP Authentication credentials.
Generating the Credentials
Step 1
In the Magento Admin backend, click on System. Under Extensions, click Integrations.
Step 2
On the Integrations page, click on the button labeled Add New Integration.
Step 3
Enter a Name for the integration, your Email Address, and your Password.
Do not enter a Callback URL or Identity Link URL.
Then, click on the API tab.
Select Custom from the Resource Access drop-down menu under the Available APIs heading.
Then, select the Sales checkbox, which should check all of the boxes within the Sales group, as well as the Carts > Manage Carts checkbox.
Next, click the button labeled Submit.
Back on the Integrations page, find the integration you just created and click on the Activate link.
Click on the button labeled Allow to confirm the integration's access to the necessary resources.
You will see the four required credentials: Consumer Key, Consumer Secret, Access Token, and Access Token Secret.
You may either copy them directly into Subscribe Pro now, or the next step will show how you can access the credentials at any time.
Then, click on the button labeled Done.
You can access the four credentials by going to the Integrations page, finding the integration used for the Subscribe Pro extension, clicking the Edit icon (on the far right), and then scrolling to the bottom of the page.
In the Subscribe Pro Merchant App
In Subscribe Pro, go to System > Configuration and click on the Store Connection Settings tab.
Under E-commerce Platform Connection Type select Magento 2 REST API.
Under the Magento 2 REST Connection heading, set M2 REST API Base URL to the base URL of your Magento 2 store. The trailing forward slash ( / ) is necessary.
Enter the four credentials you created in the previous steps into their corresponding fields, and save the configuration page. You can click Verify to ensure that the connection is working and the credentials were entered correctly.
If you have completed all of the above steps and are still having trouble connecting to your Magento store from your Subscribe Pro environment, please review our troubleshooting steps.