TicketUserServices

<back to all web services

OwnerCardsPreviewDiscountRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdmin, MobileApp, Admin, TeamAdmin, MobileAppRequires any of the permissions:ReadData, ReadData
The following routes are available for this service:
POST/OrderOwnerCards/previewDiscount
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class LocalizedMessage:
    is_: Optional[str] = field(metadata=config(field_name='is'), default=None)
    en: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DiscountSummary:
    type: Optional[str] = None
    value: Optional[Decimal] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class DiscountLineResult:
    ticket_type_id: Optional[int] = None
    count: Optional[int] = None
    applied: Optional[bool] = None
    unit_before: Optional[Decimal] = None
    unit_after: Optional[Decimal] = None
    line_before: Optional[Decimal] = None
    line_after: Optional[Decimal] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class PreviewDiscountResult:
    status: Optional[str] = None
    reason: Optional[str] = None
    message: Optional[LocalizedMessage] = None
    discount_code_id: Optional[int] = None
    discount_code_type_id: Optional[int] = None
    discount: Optional[DiscountSummary] = None
    lines: Optional[List[DiscountLineResult]] = None
    subtotal_before: Optional[Decimal] = None
    subtotal_after: Optional[Decimal] = None
    total_savings: Optional[Decimal] = None
    currency: Optional[str] = None
    status_code: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OwnerCardsPreviewDiscountRequest:
    code: Optional[str] = None
    owner_card_type_ids: Optional[List[int]] = None
    full_phone_number: Optional[str] = None
    is_subscription: Optional[bool] = None

Python OwnerCardsPreviewDiscountRequest 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 /OrderOwnerCards/previewDiscount HTTP/1.1 
Host: stubbur-app.azurewebsites.net 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	code: String,
	ownerCardTypeIds: 
	[
		0
	],
	fullPhoneNumber: String,
	isSubscription: False
}
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
}