# Filter customers Filter customers using comprehensive query criteria with AND/OR logic and multiple operators. Supports complex filtering similar to GraphQL capabilities. Note: Soft-deleted customers are excluded by default (deletedAt defaults to { isNull: true }). Endpoint: POST /customers/filter Version: 1.0.0 Security: BearerAuth ## Request fields (application/json): - `filter` (object) Filter criteria (optional - omit to return all customers). Note: deletedAt automatically defaults to { isNull: true } unless explicitly overridden. Example: {"and":[{"status":{"equalTo":"ACTIVE"}},{"industry":{"includes":"Manufacturing"}}]} - `filter.and` (array) All conditions must match (recursive) Example: [{"status":{"equalTo":"ACTIVE"}},{"industry":{"includes":"Manufacturing"}}] - `filter.or` (array) At least one condition must match (recursive) - `filter.not` (object) Negates the filter - `filter.id` (object) Filter options for ID fields (limited operations - exact match only) - `filter.id.equalTo` (string) Exact match - `filter.id.in` (array) Matches any UUID in the array - `filter.name` (object) Filter options for string fields - `filter.name.notEqualTo` (string) Not equal to - `filter.name.in` (array) Matches any value in the array - `filter.name.notIn` (array) Does not match any value in the array - `filter.name.includes` (string) Contains substring (case-insensitive) - `filter.name.notIncludes` (string) Does not contain substring (case-insensitive) - `filter.name.startsWith` (string) Starts with prefix (case-insensitive) - `filter.name.notStartsWith` (string) Does not start with prefix (case-insensitive) - `filter.name.endsWith` (string) Ends with suffix (case-insensitive) - `filter.name.notEndsWith` (string) Does not end with suffix (case-insensitive) - `filter.name.isNull` (boolean) Field is null (true) or not null (false) - `filter.friendlyId` (object) Filter options for string fields - `filter.status` (object) Filter options for CustomerStatus enum - `filter.serviceTier` (object) Filter options for CustomerServiceTier enum - `filter.website` (object) Filter options for string fields - `filter.phoneNumber` (object) Filter options for string fields - `filter.industry` (object) Filter options for CustomerIndustry enum - `filter.annualRevenue` (object) Filter options for CustomerAnnualRevenue enum - `filter.annualSpend` (object) Filter options for CustomerAnnualSpend enum - `filter.spendType` (object) Filter options for CustomerSpendType enum - `filter.naics` (object) Filter options for string fields - `filter.ein` (object) Filter options for string fields - `filter.duns` (object) Filter options for string fields - `filter.leadSource` (object) Filter options for string fields - `filter.deactivationReason` (object) Filter options for CustomerDeactivationReason enum - `filter.numberOfEmployees` (object) Filter options for CustomerNumberOfEmployees enum - `filter.currency` (object) Filter options for CustomerCurrency enum - `filter.defaultMode` (object) Filter options for CustomerTransportationMode enum - `filter.key` (object) Filter options for client key fields (limited operations - exact match only) - `filter.createdAt` (object) Filter options for datetime fields - `filter.createdAt.lessThan` (string) Before this datetime - `filter.createdAt.lessThanOrEqualTo` (string) On or before this datetime - `filter.createdAt.greaterThan` (string) After this datetime - `filter.createdAt.greaterThanOrEqualTo` (string) On or after this datetime - `filter.updatedAt` (object) Filter options for datetime fields - `filter.deletedAt` (object) Filter options for datetime fields - `filter.closedAt` (object) Filter options for datetime fields - `filter.deactivationDate` (object) Filter options for datetime fields - `pageSize` (integer) Number of results per page Example: 50 - `cursor` (string) Pagination cursor for next page ## Response 200 fields (application/json): - `data` (array) - `data.object` (string) Object type identifier Enum: "CUSTOMER" - `data.id` (string, required) Unique customer identifier Example: "550e8400-e29b-41d4-a716-446655440000" - `data.name` (string, required) Customer company name Example: "Acme Manufacturing Corp" - `data.friendlyId` (string, required) Human-readable customer identifier, starts with "A" Example: "A123456" - `data.status` (string, required) Customer account status (includes lead stages): - NEW: New lead, not yet contacted - CONTACTED: Initial contact made with lead - QUALIFIED: Lead has been qualified as potential customer - QUOTED: Quote has been provided to lead - NURTURING: Lead being nurtured for future opportunity - PENDING: Customer prospect pending activation - ACTIVE: Active customer account - INACTIVE: Deactivated customer account - BLOCKED: Customer account blocked from operations - CLOSED: Customer account permanently closed Enum: "NEW", "CONTACTED", "QUALIFIED", "QUOTED", "NURTURING", "PENDING", "ACTIVE", "INACTIVE", "BLOCKED", "CLOSED" - `data.serviceTier` (any) Service tier level - `data.website` (string,null) Customer website URL Example: "https://acme-manufacturing.com" - `data.phoneNumber` (string,null) Primary phone number Example: "+1-555-123-4567" - `data.industry` (any) Industry classification - `data.annualRevenue` (any) Annual revenue range - `data.annualSpend` (any) Annual freight spend estimate - `data.spendType` (any) Customer spend type (contract vs spot pricing) - `data.naics` (string,null) NAICS industry code Example: "336411" - `data.ein` (string,null) Employer Identification Number Example: "12-3456789" - `data.duns` (string,null) Dun & Bradstreet number Example: "123456789" - `data.leadSource` (string,null) How this customer was acquired Example: "Referral" - `data.dbaName` (string,null) Doing business as name Example: "Acme Corp DBA" - `data.numberOfEmployees` (any) Company size by number of employees - `data.externalId` (string,null) External system identifier Example: "EXT-12345" - `data.currency` (any) Preferred currency for transactions - `data.creditLimit` (number,null) Maximum credit allowed Example: 50000 - `data.creditUsageWarning` (number,null) Credit usage warning threshold Example: 40000 - `data.freeCreditReq` (number,null) Free credit requirement Example: 5000 - `data.defaultMode` (any) Default transportation mode - `data.defaultMargin` (number,null) Default margin percentage (0-1, e.g., 0.15 for 15%) Example: 0.15 - `data.minMargin` (number,null) Minimum margin threshold Example: 0.1 - `data.maxMargin` (number,null) Maximum margin threshold Example: 0.25 - `data.defaultInternalNotes` (string,null) Default internal notes template Example: "Contact via email only" - `data.defaultExternalNotes` (string,null) Default external notes template Example: "Please call 1 hour before delivery" - `data.autoAcceptTender` (boolean,null) Auto-accept tender flag - `data.group` (any) Customer group reference (minimal - id and key only) - `data.paymentTerm` (any) Payment term configuration reference with full details - `data.notes` (string,null) Internal notes about this customer Example: "Prefers email communication" - `data.deactivationReason` (any) Reason for deactivation if status is INACTIVE - `data.deactivationNotes` (string,null) Additional details about deactivation - `data.deactivationDate` (string,null) When the customer was deactivated - `data.closedAt` (string,null) When the customer account was closed - `data.closedBy` (any) User who closed the account (full user details) - `data.closedNotes` (string,null) Notes about account closure - `data.corporateAddress` (any) Corporate headquarters address (nested location data) - `data.billingAddress` (any) Billing address (nested location data) - `data.qboCustomerId` (string,null) QuickBooks Online customer ID - `data.key` (string,null) Client-defined reference identifier for this customer Example: "ERP-CUSTOMER-12345" - `data.contacts` (array) Contacts for this customer - `data.contacts.id` (string, required) Unique contact identifier Example: "550e8400-e29b-41d4-a716-446655440000" - `data.contacts.key` (string,null) Client-defined reference identifier Example: "ERP-CONTACT-JOHN-001" - `data.contacts.name` (string, required) Contact person's name Example: "John Smith" - `data.contacts.contactInfo` (object, required) Contact information details (email, phone, title) - `data.contacts.contactInfo.name` (string, required) Contact person's full name Example: "John Smith" - `data.contacts.contactInfo.email` (string,null) Email address Example: "john.smith@example.com" - `data.contacts.contactInfo.phoneNumber` (string,null) Phone number Example: "+1-555-0100" - `data.contacts.contactInfo.title` (string,null) Job title or position Example: "Operations Manager" - `data.contacts.phoneExtension` (string,null) Phone extension specific to this contact role Example: "1234" - `data.contacts.isPrimary` (boolean, required) Whether this is the primary contact Example: true - `data.contacts.contactTypes` (array,null) Types/roles this contact serves Enum: "ACCOUNT_MANAGER", "BILLING", "DOCK_SHIPPING", "EMERGENCY", "LOCATION_MANAGER", "OWNER", "PROCUREMENT", "PURCHASING", "RATES_PRICING", "RECEIVING", "SHIPPING" - `data.contacts.notifications` (array,null) Shipment notification types Enum: "SHIPMENT_DELIVERED", "SHIPMENT_IN_TRANSIT", "SHIPMENT_LOADING", "SHIPMENT_OUT_FOR_DELIVERY", "SHIPMENT_PICKED_UP", "SHIPMENT_TENDER_REJECTED", "SHIPMENT_UNLOADING" - `data.contacts.invitedUser` (any) User account invited/created for this contact - `data.contacts.deletedBy` (any) User who deleted this contact - `data.contacts.createdAt` (string, required) When the contact was created Example: "2025-01-15T10:00:00Z" - `data.contacts.deletedAt` (string,null) When the contact was soft deleted - `data.createdAt` (string, required) Timestamp when customer was created Example: "2025-01-15T10:00:00Z" - `data.updatedAt` (string, required) Timestamp when customer was last updated Example: "2025-01-15T14:30:00Z" - `data.deletedAt` (string,null) Timestamp when customer was soft-deleted (null if active) - `data.deletedBy` (any) User who deleted the customer (full user details) - `pagination` (object) - `pagination.pageSize` (integer, required) Number of items per page Example: 50 - `pagination.hasNextPage` (boolean, required) Whether there are more pages Example: true - `pagination.hasPreviousPage` (boolean) Whether there are previous pages - `pagination.endCursor` (string,null) Cursor for the next page (null if no next page) Example: "eyJpZCI6IjU1MGU4NDAwLWUyOWItNDFkNC1hNzE2LTQ0NjY1NTQ0MDAwMCJ9" ## Response 400 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 401 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message ## Response 422 fields (application/json): - `error` (string, required) Error code Example: "validation_error" - `message` (string, required) Human-readable error message - `details` (array, required) Validation error details - `details.field` (string, required) Field name that failed validation - `details.message` (string, required) Validation error message ## Response 429 fields (application/json): - `error` (string, required) Error code - `message` (string, required) Human-readable error message