Session management

Retrieving a session context

get

Retrieves a specified session context. Recommended for performing calls on the management side.

Required scopes
This endpoint requires the following scopes:
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant name should always be provided in lowercase.

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

Customer session ID.

Responses
200

The request was successful. Session context details are returned.

application/json
Responseall of
get
/session-context/{tenant}/context/{sessionId}
GET /session-context/{tenant}/context/{sessionId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "sessionId": "62528895-b561-4518-bfdc-2cbf52a07845",
  "customerId": "C87362407845",
  "siteCode": "main",
  "currency": "EUR",
  "cartId": "61079711ce0eb90861357045",
  "targetLocation": "DE",
  "context": {
    "Custom session attributes": {
      "": "string",
      "property1": {},
      "property2": {}
    }
  },
  "metadata": {
    "version": 1,
    "createdAt": "text",
    "modifiedAt": "text"
  }
}

Updating a session context

put

Updates a specified session context. Recommended for performing calls on the management side.

Note: To update a session context, you need to provide its current metadata.version value in the request body.

Required scopes
This endpoint requires the following scopes:
Authorizations
OAuth2clientCredentialsRequired
Token URL:
Path parameters
tenantstring · min: 3 · max: 16Required

Your Emporix tenant name.

Note: The tenant name should always be provided in lowercase.

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

Customer session ID.

Query parameters
upsertstringOptional
  • If set to true and the session with the specified id does not exist, the session will be created.
  • If set to false or not specified, a standard update will be performed.
Header parameters
saas-tokenstringOptional

Customer access token.

Note: This header is only required if the session context belongs to a logged-in customer. In that case, the value of the token and the customerId in the request body must belong to the same customer.

Body
all ofOptional
Responses
put
/session-context/{tenant}/context/{sessionId}
PUT /session-context/{tenant}/context/{sessionId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 198

{
  "sessionId": "62528895-b561-4518-bfdc-2cbf52a07845",
  "customerId": "C87362407845",
  "siteCode": "main",
  "currency": "EUR",
  "cartId": "61079711ce0eb90861357045",
  "targetLocation": "DE",
  "metadata": {
    "version": 1
  }
}

No content

Last updated

Was this helpful?