TicketUserServices

<back to all web services

OwnerCardsUpgradeQuoteRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequires the permission:ReadData
The following routes are available for this service:
POST/OrderOwnerCards/upgrade/quoteSide-effect-free price of an owner-card upgrade: the exact delta POST /OrderOwnerCards/upgrade will charge
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 OwnerCardUpgradeResultBase:
    status_code: Optional[int] = None
    message: Optional[str] = None
    reason: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OwnerCardsUpgradeQuoteResult(OwnerCardUpgradeResultBase):
    source_owner_card_id: Optional[int] = None
    source_owner_card_type_id: Optional[int] = None
    source_type_name: Optional[str] = None
    target_owner_card_type_id: Optional[int] = None
    target_type_name: Optional[str] = None
    price_paid_original: Optional[int] = None
    target_price: Optional[int] = None
    price_total: Optional[int] = None
    discount_amount: Optional[int] = None
    gift_card_amount: Optional[int] = None
    donation_amount: Optional[int] = None
    transaction_fee: Optional[int] = None
    charged_amount: Optional[int] = None
    charged_amount_minor: Optional[int] = None
    fully_covered: Optional[bool] = None
    valid_from_u_t_c: Optional[datetime.datetime] = None
    valid_to_u_t_c: Optional[datetime.datetime] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OrderTender:
    kind: Optional[str] = None
    code: Optional[str] = None
    amount_minor: Optional[int] = None
    idempotency_key: Optional[str] = None
    hold_id: Optional[int] = None
    applied_minor: Optional[int] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class OwnerCardsUpgradeQuoteRequest:
    buyer_phone: Optional[str] = None
    source_owner_card_id: Optional[int] = None
    target_owner_card_type_id: Optional[int] = None
    tenders: Optional[List[OrderTender]] = None

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

{
	buyerPhone: String,
	sourceOwnerCardId: 0,
	targetOwnerCardTypeId: 0,
	tenders: 
	[
		{
			kind: String,
			code: String,
			amountMinor: 0,
			idempotencyKey: String,
			holdId: 0,
			appliedMinor: 0
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	sourceOwnerCardId: 0,
	sourceOwnerCardTypeId: 0,
	sourceTypeName: String,
	targetOwnerCardTypeId: 0,
	targetTypeName: String,
	pricePaidOriginal: 0,
	targetPrice: 0,
	priceTotal: 0,
	discountAmount: 0,
	giftCardAmount: 0,
	donationAmount: 0,
	transactionFee: 0,
	chargedAmount: 0,
	chargedAmountMinor: 0,
	fullyCovered: False,
	validFromUTC: 0001-01-01,
	validToUTC: 0001-01-01,
	statusCode: 0,
	message: String,
	reason: String
}