Aurora API: Customer Stats

Stats

Get

Deferred: No

This method is intended to allow third parties to collect statistical data related to a stores customers.

Example request:

<?xml version="1.0" encoding="utf-8"?>
<AuroraRequestEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Header>
        <AuthToken>...</AuthToken>
    </Header>
    <Requests>
        <Request>
            <Customer>
                <Stats>
                    <Get>
                        <RequestID>1</RequestID>
                        <CustomerID>1234</CustomerID>
                        <Stats>
                        	<Stat>
                        		<Type>CountOrders</Type>
                        		<Name>Order Count for a Year</Name>
                        		<Interval>P1Y</Interval>
							</Stat>
                        	<Stat>
                        		<Type>CountOrders</Type>
                        		<Name>Order Count for 30 Days</Name>
                        		<Interval>P30D</Interval>
							</Stat>
                        	<Stat>
                        		<Type>CountPaymentAttempts</Type>
                        		<Name>Payment Attempts for a Year</Name>
                        		<Interval>P1Y</Interval>
							</Stat>
						</Stats>
                    </Get>
                </Stats>
            </Customer>
        </Request>
    </Requests>
</AuroraRequestEnvelope>

Example response:

<?xml version="1.0" encoding="utf-8"?>
 <AuroraResponseEnvelope>
     <Header>
         <Summary>
             <Ack>OK</Ack>
             <RequestsProcessed>1</RequestsProcessed>
             <RequestsSucceeded>1</RequestsSucceeded>
             <RequestErrors>0</RequestErrors>
         </Summary>
     </Header>
     <Responses>
         <Response>
             <RequestID>1</RequestID>
             <Ack>OK</Ack>
             <Data>
				<Stats>
					<Stat>
						<Type>CountOrders</Type>
						<Name>Order Count for a Year</Name>
						<Value>65</Value>
					</Stat>
					<Stat>
						<Type>CountOrders</Type>
						<Name>Order Count for 30 Days</Name>
						<Value>2</Value>
					</Stat>
					<Stat>
						<Type>CountPaymentAttempts</Type>
						<Name>Payment Attempts for a Year</Name>
						<Value>3</Value>
					</Stat>
				</Stats>
             </Data>
         </Response>
     </Responses>
</AuroraResponseEnvelope>

Request Fields

FieldValuesAPI VersionDescriptionRequired
Customer IDInteger1.5+The Internal ID Aurora uses to identify a Customer. Stats can only be returned for valid customers found in the Aurora database and will be rejected if a customer record cannot be found.Yes
StatsContainer1.5+Contains one or more "Stat" elements to describe what statistics to return.Yes
Stats.StatContainer1.5+Contains a type, name and interval - to describe what statistics to return.Yes - One or More
Stats.Stat.TypeRestricted String1.5+This is the name of the type of statistic you would like to fetch for the Customer ID provided.

To find out what values are permitted here, please refer to the API's XSD file, which can be found on your API URL at http://api_url/api_version/aurora.xsd, or see the Stat Types section of this article.
Yes
Stats.Stat.NameString1.5+This field is used for your own personal reference only, and is not used by Aurora. It is returned when retrieving the values in the API response, allowing you to easily identify what each value from the response represents.Yes
Stats.Stat.IntervalString1.5+Used to select the date/time range from now into the past over which the stats should be generated:

P indicates the period (required)

nY indicates the number of years

nM indicates the number of months

nD indicates the number of days

T indicates the start of a time section (required if you are going to specify hours, minutes, or seconds)

nH indicates the number of hours

nM indicates the number of minutes

nS indicates the number of seconds
No
Stat Types

The "Stats.Stat.Type" element can have any one of the following values.

FieldDescription
CountOrdersReturns a count of the number of orders placed by a Customer within the Interval specified.
CountTransactionsReturns a count of the number of successful Payments made by a Customer within the Interval specified (this may differ where multiple transactions were placed for an order).
CountPaymentAttemptsReturns a count of the number of successful and unsuccessful Payment Attempts placed by a Customer within the Interval specified.

Response Fields

FieldValuesAPI VersionDescriptionRequired
StatsContainer1.5+Contains one or more "Stat" elements.Yes
Stats.StatContainer1.5+Contains type, name and value elements.Yes - One or More
Stats.Stat.TypeRestricted String1.5+This is the name of the type of statistic being returned for the Customer ID provided.

To find out what values can be returned here, please refer to the API's XSD file, which can be found on your API URL at http://api_url/api_version/aurora.xsd'
Yes
Stats.Stat.NameString1.5+This field is used for your own personal reference only, and is not used by Aurora.

It is returned when retrieving the values in the API response, allowing you to easily identify what each value from the response represents.
Yes
Stats.Stat.ValueString1.5+This is the value generated for the Stat requested.No