Magento 2 REST API: Part 1, Introduction…

I launched a new Magento 2 project back in March.  Our current web site was on a hosted shopping cart platform that had absolutely no flexibility outside of the theme.  We needed something we could customize and interface with our custom-built ERP.  Having a background in Magento, and the Magento 2 REST API looking attractive, we decided to go that direction.

I found the REST API feature rich and it appeared to be able to do everything I needed, so I started to dig into the docs and found myself googling around to find more specifics.  After a bit of reading, and digging through the code, I decided the internet is in much need of some simple tutorials based on a couple specific API points.

I will be releasing some posts over the next few days on those specific topics TBA.  This will mostly be based on my findings and what I had to figure out and work with.  I will make sure I include thoughts on my trials and tribulations so you don’t have to go through any of the pains.

What I’d like to do in this post is have you simply jump into your Magento 2 admin area and create an integration:

First, Admin Area -> System -> Integrations

From there, click the orange ‘Add New Integration’ button.

This will give you a 2 tab form.  On the first, Integration Info, you’ll need at least a name for the integration.  On the second, API, you can select Custom access, then check off what you want, or select All.  For the tutorials I’ll be posted, I would suggest going with All.  Of course, in a real-life environment, you would want Custom and then select only the resources you’re going to allow access too.

Save it, and then you’ll see “Activate” in the list of integrations.  Click that, and you’ll have the necessary keys to use it.

From here you can grab your access token and other information.

I’ll have Parts 2 and beyond coming up over the next few days.  Stay tuned!

-Dan

Written by Dan
Welcome to my blog! Here you'll find my collection of bible study lessons, book reviews, and other posts I feel inspired to write. I am a Christian currently serving at First Baptist Church of Northville in Northville, MI.