Tournament Tickets
An admin_token must include the following claims:
- id | uid | sub- At least one of these claims must be present.
- Can be either an integeror astring.
 
- role- Must be present.
- Must be set to adminfor any administrative action.
 
    
    
// Example
{
  id: "admin",
  role: "admin"
}
Creating tickets
Creates tickets based on request data.
Endpoint: https://customer-game.api.scoutgg(-stg).net/tournament_tickets
    
    
// Request:
{
    method: 'POST',
    headers: {
        authorization: 'Bearer customer {admin_token}'
    },
    body: {
        tournamentTicket: {
            kind: String, // Type of ticket: marketing (default), godwill, satellite, test, billable
            tournamentId: Integer <optional>, // ID of target tournament
            uids: [String], // array of userIds on client side
            seasonId: <Integer> <optional>, // Limit ticket to given season
            dueAt: String <ISO8601>, // Datetime until ticket is valid
            currency: String, // Currency of ticket (eg. EUR)
            buyIn: Decimal, // Stack for non-tournament tickets or Cost of ticket
            comment: String <optional>, // some notes related to tickets
            ref: String <UUID> <optional>, // UUID to group tickets, automatically generated if not passed
        }
    }
}
// Successful Response:
{
    status: 200
    body: {
        total: Integer, // count of created tickets,
        ids: [Integer], // array containing ids of all generated tickets
        tickets: [{
            id: Integer, // ID of ticket
            uid: String, // UID of related user
        }],
    }
}
// Failed Response:
{
    status: 422,
    body: {
        message: String, // error is translation key format
        error: String, // descriptive error message
    }
}
List Tickets
Lists tickets matching the given filters. Returned list is always sorted by ticketId in descending order.
Endpoint: https://customer-game.api.scoutgg(-stg).net/tournament_tickets
    
    
// Request:
{
    method: 'GET',
    headers: {
        authorization: 'Bearer customer {admin_token}'
    },
    query: {
        user_id: String <optional>, // Filter tickets belonging to given user
        ids: [Integer] <optional>, // when passed filters tickets by ID
        ref: String <optional>, // When passed filters tickets by ref
        limit: Integer <optional>, // size of page, default: 50
        page: Integer <optional>, // page number (0 based) default: 0
    }
}
// Successful Response:
{
    status: 200
    body: {
        total: Integer, // count of matching tickets
        tournamentTickets: [{
            id: Integer,
            type: String,
            currency: String,
            tournamentId: Integer,
            buyIn: Decimal,
            createdAt: String<ISO8601>,
            fantasyTeamId: Integer, // ID of team in case ticket is used
            user: {
                id: Integer, // internal userID
                uid: String, // userID on client side
                name: String
            },
            // and many other fields
        }],
    }
}
Delete Ticket
Deletes a ticket if it has not been used already.
Endpoint: https://customer-game.api.scoutgg(-stg).net/tournament_tickets/:id
    
    
// Request:
{
    method: 'DELETE',
    headers: {
        authorization: 'Bearer customer {admin_token}'
    },
    params: {
        id: Integer // ID of ticket to be deleted
    }
}
// Successful Response:
{
    status: 200
    body: {
        ticket: {
            id: Integer,
            type: String,
            currency: String,
            tournamentId: Integer,
            buyIn: Decimal,
            createdAt: String<ISO8601>,
            // and many other fields
        }
    }
}
// Failed Response:
{
    status: 403, // in case ticket is used or not available for deletion
    body: {
        message: String, // error is translation key format
        error: String, // descriptive error message
    }
}