Skip to content

Step 13. Get the customer token [Web API Tutorial]

Ievgen Shakhsuvarov edited this page Jul 16, 2019 · 3 revisions

To get a customer token, you must specify the user’s username and password in the payload.

Endpoint
POST http://<host>/rest/default/V1/integration/customer/token

Headers
Content-Type application/json

Payload

{
    "username": "jdoe@example.com",
    "password": "Password1"
}

Response
Magento returns the customer's access token.
8mu1d2tm0pqojd2vp7fy0mpa3uqv5p2q

Complete cURL request sample

customer_token=$(curl -X POST "$endpoint/$store_view_code/V1/integration/customer/token" \
 -H "Content-Type: application/json" \
 -d '{"username":"jdoe@example.com","password":"Password1"}') && echo $customer_token $ && customer_token=$(echo $customer_token | tr -d '"')

◀️ Previous Step 📖 Table of Contents Next Step ▶️

MSI Documentation:

  1. Technical Vision. Catalog Inventory
  2. Installation Guide
  3. List of Inventory APIs and their legacy analogs
  4. MSI Roadmap
  5. Known Issues in Order Lifecycle
  6. MSI User Guide
  7. DevDocs Documentation
  8. User Stories
  9. User Scenarios:
  10. Technical Designs:
  11. Admin UI
  12. MFTF Extension Tests
  13. Weekly MSI Demos
  14. Tutorials
Clone this wiki locally