Members APICollections
Add Favorite
Add a property to favorites
POST
/members/me/collections/favoritesOverview
Adds a property to the member's favorites. The property can be added to a specific collection or the default favorites collection if no collection is specified.
Authentication
Requires a valid Clerk JWT token in the Authorization header.
Request Body
propertyDocumentIdbodystringrequiredProperty document ID to favorite
collectionIdbodynumberCollection ID to add the property to (omit for default collection)
Request
curl -X POST "http://localhost:3000/v1/members/me/collections/favorites" \
-H "Authorization: Bearer YOUR_CLERK_JWT" \
-H "Content-Type: application/json" \
-d '{
"propertyDocumentId": "prop_luxury_maldives"
}'Response
propertyDocumentIdstringrequiredProperty document identifier
propertyNamestringrequiredProperty name
propertySlugstringProperty URL slug
heroImageUrlstringProperty hero image URL
collectionIdnumberID of the collection containing this favorite (null for default collection)
addedAtstringrequiredISO 8601 timestamp when property was favorited
Response
{
"propertyDocumentId": "prop_luxury_maldives",
"propertyName": "Luxury Resort Maldives",
"propertySlug": "luxury-resort-maldives",
"heroImageUrl": "https://cdn.journey.com/properties/maldives-hero.jpg",
"collectionId": 1,
"addedAt": "2024-04-20T16:45:00Z"
}Collection Assignment
Default Collection
- No collectionId: Property goes to default "Favorites" collection
- collectionId: null: Explicitly add to default collection
- Auto-created: Default collection exists for every member
Specific Collection
- collectionId: number: Property goes to the specified collection
- Must exist: Collection must belong to the member
- Validation: System checks collection ownership
Duplicate Handling
Already Favorited
- Same Collection: Returns 409 error if property already in that collection
- Different Collection: Property can exist in multiple collections (if supported)
- Default vs Named: Same property can be in default and named collections
Error Prevention
- Check favorite status before adding
- Handle 409 errors gracefully in your UI
- Consider showing "already favorited" state to users
Property Validation
Valid Properties
- Exists: Property must exist in the system
- Active: Property should be bookable/visible
- Document ID: Must use the property's document ID, not internal ID
Invalid Properties
- Not Found: Returns 404 for non-existent properties
- Invalid Format: Returns 400 for malformed document IDs
- Restricted: Some properties may not be favoritable
Related Endpoints
- Get Favorites - View all favorites
- Remove Favorite - Remove from favorites
- Check Favorite Status - Check if already favorited
- Get Collections - View available collections