All URIs are relative to https://api.medusa-commerce.com/store
| Method | HTTP request | Description |
|---|---|---|
| deleteAuth | DELETE /auth | Customer Log out |
| getAuth | GET /auth | Get Current Customer |
| getAuthEmail | GET /auth/{email} | Check if email exists |
| postAuth | POST /auth | Customer Login |
deleteAuth()
Customer Log out
Destroys a Customer's authenticated session.
// Import classes:
//import mobi.appcent.medusa.store.MedusaSdkClient;
//import mobi.appcent.medusa.store.ApiException;
//import mobi.appcent.medusa.store.Configuration;
//import mobi.appcent.medusa.store.auth.*;
//import api.mobi.appcent.medusa.store.AuthApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: cookie_auth
ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth");
cookie_auth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//cookie_auth.setApiKeyPrefix("Token");
AuthApi apiInstance = new AuthApi();
try {
apiInstance.deleteAuth();
} catch (ApiException e) {
System.err.println("Exception when calling AuthApi#deleteAuth");
e.printStackTrace();
}This endpoint does not need any parameter.
null (empty response body)
- Content-Type: Not defined
- Accept: application/json, text/plain
StoreAuthRes getAuth()
Get Current Customer
Gets the currently logged in Customer.
// Import classes:
//import mobi.appcent.medusa.store.MedusaSdkClient;
//import mobi.appcent.medusa.store.ApiException;
//import mobi.appcent.medusa.store.Configuration;
//import mobi.appcent.medusa.store.auth.*;
//import api.mobi.appcent.medusa.store.AuthApi;
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: cookie_auth
ApiKeyAuth cookie_auth = (ApiKeyAuth) defaultClient.getAuthentication("cookie_auth");
cookie_auth.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//cookie_auth.setApiKeyPrefix("Token");
AuthApi apiInstance = new AuthApi();
try {
StoreAuthRes result = apiInstance.getAuth();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuthApi#getAuth");
e.printStackTrace();
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json, text/plain
StoreGetAuthEmailRes getAuthEmail(email)
Check if email exists
Checks if a Customer with the given email has signed up.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.AuthApi;
AuthApi apiInstance = new AuthApi();
String email = "email_example"; // String | The email to check if exists.
try {
StoreGetAuthEmailRes result = apiInstance.getAuthEmail(email);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuthApi#getAuthEmail");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| String | The email to check if exists. |
No authorization required
- Content-Type: Not defined
- Accept: application/json
StoreAuthRes postAuth(body)
Customer Login
Logs a Customer in and authorizes them to view their details. Successful authentication will set a session cookie in the Customer's browser.
// Import classes:
//import mobi.appcent.medusa.store.ApiException;
//import api.mobi.appcent.medusa.store.AuthApi;
AuthApi apiInstance = new AuthApi();
StorePostAuthReq body = new StorePostAuthReq(); // StorePostAuthReq |
try {
StoreAuthRes result = apiInstance.postAuth(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AuthApi#postAuth");
e.printStackTrace();
}| Name | Type | Description | Notes |
|---|---|---|---|
| body | StorePostAuthReq | [optional] |
No authorization required
- Content-Type: application/json
- Accept: application/json, text/plain