API customer

1. Create new account
2. Login
3. Customer information
4. Logout

Note:
Please see the general guide for all APIs first: https://s-cart.org/en/developer/master/about-api-scart.html


1. Create new account
Link: https://your-domain.com/api/member/create
Method: POST

To change the customer's data fields, update in the admin website:


Header:


- Return result: Newly created user information


2. Login
Link: https://your-domain.com/api/member/login
Method: POST
Field data:
+ email
+ password
+ remember_me: optional. If value 1, login session lasts 1 week.
Results returned:
Successful result will get "access_token" as below


3. Customer information

NOTE:
All APIs get the user's personal information, the header must have a value "Authorization"  is Bearer+'space'+access_token

Inside:
+ Bearer: Token Type
+ access_token: Received after login above


Api access token

3.1. Get customer information
Link: https://your-domain.com/api/member/info
Method: GET


3.2. Create new order
Link: http://scart.local/api/member/create_order
Method: POST
Data field:
Ref: https://s-cart.org/demo-api/#/Customer/Customeraddneworder

Result: 



3.3. Get orders list
Link: https://your-domain.com/api/member/orders
Method: GET


3.4. Get order detail
Link: https://your-domain.com/api/member/orders/{id}
Method: GET
Api chi tiết đơn hàng

3.5. Cancel order
Link: https://your-domain.com/api/member/cancel_order/{id}
Method: POST
Api chi tiết đơn hàng

4. Logout
Link: https://your-domain.com/api/member/logout
Method: GET
Api đăng xuất

Related topics

Latest Document