Own Session Management
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.
Customer or anonymous access token. Use the token obtained from the storefront session (e.g. Requesting an anonymous token or Logging in a customer).
Your Emporix tenant name.
Note: The tenant name should always be provided in lowercase.
^[a-z][a-z0-9]+$The request was successful. Session context details are returned.
Unique identifier of the customer's session.
62528895-b561-4518-bfdc-2cbf52a07845Customer unique identifier.
Note: This field is only applicable to logged-in customers.
C87362407845Code 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.
mainThree-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.
EURUnique identifier of the active customer cart, generated when the cart is created through the Cart Service.
61079711ce0eb90861357045The 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.
DELanguage associated with the session.
DEA session context with the provided ID was not found.
A server-side error occurred.
GET /session-context/{tenant}/me/context HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"sessionId": "62528895-b561-4518-bfdc-2cbf52a07845",
"customerId": "C87362407845",
"siteCode": "main",
"currency": "EUR",
"cartId": "61079711ce0eb90861357045",
"targetLocation": "DE",
"language": "DE",
"context": {
"customObject": {
"property1": "value1",
"property2": "value2"
},
"customProperty": "customValue"
},
"metadata": {
"version": 1,
"createdAt": "text",
"modifiedAt": "text"
}
}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, language, context.
Customer or anonymous access token. Use the token obtained from the storefront session (e.g. Requesting an anonymous token or Logging in a customer).
Your Emporix tenant name.
Note: The tenant name should always be provided in lowercase.
^[a-z][a-z0-9]+$Request body for partially updating own session context (PATCH /me/context). Only the following fields can be updated; all other fields are ignored.
Code of the site, as defined in the Site Settings Service.
mainThree-letter currency code, as defined in the Currency Service.
EURThe country code, as defined in the country service.
DELanguage associated with the session.
DEThe request was successful. The session context has been updated.
No content
A session context with the provided ID was not found.
A server-side error occurred.
PATCH /session-context/{tenant}/me/context HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 201
{
"siteCode": "main",
"currency": "EUR",
"targetLocation": "DE",
"language": "DE",
"context": {
"customObject": {
"property1": "value1",
"property2": "value2"
},
"customProperty": "customValue"
},
"metadata": {
"version": 1
}
}No content
Last updated
Was this helpful?

