Authentication and authorization
Create and manage customer access tokens.
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
Customer's account password.
POST /customer/{tenant}/signup HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 675
{
"email": "[email protected]",
"password": "password123",
"customerDetails": {
"title": "MR",
"firstName": "John",
"middleName": "",
"lastName": "Doe",
"contactEmail": "[email protected]",
"contactPhone": "123456789",
"company": "Emporix",
"preferredLanguage": "en_US",
"preferredCurrency": "EUR",
"preferredSite": "main",
"b2b": {
"companyRegistrationId": "123-456-789"
}
},
"customerAddress": {
"contactName": "John Doe",
"companyName": "Emporix",
"street": "Platz der Republik",
"streetNumber": "1",
"streetAppendix": "",
"extraLine1": "",
"extraLine2": "",
"extraLine3": "",
"extraLine4": "",
"zipCode": "11011",
"city": "Berlin",
"country": "DE",
"state": "Berlin",
"contactPhone": "123456789",
"tags": [
"BILLING",
"SHIPPING"
]
}
}
{
"id": "13730481"
}
Sends an authentication request and returns an anonymous token. This operation causes creation of a new session-context document.
Anonymous token is valid for one hour. After that time it should be refreshed in order to keep the same session ID associated.
Name of the tenant.
Note: Name of the tenant is always written in lowercase.
{tenant}
Your Emporix API key - client ID.
{client_id}
GET /customerlogin/auth/anonymous/login HTTP/1.1
Host: api.emporix.io
Accept: */*
The request was successful. An anonymous token is returned.
{
"token_type": "Bearer",
"access_token": "tpYgJPZqddEQ2zwfzNtx79noBP65",
"expires_in": 3599,
"refresh_token": "7FnviYrxvQWYdzUVBVTvXeNAA4Jy1HPe",
"refresh_token_expires_in": 86399,
"sessionId": "6d4d4d5e-04b9-40c5-9074-4df1405c6081",
"scope": "tenant={tenant}"
}
Sends an authentication request and returns new anonymous token with same session ID attached.
This operation causes update of a session-context document with given session ID.
Anonymous token is valid for one hour. After that time, another refresh anonymous token request should be sent.
Name of the tenant.
Note: Name of the tenant is always written in lowercase.
{tenant}
NOTE: It's recommended to use refresh_token
parameter instead. Anonymous token that needs to be refreshed so that the same session ID will be kept. Provide the value of the access_token
you get in response to requesting a token request.
{GOToGKaEKFyR8DokPBwHH0Y3AKCo}
A refresh token generated when the anonymous token is created.
{7FnviYrxvQWYdzUVBVTvXeNAA4Jy1HPe}
Your Emporix API key - client ID.
{client_id}
GET /customerlogin/auth/anonymous/refresh HTTP/1.1
Host: api.emporix.io
Accept: */*
The request was successful. An anonymous token is returned.
{
"token_type": "Bearer",
"access_token": "tpYgJPZqddEQ2zwfzNtx79noBP65",
"expires_in": 3599,
"refresh_token": "7FnviYrxvQWYdzUVBVTvXeNAA4Jy1HPe",
"refresh_token_expires_in": 86399,
"sessionId": "6d4d4d5e-04b9-40c5-9074-4df1405c6081",
"scope": "tenant={tenant}"
}
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
Customer's email address.
Customer's account password.
POST /customer/{tenant}/login HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 58
{
"email": "[email protected]",
"password": "password123"
}
{
"access_token": "aYR3Lu3rpsQ9ODhBIR83b3txTr5K",
"saas_token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMzg2OTAwMCIsImV4cCI6MTY0MDQ0NDAzMn0.lvxFOeCOk-DWi3kqwJwR8eKal3ON2rr53e9I6Pha5rI",
"expires_in": 2591999,
"refresh_token": "94tKQ2Tsvlf9dYbmyccA7X1Rqe54B6dH",
"refresh_token_expires_in": 86399,
"token_type": "Bearer",
"session_id": "45c9726e-77c8-4bd0-b29d-61ab56f59726"
}
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
Customer's access token to be invalidated.
GET /customer/{tenant}/logout HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
Customer's refresh token generated when a customer token is requested.
{customer_refresh_token}
Identifier of the legal entity associated with the user session.
Customer's access token generated when the customer token is created.
Bearer {customer_access_token}
GET /customer/{tenant}/refreshauthtoken HTTP/1.1
Host: api.emporix.io
Authorization: text
Accept: */*
{
"access_token": "2yXy8H7sByl4JSWrr7GRqxiCRMUm",
"expires_in": 2591999,
"refresh_token": "iwXAFjGwboaehJar1qNOkV05phDw1god",
"refresh_token_expires_in": 86390,
"token_type": "Bearer",
"session_id": "45c9726e-77c8-4bd0-b29d-61ab56f59726"
}
Checks whether a token is valid. If the token is invalid, it returns a 401 status code. If the token is valid, it provides the token details.
Name of the tenant.
Note: Name of the tenant is always written in lowercase.
{tenant}
Customer's access token generated upon the customer token creation.
Bearer {customer_access_token}
GET /customer/{tenant}/validateauthtoken HTTP/1.1
Host: api.emporix.io
Authorization: text
Accept: */*
{
"token_type": "Bearer",
"expires_in": 2591974,
"scope": "approval.approval_read_own customermanagement.legalentity_read_own customer.customer_read_own quote.quote_read_own returns.returns_read_own iam.scope_read_own iam.user_read_own customersegment.segment_read_own iam.group_read_own order.order_readascustomer coupon.coupon_redeem customer.customerprofile_edit quote.quote_manage_own returns.returns_manage_own customer.customer_manage_own approval.approval_manage_own order.order_updateascustomer iam.assignment_delete_own customer.consent_view customer.customerprofile_view order.history_view iam.assignment_create_own customer.consent_manage tenant=test",
"sessionId": "415c340b-5996-4112-bb3b-38139a409f93",
"email": "[email protected]",
"legalEntityId": "53ac81fd0cce8b26b36f3492"
}
Your Emporix tenant's name.
Note: The tenant should always be written in lowercase.
^[a-z][a-z0-9]+$
The authorization code received from the identity provider.
The redirect URI that was used in the initial authorization request.
Required only if using PKCE (Proof Key for Code Exchange) flow.
Anonymous customer's unique session identifier.
POST /customer/{tenant}/socialLogin HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"social_access_token": "text",
"social_id_token": "text",
"refresh_token": "text",
"refresh_token_expires_in": "text",
"session_idle_time": 1,
"token_type": "text",
"access_token": "text",
"saas_token": "text",
"expires_in": "text",
"scope": "text"
}
Was this helpful?