bam-ticketing-sdk
Version:
SDK for B.A.M Ticketing API
79 lines • 2.84 kB
TypeScript
import { AxiosInstance } from 'axios';
import { HealthStatus, IdParam, ListInfo, StatusResponse } from '../common/types';
import { Order, OrderRequest, OrderContact, OrderGet, OrderListQuery, RefundOrderBody } 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>;
/**
* 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>;
/**
* 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>;
}
//# sourceMappingURL=service.d.ts.map