Updating to support Shopify Custom Apps/Access Token v2

In January 2022 Shopify announced that Private apps were now deprecated and that going forward you will now need to use Custom apps and authenticate with access tokens instead of using the API Key/Password and basic HTTP authentication that Private apps use.

From February 2022 you can no longer add a new Private app to your Shopify store - existing Private apps can still be used and modified so if you have an existing Private app you do not need to take any action at this stage.

If you have an existing version/integration of fmEcommerce Link (Shopify Edition) v2 and would like to modify this to work with a new Custom app you will need to make some to your existing file/integration in order to support Custom apps and authentication with Shopify access tokens. 

N.B. you cannot authenticate with both a Private app and a Custom app at the same time.

To update your existing fmEcommerce Link (Shopify Edition) v2 file/integration you will need to make the following changes:

1. once you have setup your Custom app and obtained your Admin API access token you can copy/paste this into the API Key field on the SETUP layout

2. you will need to update any script that you are using that makes a request to the Shopify API. For each script you just need to make one change as follows:

- find any steps in the script that set the $cURL variable, such as this one highlighted in the Get All Orders script:

- edit the calculation formula for that script step to replace this line:

" --header " & Quote ( "Authorization: Basic " & $encodedAPIKeys ) &

with the following:

" --header " & Quote ( "X-Shopify-Access-Token: " & Interface::APIKey ) &

The calculation formula should look like this after you have made this change:

N.B. some scripts have more than one step that sets the $cURL variable.

Repeat this for each script that you are using that makes a request to the Shopify API - you will have to adjust the table occurrence for the Interface::APIKey field for each script as the context could be different. You can simply copy the same table occurrence used for the optional proxy server settings at the bottom of the calculation formula. For example when updating the Create Product in Shopify script the updated header option will be:

" --header " & Quote ( "X-Shopify-Access-Token: " & ProductsPreferences::APIKey ) &

and for the Update Current Customer from Shopify script it will be: 

" --header " & Quote ( "X-Shopify-Access-Token: " & CustomersPreferences::APIKey ) &

Once you save these changes you can confirm this now works by running one of the updated scripts. As the scripts are set to also check that the API Password field is not empty you will still need to populate this field with a value (it doesn't matter what you enter in this field as long as it is not empty).

We have updated the master version of fmEcommerce Link (Shopify Edition) v2 to support Custom apps/access token authentication now that Private apps have been deprecated by Shopify. Version 2.1 now supports only Custom apps and has been updated to use access token authentication - you can also download this using the link from your original order email and copy/paste the updated script steps across if that will be easier for you. We have taken a slightly different approach to the steps outlined above as we have also removed any references to the Interface::APIPassword field as this is now no longer required, and are now setting a new variable ($accessToken) with the access token and then referencing that in the cURL options as highlighted here:

We have a short video on the fmEcommerce Link Videos page showing how to create a Custom app on the Shopify website.

You can get more information on Custom apps and authenticating with access tokens here:

Still need help? Contact Us Contact Us