Own session management

Retrieving own session context

get

Retrieves a session context associated with the sessionId derived from the Authorization token used in the call. Recommended for performing calls on the storefront.

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]+$
Responses
200

The request was successful. Session context details are returned.

application/json
Responseall of
get
/session-context/{tenant}/me/context
GET /session-context/{tenant}/me/context 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"
  }
}

Partially updating own session context

patch

Partially updates a session context associated with the sessionId derived from the Authorization token used in the call. Recommended for performing calls on the storefront.

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

Note: Only specific fields can be updated this way, and the rest is ignored. The fields allowed to be updated: siteCode, currency, targetLocation, context.

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]+$
Body
all ofOptional
Responses
patch
/session-context/{tenant}/me/context
PATCH /session-context/{tenant}/me/context 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?