| Requires any of the roles: | Admin, TeamAdmin | Requires the permission: | ReadData |
| POST | /TransferTicketToEvent | Transfer a ticket to a different event with automatic price reconciliation |
|---|
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 TransferRefundInstruction:
amount_isk: Optional[Decimal] = None
payment_reference: Optional[str] = None
instruction: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TransferTopupInstruction:
amount_isk: Optional[Decimal] = None
payment_link_url: Optional[str] = None
session_token: Optional[str] = None
expires_at: Optional[datetime.datetime] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TransferQuoteEventSide:
event_id: Optional[int] = None
event_name: Optional[str] = None
time_of_event: Optional[datetime.datetime] = None
ticket_price: Optional[Decimal] = None
payment_method_id: Optional[str] = None
payment_reference: Optional[str] = None
available_seats: Optional[int] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TransferTicketQuoteResult:
ok: Optional[bool] = None
status_code: Optional[int] = None
code: Optional[str] = None
message: Optional[str] = None
from_: Optional[TransferQuoteEventSide] = field(metadata=config(field_name='from'), default=None)
to: Optional[TransferQuoteEventSide] = None
price_difference: Optional[Decimal] = None
direction: Optional[str] = None
refundable_via_borgun: Optional[bool] = None
after_payout: Optional[bool] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TransferTicketToEventResult:
ok: Optional[bool] = None
status_code: Optional[int] = None
code: Optional[str] = None
message: Optional[str] = None
transfer_log_id: Optional[int] = None
new_ticket_token_id: Optional[str] = None
direction: Optional[str] = None
price_difference: Optional[Decimal] = None
original_ticket_price: Optional[Decimal] = None
target_ticket_price: Optional[Decimal] = None
source_event_paid_out: Optional[bool] = None
outstanding_cost_handled_by_server: Optional[bool] = None
refund: Optional[TransferRefundInstruction] = None
topup: Optional[TransferTopupInstruction] = None
quote: Optional[TransferTicketQuoteResult] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class TransferTicketToEventRequest:
ticket_token_id: Optional[str] = None
to_event_id: Optional[int] = None
user_id: Optional[int] = None
reason: Optional[str] = None
idempotency_key: Optional[str] = None
expected_price_difference: Optional[Decimal] = None
to_owner_ticket_type_id: Optional[int] = None
to_series_ticket_type_id: Optional[int] = None
to_seat_id: Optional[int] = None
Python TransferTicketToEventRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /TransferTicketToEvent HTTP/1.1
Host: stubbur-app.azurewebsites.net
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<TransferTicketToEventRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<ExpectedPriceDifference>0</ExpectedPriceDifference>
<IdempotencyKey>String</IdempotencyKey>
<Reason>String</Reason>
<TicketTokenId>String</TicketTokenId>
<ToEventId>0</ToEventId>
<ToOwnerTicketTypeId>0</ToOwnerTicketTypeId>
<ToSeatId>0</ToSeatId>
<ToSeriesTicketTypeId>0</ToSeriesTicketTypeId>
<UserId>0</UserId>
</TransferTicketToEventRequest>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<TransferTicketToEventResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/TicketUserServices.ServiceModel">
<Code>String</Code>
<Direction>String</Direction>
<Message>String</Message>
<NewTicketTokenId>String</NewTicketTokenId>
<Ok>false</Ok>
<OriginalTicketPrice>0</OriginalTicketPrice>
<OutstandingCostHandledByServer>false</OutstandingCostHandledByServer>
<PriceDifference>0</PriceDifference>
<Quote>
<AfterPayout>false</AfterPayout>
<Code>String</Code>
<Direction>String</Direction>
<From>
<AvailableSeats>0</AvailableSeats>
<EventId>0</EventId>
<EventName>String</EventName>
<PaymentMethodId>String</PaymentMethodId>
<PaymentReference>String</PaymentReference>
<TicketPrice>0</TicketPrice>
<TimeOfEvent>0001-01-01T00:00:00</TimeOfEvent>
</From>
<Message>String</Message>
<Ok>false</Ok>
<PriceDifference>0</PriceDifference>
<RefundableViaBorgun>false</RefundableViaBorgun>
<StatusCode>0</StatusCode>
<To>
<AvailableSeats>0</AvailableSeats>
<EventId>0</EventId>
<EventName>String</EventName>
<PaymentMethodId>String</PaymentMethodId>
<PaymentReference>String</PaymentReference>
<TicketPrice>0</TicketPrice>
<TimeOfEvent>0001-01-01T00:00:00</TimeOfEvent>
</To>
</Quote>
<Refund>
<AmountIsk>0</AmountIsk>
<Instruction>String</Instruction>
<PaymentReference>String</PaymentReference>
</Refund>
<SourceEventPaidOut>false</SourceEventPaidOut>
<StatusCode>0</StatusCode>
<TargetTicketPrice>0</TargetTicketPrice>
<Topup>
<AmountIsk>0</AmountIsk>
<ExpiresAt>0001-01-01T00:00:00</ExpiresAt>
<PaymentLinkUrl>String</PaymentLinkUrl>
<SessionToken>String</SessionToken>
</Topup>
<TransferLogId>0</TransferLogId>
</TransferTicketToEventResult>