ThoughtMetric

Store APIs

Connect the Magento API

Connect the Magento API to track returns, refunds and order details.

Connecting the Magento API integration enables tracking of returns, refunds, voided payments, and customer lifetime value. It also double-checks the ThoughtMetric data for accuracy, so you can be confident in it.

  1. Log in to the Magento admin console.

  2. Open the integrations page

    Navigate to System → Integrations.

    Connect the Magento API screenshot 1
  3. Add a new integration

    Click Add a New Integration.

    Connect the Magento API screenshot 2
  4. Name the integration

    On the Integration Info tab, enter "ThoughtMetric" as the name of the integration.

    Connect the Magento API screenshot 3
  5. Set the API permissions

    On the API tab, allow the following permissions:

    • Sales → Operations → Orders → Actions → View
    • Catalog
    • Customers
    Connect the Magento API screenshot 4
  6. Click Save and Activate.

  7. Copy the access token

    On the following screen, copy the Access Token value that is presented.

    Connect the Magento API screenshot 5
  8. In ThoughtMetric, navigate to the Integrations screen and click Connect under the Magento icon.

  9. Enter your access token and store URL

    Paste the access token into the access token text box and enter the URL for your website in the appropriate text box.

    Connect the Magento API screenshot 6
  10. Enter your store name (optional)

    If you run more than one store from a single Magento install, enter the name of the store you want to track in the Store Name text box. ThoughtMetric will then only pull orders, returns, refunds and customer lifetime value for that store. You can find the name in the Magento admin under Stores → All Stores, in the Store View column.

    If you only have one store, leave this blank. Then click Connect.

  11. Allow standalone bearer tokens in Magento

    Back in the Magento admin, there is one more setting to adjust. Navigate to Stores → Configuration → Services → OAuth → Consumer Settings, then set the Allow OAuth Access Tokens to be used as standalone Bearer tokens option to Yes.

    Connect the Magento API screenshot 7

Changing the store name

To add, change or remove the store name after connecting, go to the Integrations screen, click Edit Integration under the Magento icon, then click Edit next to your store. Orders already in ThoughtMetric aren't removed when you change it; the new store name applies to orders pulled from then on.

You might also need to allowlist the following IP addresses in any firewalls or Cloudflare installations you have: 34.150.141.41 and 35.245.88.190.