Creating an application inside Spree
To generate a valid token for the Platform API, you’ll first need to create an application inside Spree.-
Go to Spree’s admin panel and open
Apps
->oAuth Applications
in the menu -
Click on
New oAuth Application
-
Give your application a name and click
Create
-
Save your Client ID and Secret - you’ll later use it to generate a OAuth token to access the platform API
Generating OAuth token
Once the application is configured inside Spree, you can use its credentials to generate an OAuth token that will give you access to the APIs. To obtain the token, send the followingPOST
request to /spree_oauth/token
Authorization: Bearer {token}
header when making requests to the Platform API.