State API

Overview

This document outlines the purpose, technology, methods and objects for using the State API.

Purpose

This API provides access to basic state information about the current users' session.

Endpoint

The State API endpoint for any site is located at http://[siteurl]/api/state.

This endpoint is enabled for access via HTTP GET.

GET api/state

Request Information

URI Parameters

None

Body Parameters

None

Response Information

Resource Description

Name Type Description
CurrencystringCurrency ID.
DisplayStatestringDisplay State ID.
EmailstringEmail address of the current user.
ExchangeRatestringExchange rate of the current order (in base currency).
FirstNamestringGiven name of the current user.
ItemCountstringThe total number of items in the current order.
LoggedInstringDefines whether the current user has logged in (true) or not (false)
OrderValuestringTotal value of the current order.
SurnamestringSurname of the current user.
WebsiteIDstringWebsite ID.

Response Formats

application/json, text/json

Sample:
{
	"Currency": "554",
	"DisplayState": "1",
	"Email": "[email protected]",
	"ExchangeRate": "1.000"
	"FirstName": "Example",
	"ItemCount": "1",
	"LoggedIn": "true",
	"OrderValue": "17.5000",
	"Surname": "Example",
	"WebsiteID": "1"
}
						

application/xml, text/xml

Sample:
<State xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Estaronline.Web.Consumer.State">
	<Currency>554</Currency>
	<DisplayState>1</DisplayState>
	<Email>[email protected]</Email>
	<ExchangeRate>1.000</ExchangeRate>
	<Firstname>Example</Firstname>
	<ItemCount>1</ItemCount>
	<LoggedIn>True/<LoggedIn>
	<OrderValue>17.5000</OrderValue>
	<Surname>Example</Surname>
	<WebsiteID>1</WebsiteID>
</<State>