How to generate customer access token by REST API Magento 2?

Generate customer access token in Magento using a specific username and password of the customer in the payload request.

By default, a customer token is valid for 1 hour only. To change the default value of the system,
Go to admin panel,
Click Left sidebar Stores > Settings > Configuration > Services > OAuth > Access Token Expiration.

Enter a new value for Customer Token Lifetime(hours) in the text box.
Save Config.

EndPoint URL:


Where store_code is your store code. Native store_code is the default.

Action: POST

Payload Request Body:

    "username":"", "password":"your_password"



You need to use a response string for the authorization header of every call where the customer access token is needed.

For example, To create a new address, you need to use an access token In the header of the request call,

Authorization Bearer <CUSTOMER_ACCESS_TOKEN>