Password
How to execute the authorization flow and get your access token
Last updated
How to execute the authorization flow and get your access token
Last updated
The password
grant type is used by sales channels to exchange customer credentials for an access token (i.e. to get a "logged" access token).
By including a scope in the access token request, all the resources that you fetch are automatically filtered.
To get an access token using the password
grant type, send a POST
request to the /oauth/token
endpoint, passing the API client credentials in the request body.
POST https://auth.commercelayer.io/oauth/token
Body parameter | Type | Required | Description |
---|---|---|---|
The following request tries to get an access token for a sales channel, using the password
grant type for a specific user, putting in scope the market identified by the ID "xYZkjABcde":
grant_type
String
Required
password
username
String
Required
The customer's email address.
password
String
Required
The customer's password.
client_id
String
Required
Your client ID (from your API credentials).
scope
String
Optional
Your access token scope (market, stock location).