An object representing a session.
| Property | Type | Description |
|---|---|---|
| showPricesIncludingVat | boolean | Whether the price of an article has VAT included. |
| currency | string | The currency that the customer want prices to be shown in, as a three letter ISO 4217 code. |
| customer | integer | The unique identifier of the logged-in customer. |
| order | integer | The order that is connected to this session. |
Deletes the session with all its stored data.
| Code | Message | Description |
|---|---|---|
| -32602 | Invalid params | If the unique identifier of the session does not exist. |
Session.delete()
Fetches information about a session.
Which info to return. See Query language.
Session.get("showPricesIncludingVat")
Retreives data from an active cart (Order) tied to the current session.
| Parameter | Description |
|---|---|
| query | As to Order.get |
Order data or null if there is no cart in the session.
Session.getOrder("uid")
Fetches the JSON Schema which can be used for client-side validation.
Fetches a token for a customer's session. The session may be tied to a cart.
The token to be used as context parameter "session".
Session.getToken()
Sets session information. If the session has an order and the patch contains a currency, then the prices in the order (including rounding) are updated in the new currency.
| Parameter | Description |
|---|---|
| patch | An object containing the properties and values to set for the session. |
| query | A query specifying what to return after a successful set (optional). |
Session.set({
"currency": "EUR"
}, [
"currency"
])
Sets a new Customer on the session and associated orders.
The unique identifier of a Customer.
Session.setCustomer(12341234)