# Locations ## Filter locations - [POST /locations/filter](https://docs.mvmnt.io/apis/openapi/locations/filterlocations.md): Query locations using flexible filter criteria with AND/OR logic. By default, only non-deleted locations are returned (deletedAt: { isNull: true }). Override this by explicitly setting deletedAt filter criteria. ## Create a new location - [POST /locations](https://docs.mvmnt.io/apis/openapi/locations/createlocation.md): Create a new location for a customer. Locations represent pickup or delivery points (warehouses, distribution centers, etc.). ## Get a location by ID - [GET /locations/{id}](https://docs.mvmnt.io/apis/openapi/locations/getlocationbyid.md): Retrieve a single location by its unique identifier. ## Update a location - [PATCH /locations/{id}](https://docs.mvmnt.io/apis/openapi/locations/updatelocation.md): Partially update a location. Only provided fields will be updated. - Omitted fields: Not modified (current value preserved) - Provided fields: Updated to the new value - Null values: Clear the field (set to null) where applicable ## Delete a location - [DELETE /locations/{id}](https://docs.mvmnt.io/apis/openapi/locations/deletelocation.md): Soft delete a location (sets deletedAt timestamp). The location will no longer appear in default queries but can be retrieved by explicitly filtering for deleted records. ## Search locations - [POST /locations/search](https://docs.mvmnt.io/apis/openapi/locations/searchlocations.md): Search locations using OpenSearch-powered full-text and field-specific search. This endpoint provides fast, indexed search across location data with support for: - Full-text search across multiple fields - Field-specific filtering with various operators - Geographic search capabilities - Sorting and pagination - Saved search preferences Note: Only active (non-deleted) locations are searchable. Soft-deleted records are automatically excluded from all search results. Response Formats: - flat (default): Returns indexed fields only for faster performance - full: Returns complete location objects with all relationships