TicketUserServices

<back to all web services

SalesOverviewRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequired permission:Sales.Total
The following routes are available for this service:
POST/sales/overview
import Foundation
import ServiceStack

public class SalesOverviewRequest : Codable
{
    public var eventOwnerId:Int?
    public var additionalOwnerIds:[Int] = []
    public var eventId:Int?
    public var fromUtc:Date?
    public var toUtc:Date?
    public var compareFromUtc:Date?
    public var compareToUtc:Date?
    public var bucket:String?
    public var topEventsLimit:Int?
    public var recentOrdersLimit:Int?

    required public init(){}
}

public class SalesOverviewResult : Codable
{
    public var current:SalesKpis?
    public var previous:SalesKpis?
    public var delta:SalesDeltas?
    public var trend:[SalesTrendBucket] = []
    public var previousTrend:[SalesTrendBucket] = []
    public var topEvents:[SalesTopEvent] = []
    public var recentOrders:[SalesRecentOrder] = []
    public var byHourOfDay:[SalesHourBucket] = []
    public var byDayOfWeek:[SalesDowBucket] = []
    public var topProducts:[SalesProduct] = []
    public var hasAnyDataEver:Bool?
    public var owners:[Int] = []
    public var bucket:String?
    public var freshnessUtc:Date?
    public var statusCode:Int?
    public var message:String?

    required public init(){}
}

public class SalesKpis : Codable
{
    public var grossNet:Double?
    public var refunded:Double?
    public var ticketsAllReal:Int?
    public var ticketsPaid:Int?
    public var orders:Int?
    public var aov:Double?

    required public init(){}
}

public class SalesDeltas : Codable
{
    public var grossNet:KpiDelta?
    public var refunded:KpiDelta?
    public var ticketsAllReal:KpiDelta?
    public var ticketsPaid:KpiDelta?
    public var orders:KpiDelta?
    public var aov:KpiDelta?

    required public init(){}
}

public class KpiDelta : Codable
{
    public var abs:Double?
    public var pct:Double?
    public var dir:String?

    required public init(){}
}

public class SalesTrendBucket : Codable
{
    public var bucket:Date?
    public var revenue:Double?
    public var tickets:Int?

    required public init(){}
}

public class SalesTopEvent : Codable
{
    public var eventId:Int?
    public var eventName:String?
    public var eventDate:Date?
    public var grossNet:Double?
    public var paidTickets:Int?
    public var realTickets:Int?
    public var orders:Int?

    required public init(){}
}

public class SalesRecentOrder : Codable
{
    public var ticketId:Int?
    public var createdAt:Date?
    public var eventName:String?
    public var amount:Double?
    public var ticketCount:Int?
    public var buyerName:String?

    required public init(){}
}

public class SalesHourBucket : Codable
{
    public var hour:Int?
    public var revenue:Double?
    public var orders:Int?
    public var tickets:Int?

    required public init(){}
}

public class SalesDowBucket : Codable
{
    public var dow:Int?
    public var revenue:Double?
    public var orders:Int?
    public var tickets:Int?

    required public init(){}
}

public class SalesProduct : Codable
{
    public var ticketName:String?
    public var tickets:Int?
    public var revenue:Double?
    public var orders:Int?

    required public init(){}
}


Swift SalesOverviewRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /sales/overview HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<SalesOverviewRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <AdditionalOwnerIds xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </AdditionalOwnerIds>
  <Bucket>String</Bucket>
  <CompareFromUtc>0001-01-01T00:00:00</CompareFromUtc>
  <CompareToUtc>0001-01-01T00:00:00</CompareToUtc>
  <EventId>0</EventId>
  <EventOwnerId>0</EventOwnerId>
  <FromUtc>0001-01-01T00:00:00</FromUtc>
  <RecentOrdersLimit>0</RecentOrdersLimit>
  <ToUtc>0001-01-01T00:00:00</ToUtc>
  <TopEventsLimit>0</TopEventsLimit>
</SalesOverviewRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<SalesOverviewResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
  <Bucket>String</Bucket>
  <ByDayOfWeek>
    <SalesDowBucket>
      <Dow>0</Dow>
      <Orders>0</Orders>
      <Revenue>0</Revenue>
      <Tickets>0</Tickets>
    </SalesDowBucket>
  </ByDayOfWeek>
  <ByHourOfDay>
    <SalesHourBucket>
      <Hour>0</Hour>
      <Orders>0</Orders>
      <Revenue>0</Revenue>
      <Tickets>0</Tickets>
    </SalesHourBucket>
  </ByHourOfDay>
  <Current>
    <Aov>0</Aov>
    <GrossNet>0</GrossNet>
    <Orders>0</Orders>
    <Refunded>0</Refunded>
    <TicketsAllReal>0</TicketsAllReal>
    <TicketsPaid>0</TicketsPaid>
  </Current>
  <Delta>
    <Aov>
      <Abs>0</Abs>
      <Dir>String</Dir>
      <Pct>0</Pct>
    </Aov>
    <GrossNet>
      <Abs>0</Abs>
      <Dir>String</Dir>
      <Pct>0</Pct>
    </GrossNet>
    <Orders>
      <Abs>0</Abs>
      <Dir>String</Dir>
      <Pct>0</Pct>
    </Orders>
    <Refunded>
      <Abs>0</Abs>
      <Dir>String</Dir>
      <Pct>0</Pct>
    </Refunded>
    <TicketsAllReal>
      <Abs>0</Abs>
      <Dir>String</Dir>
      <Pct>0</Pct>
    </TicketsAllReal>
    <TicketsPaid>
      <Abs>0</Abs>
      <Dir>String</Dir>
      <Pct>0</Pct>
    </TicketsPaid>
  </Delta>
  <FreshnessUtc>0001-01-01T00:00:00</FreshnessUtc>
  <HasAnyDataEver>false</HasAnyDataEver>
  <Message>String</Message>
  <Owners xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:int>0</d2p1:int>
  </Owners>
  <Previous>
    <Aov>0</Aov>
    <GrossNet>0</GrossNet>
    <Orders>0</Orders>
    <Refunded>0</Refunded>
    <TicketsAllReal>0</TicketsAllReal>
    <TicketsPaid>0</TicketsPaid>
  </Previous>
  <PreviousTrend>
    <SalesTrendBucket>
      <Bucket>0001-01-01T00:00:00</Bucket>
      <Revenue>0</Revenue>
      <Tickets>0</Tickets>
    </SalesTrendBucket>
  </PreviousTrend>
  <RecentOrders>
    <SalesRecentOrder>
      <Amount>0</Amount>
      <BuyerName>String</BuyerName>
      <CreatedAt>0001-01-01T00:00:00</CreatedAt>
      <EventName>String</EventName>
      <TicketCount>0</TicketCount>
      <TicketId>0</TicketId>
    </SalesRecentOrder>
  </RecentOrders>
  <StatusCode>0</StatusCode>
  <TopEvents>
    <SalesTopEvent>
      <EventDate>0001-01-01T00:00:00</EventDate>
      <EventId>0</EventId>
      <EventName>String</EventName>
      <GrossNet>0</GrossNet>
      <Orders>0</Orders>
      <PaidTickets>0</PaidTickets>
      <RealTickets>0</RealTickets>
    </SalesTopEvent>
  </TopEvents>
  <TopProducts>
    <SalesProduct>
      <Orders>0</Orders>
      <Revenue>0</Revenue>
      <TicketName>String</TicketName>
      <Tickets>0</Tickets>
    </SalesProduct>
  </TopProducts>
  <Trend>
    <SalesTrendBucket>
      <Bucket>0001-01-01T00:00:00</Bucket>
      <Revenue>0</Revenue>
      <Tickets>0</Tickets>
    </SalesTrendBucket>
  </Trend>
</SalesOverviewResult>