TicketUserServices

<back to all web services

PreviewDiscountRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdmin, MobileAppRequires the permission:ReadData
The following routes are available for this service:
POST/ticketOrder/previewDiscount

export class LocalizedMessage
{
    public is?: string;
    public en?: string;

    public constructor(init?: Partial<LocalizedMessage>) { (Object as any).assign(this, init); }
}

export class DiscountSummary
{
    public type?: string;
    public value?: number;

    public constructor(init?: Partial<DiscountSummary>) { (Object as any).assign(this, init); }
}

export class DiscountLineResult
{
    public ticketTypeId?: number;
    public count?: number;
    public applied?: boolean;
    public unitBefore?: number;
    public unitAfter?: number;
    public lineBefore?: number;
    public lineAfter?: number;

    public constructor(init?: Partial<DiscountLineResult>) { (Object as any).assign(this, init); }
}

export class PreviewDiscountResult
{
    public status?: string;
    public reason?: string;
    public message?: LocalizedMessage;
    public discountCodeId?: number;
    public discountCodeTypeId?: number;
    public discount?: DiscountSummary;
    public lines?: DiscountLineResult[];
    public subtotalBefore?: number;
    public subtotalAfter?: number;
    public totalSavings?: number;
    public currency?: string;
    public statusCode?: number;

    public constructor(init?: Partial<PreviewDiscountResult>) { (Object as any).assign(this, init); }
}

export class TicketDetails
{
    public id?: number;
    public ticketId?: number;
    public eventSeriesTicketType?: number;
    public eventSeriesOwnerTicketType?: number;
    public ticketPrice?: number;
    public totalPrice?: number;
    public count?: number;
    public ticketColor?: string;
    public showUsedTickets?: boolean;
    public ticketName?: string;
    public ticketDisplayString?: string;
    public ticketDetailsTransferredFrom?: number;
    public teamPassId?: number;
    public isSpecialTicket?: boolean;
    public specialTicketId?: string;
    public justChangedBySQL?: boolean;
    public sqlJustChangedTimeStamp?: string;
    public currency?: string;
    public discountCode?: string;
    public totalDiscount?: number;
    public totalAmountBeforeDiscount?: number;
    public ticketPriceBeforeDiscount?: number;

    public constructor(init?: Partial<TicketDetails>) { (Object as any).assign(this, init); }
}

export class PreviewDiscountRequest
{
    public code?: string;
    public eventId?: number;
    public fullPhoneNumber?: string;
    public orderDetails?: TicketDetails[];

    public constructor(init?: Partial<PreviewDiscountRequest>) { (Object as any).assign(this, init); }
}

TypeScript PreviewDiscountRequest DTOs

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

HTTP + JSV

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

POST /ticketOrder/previewDiscount HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	code: String,
	eventId: 0,
	fullPhoneNumber: String,
	orderDetails: 
	[
		{
			id: 0,
			ticketId: 0,
			eventSeriesTicketType: 0,
			eventSeriesOwnerTicketType: 0,
			ticketPrice: 0,
			totalPrice: 0,
			count: 0,
			ticketColor: String,
			showUsedTickets: False,
			ticketName: String,
			ticketDisplayString: String,
			ticketDetailsTransferredFrom: 0,
			teamPassId: 0,
			isSpecialTicket: False,
			specialTicketId: String,
			justChangedBySQL: False,
			sqlJustChangedTimeStamp: 0001-01-01,
			currency: String,
			discountCode: String,
			totalDiscount: 0,
			totalAmountBeforeDiscount: 0,
			ticketPriceBeforeDiscount: 0
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	status: String,
	reason: String,
	message: 
	{
		is: String,
		en: String
	},
	discountCodeId: 0,
	discountCodeTypeId: 0,
	discount: 
	{
		type: String,
		value: 0
	},
	lines: 
	[
		{
			ticketTypeId: 0,
			count: 0,
			applied: False,
			unitBefore: 0,
			unitAfter: 0,
			lineBefore: 0,
			lineAfter: 0
		}
	],
	subtotalBefore: 0,
	subtotalAfter: 0,
	totalSavings: 0,
	currency: String,
	statusCode: 0
}