UNPKG

tickethead-sdk

Version:

SDK for the Tickethead API

108 lines 3.89 kB
import { AxiosInstance } from 'axios'; import { HealthStatus, IdParam, ListInfo, StatusResponse } from '../common/types'; import { Order, OrderRequest, OrderContact, OrderGet, OrderListQuery, RefundOrderBody, ConvertOrderBody, ResendTicketParams, TicketInOrderId } from './types'; /** * Service class for event API calls. Requires an organizer to be set (call to `useOrganizer`) */ export declare class OrderService { readonly client: AxiosInstance; readonly version: string; constructor(client: AxiosInstance, version: string); /** * Returns true if the service is reachable * Currently the * * @returns Services' online status */ health(): Promise<HealthStatus>; /** * Creates a ticket order * * @param req `OrderRequest` * @returns `Order` */ createOrder(req: OrderRequest): Promise<Order>; /** * Returns an order by it's ID * * @param req ID of the order * @returns `Order` */ getOrder(req: OrderGet): Promise<Order>; /** * Cancel an order by it's ID. Returns the tickets to the available ticket pool. * * @param req Order ID */ cancelOrder(req: IdParam): Promise<void>; /** * Removes a ticket identified by its ID from an order item in an order. * * @param req.id Ticket ID * @param req.orderId Order ID * @param req.orderItemId ID of the order item, in the order, where the ticket is. */ removeTicketFromOrder(req: TicketInOrderId): Promise<void>; /** * Downloads all tickets associated with an order * * @param req Request contains the ID of the order * @returns PDF document in binary format */ downloadTickets(req: IdParam): Promise<any>; /** * Downloads a single ticket from an order * * @param req.orderId Order ID * @param req.id Ticket ID * @returns PDF document in binary format */ downloadTicket(req: ResendTicketParams): Promise<any>; /** * Sends an email with the tickets belonging to the order. * * @param req Request contains the ID of the order */ sendOrderEmail(req: IdParam): Promise<void>; /** * Sends an email with the tickets belonging to the order. * Invocable by an organizer * * @param req Request contains the ID of the order */ adminOrderEmailResend(req: IdParam): Promise<void>; /** * Creates and assigns an order contact for a particular order * * @param orderId Id of the order * @param orderContact Order contact details * @returns Created order contact */ createOrderContact(orderId: IdParam, orderContact: OrderContact): Promise<OrderContact>; /** * Get list of orders * @param id Query orders by the order ID * @param params.organizer_id Name of the organizer the order belongs to * @param include_not_owned Set this to true if you want to list orders created by other users * @param contact_email Query orders by the order contact email * @param event_id Query orders by the event ID * @returns List of orders with the paging information included */ listOrders(params?: OrderListQuery): Promise<ListInfo<Order>>; /** * Refund an order. Partially if you specify ticketIds, fully otherwise. * * @param req Order ID and tickets to refund * @param body Optional list of tickets to refund instead of the whole order * @returns Refund success status */ refundOrder(id: IdParam, body?: RefundOrderBody): Promise<StatusResponse>; /** * Convert a paid order to the requested format (only PDF format is allowed) * * @param id Order ID * @param body Format into which to convert the order */ convertOrder(id: IdParam, body: ConvertOrderBody): Promise<void>; } //# sourceMappingURL=service.d.ts.map