TicketUserServices

<back to all web services

RefundRequest

Requires Authentication
Requires any of the roles:Admin, TeamAdminRequires the permission:Tickets.Add
The following routes are available for this service:
POST/refund/process
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 RefundOrderOutcome:
    status: Optional[str] = None
    payment_reference: Optional[str] = None
    payment_id: Optional[str] = None
    event_id: Optional[int] = None
    event_name: Optional[str] = None
    holder_name: Optional[str] = None
    holder_email: Optional[str] = None
    amount_refunded: Optional[Decimal] = None
    partial: Optional[bool] = None
    ticket_token_ids: Optional[List[str]] = None
    freed_seat_ids: Optional[List[int]] = None
    borgun_refund_transaction_id: Optional[str] = None
    message: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RefundResult:
    success: Optional[bool] = None
    status_code: Optional[int] = None
    message: Optional[str] = None
    refunded_count: Optional[int] = None
    skipped_count: Optional[int] = None
    failed_count: Optional[int] = None
    total_refunded: Optional[Decimal] = None
    outcomes: Optional[List[RefundOrderOutcome]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RefundRequest:
    event_id: Optional[int] = None
    refund_all_for_event: Optional[bool] = None
    ticket_token_ids: Optional[List[str]] = None
    payment_references: Optional[List[str]] = None
    reason: Optional[str] = None
    user_id: Optional[int] = None

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

{
	eventId: 0,
	refundAllForEvent: False,
	ticketTokenIds: 
	[
		String
	],
	paymentReferences: 
	[
		String
	],
	reason: String,
	userId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	success: False,
	statusCode: 0,
	message: String,
	refundedCount: 0,
	skippedCount: 0,
	failedCount: 0,
	totalRefunded: 0,
	outcomes: 
	[
		{
			status: String,
			paymentReference: String,
			paymentId: String,
			eventId: 0,
			eventName: String,
			holderName: String,
			holderEmail: String,
			amountRefunded: 0,
			partial: False,
			ticketTokenIds: 
			[
				String
			],
			freedSeatIds: 
			[
				0
			],
			borgunRefundTransactionId: String,
			message: String
		}
	]
}