Requires the role: | manager |
GET | /customers |
---|
export class GetOperationUnTenanted<TResponse> implements IHasGetOptions, IGet
{
public embed?: string;
public constructor(init?: Partial<GetOperationUnTenanted<TResponse>>) { (Object as any).assign(this, init); }
}
export class SearchOperationUnTenanted<TResponse> extends GetOperationUnTenanted<TResponse> implements IHasSearchOptions
{
public distinct?: string;
public limit?: number;
public offset?: number;
public sort?: string;
public filter?: string;
public search?: string;
public constructor(init?: Partial<SearchOperationUnTenanted<TResponse>>) { super(init); (Object as any).assign(this, init); }
}
export class SearchOperationTenanted<TResponse> extends SearchOperationUnTenanted<TResponse> implements ITenantedRequest
{
public organisationId?: string;
public constructor(init?: Partial<SearchOperationTenanted<TResponse>>) { super(init); (Object as any).assign(this, init); }
}
export class BankAccount
{
public bsbNumber?: string;
public accountNumber?: string;
public constructor(init?: Partial<BankAccount>) { (Object as any).assign(this, init); }
}
export class Customer implements IIdentifiableResource
{
public id?: string;
public firstName?: string;
public lastName?: string;
public dateOfBirth: string;
public driversLicenceNo?: string;
public email?: string;
public phone?: string;
public preferredContactMethod?: string;
public addressLine1?: string;
public addressLine2?: string;
public suburb?: string;
public stateTerritory?: string;
public postcode?: string;
public bankAccount?: BankAccount;
public userAccountId?: string;
public constructor(init?: Partial<Customer>) { (Object as any).assign(this, init); }
}
export enum SortDirection
{
Ascending = 'Ascending',
Descending = 'Descending',
}
export class Sorting
{
public by?: string;
public direction: SortDirection;
public constructor(init?: Partial<Sorting>) { (Object as any).assign(this, init); }
}
export class Filtering
{
public fields?: string[];
public search?: string;
public constructor(init?: Partial<Filtering>) { (Object as any).assign(this, init); }
}
export class SearchMetadata
{
public total: number;
public limit: number;
public offset: number;
public sort?: Sorting;
public filter?: Filtering;
public constructor(init?: Partial<SearchMetadata>) { (Object as any).assign(this, init); }
}
export class SearchAllCustomersResponse
{
public responseStatus?: ResponseStatus;
public customers?: Customer[];
public metadata?: SearchMetadata;
public constructor(init?: Partial<SearchAllCustomersResponse>) { (Object as any).assign(this, init); }
}
export class SearchAllCustomersRequest extends SearchOperationTenanted<SearchAllCustomersResponse>
{
public constructor(init?: Partial<SearchAllCustomersRequest>) { super(init); (Object as any).assign(this, init); }
}
TypeScript SearchAllCustomersRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /customers HTTP/1.1 Host: staging-api.billiecart.com.au Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } }, customers: [ { id: String, firstName: String, lastName: String, driversLicenceNo: String, email: String, phone: String, preferredContactMethod: String, addressLine1: String, addressLine2: String, suburb: String, stateTerritory: String, postcode: String, bankAccount: { bsbNumber: String, accountNumber: String }, userAccountId: String } ], metadata: { total: 0, limit: 0, offset: 0, sort: { by: String, direction: Ascending }, filter: { fields: [ String ], search: String } } }