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. The session context is created when a cart is created; if none exists yet, the response is 404. Recommended for performing calls on the storefront.

Authorizations
AuthorizationstringRequired

Customer or anonymous access token. Use the token obtained from the storefront session (e.g. Requesting an anonymous token or Logging in a customer).

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
chevron-right
200

The request was successful. Session context details are returned.

application/json
sessionIdstringOptional

Unique identifier of the customer's session.

Example: 62528895-b561-4518-bfdc-2cbf52a07845
customerIdstringOptional

Customer unique identifier.

Note: This field is only applicable to logged-in customers.

Example: C87362407845
siteCodestringOptional

Code of the site, as defined in the Site Settings Service.

Note: The default country code for anonymous sessions is based on the home base address country of the default site. In the case of a logged-in customer session, the country code is derived from the customer's shipping address, with the billing address being used as a fallback if the former is not available. If both addresses are not set, the home base address country code from the default site is used.

Example: main
currencystringOptional

Three-letter currency code, as defined in the Currency Service.

Note: During an anonymous session, the default currency of the site serves as the initial currency. Whereas, for a user session, the customer's preferred currency is set as the initial currency.

Example: EUR
cartIdstringOptional

Unique identifier of the active customer cart, generated when the cart is created through the Cart Service.

Example: 61079711ce0eb90861357045
targetLocationstringOptional

The country code, as defined in the country service.

Note: The default country code for anonymous sessions is based on the home base address country of the default site. In the case of a logged-in customer session, the country code is derived from the customer's shipping address, with the billing address being used as a fallback if the former is not available. If both addresses are not set, the home base address country code from the default site is used.

Example: DE
get
/session-context/{tenant}/me/context

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
AuthorizationstringRequired

Customer or anonymous access token. Use the token obtained from the storefront session (e.g. Requesting an anonymous token or Logging in a customer).

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

Request body for partially updating own session context (PATCH /me/context). Only the following fields can be updated; all other fields are ignored.

siteCodestringOptional

Code of the site, as defined in the Site Settings Service.

Example: main
currencystringOptional

Three-letter currency code, as defined in the Currency Service.

Example: EUR
targetLocationstringOptional

The country code, as defined in the country service.

Example: DE
Responses
patch
/session-context/{tenant}/me/context

No content

Last updated

Was this helpful?