Authentication and authorization

Creating a new customer

post

Creates a new customer account.

Note: The request needs to be authorized with an anonymous access token.


Required scopes

No specific scopes are required.

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Body
emailstring · min: 1Required

Customer's email address.

Example: [email protected]
passwordstring · min: 1Required

Customer's account password.

customerDetailsall ofOptional
Responses
201
Created
application/json
post
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"
}

Logging in a customer

post

Logs in a customer and sends an authentication request and retrieves a customer token.

Note: The request needs to be authorized with an anonymous access token.


Required scopes

No specific scopes are required.

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Body
emailstringRequired

Customer's email address.

passwordstringRequired

Customer's account password.

Responses
200
OK
application/json
post
POST /customer/{tenant}/login HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 57

{
  "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"
}

Logging out a customer

get

Logs out a customer and invalidates their customer token.

Note: The request needs to be authorized with a customer's access token.


Required scopes

No specific scopes are required.

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
accessTokenstringRequired

Customer's access token to be invalidated.

Responses
204
No Content
get
GET /customer/{tenant}/logout HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Refreshing a customer token

get

Refreshes a customer's access token.

Note: The request needs to be authorized with an anonymous access token.


Required scopes

No specific scopes are required.

Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
refreshTokenstringRequired

Customer's refresh token generated when a customer token is requested.

Responses
200
OK
application/json
get
GET /customer/{tenant}/refreshauthtoken HTTP/1.1
Host: api.emporix.io
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"
}

Logging in a customer with social login

post

Logs in a customer using an authentication code from Auth0 and retrieves a standard customer token.


Required scopes

No specific scopes are required.

Authorizations
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant's name.

Note: The tenant should always be written in lowercase.

Pattern: ^[a-z][a-z0-9]+$
Query parameters
codestringRequired

The authorization code received from the identity provider.

redirect_uristringRequired

The redirect URI that was used in the initial authorization request.

code_verifierstringOptional

Required only if using PKCE (Proof Key for Code Exchange) flow.

Header parameters
session-idstringOptional

Anonymous customer's unique session identifier.

Responses
200
OK
application/json
post
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?