Endpoint #
GET /wp-json/rtcl/v1/my/favourites
Description #
Returns a paginated list of favourite listings saved by the currently logged-in user.
- Only published listings are returned
- Requires authentication
- Supports pagination
Authentication #
This endpoint requires authentication.
Required Headers #
| Header | Required | Description |
|---|---|---|
Authorization | ✅ Yes | JWT token: Bearer <JWT_TOKEN> |
X-API-KEY | ✅ Yes | API key from RTCL settings |
Content-Type | ✅ Yes | application/json |
Query Parameters #
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
per_page | integer | No | 20 | Number of listings per page (minimum 1) |
page | integer | No | 1 | Current page number (minimum 1) |
Example Request #
GET /wp-json/rtcl/v1/my/favourites?per_page=10&page=1
Example cURL Request #
curl -X GET "https://example.com/wp-json/rtcl/v1/my/favourites?per_page=10&page=1" \
-H "Authorization: Bearer DEMO_JWT_TOKEN" \
-H "X-API-KEY: DEMO_API_KEY"
Success Response #
Status Code: 200 OK
{
"data": [
{
"listing_id": 123,
"author_id": 10,
"author": {
"first_name": "Demo",
"last_name": "User",
"description": "Demo account description",
"id": 10,
"isAdmin": false,
"email": "demo@example.com",
"username": "demo_user",
"phone": "",
"whatsapp_number": "",
"website": "",
"locations": [],
"zipcode": "",
"address": "",
"latitude": "",
"longitude": "",
"pp_thumb_url": "https://example.com/avatar/demo-user.jpg",
"membership": {
"is_expired": false,
"expired_at": "2026-12-31 23:59:59",
"remaining_ads": "10",
"posted_ads": "2",
"promotions": {
"featured": {
"ads": 5,
"validate": 30
},
"_top": {
"ads": 3,
"validate": 15
},
"_bump_up": {
"ads": 5,
"validate": 10
}
},
"free_ads": 1
},
"store": true
},
"title": "Demo Listing Title",
"pricing_type": "price",
"raw_price": "1000",
"raw_max_price": "",
"price": "1000",
"max_price": "0",
"price_type": "fixed",
"price_units": [],
"price_unit": "",
"categories": [
{
"term_id": 5,
"name": "Demo Category",
"slug": "demo-category",
"taxonomy": "rtcl_category"
}
],
"tags": false,
"ad_type": "sell",
"status": "publish",
"images": [],
"date_created": {
"date": "2026-01-01 10:00:00.000000",
"timezone_type": 1,
"timezone": "+00:00"
},
"created_at": "2026-01-01 10:00:00",
"view_count": 25,
"promotions": [],
"badges": [
"is-new",
"is-sell"
],
"contact": {
"locations": [],
"latitude": "",
"longitude": "",
"hide_map": false,
"zipcode": "0000",
"address": "Demo Address",
"phone": "000000000",
"whatsapp_number": "000000000",
"email": "contact@example.com",
"website": "https://example.com",
"geo_address": ""
},
"store": {
"id": 50,
"title": "Demo Store",
"slug": "demo-store",
"slogan": "Demo store slogan",
"email": "store@example.com",
"phone": "000000000",
"whatsapp": "000000000",
"website": "https://example.com",
"address": "Demo City, Demo Country",
"description": "This is demo store information.",
"logo_url": "https://example.com/store/logo.jpg",
"banner_url": "https://example.com/store/banner.jpg"
}
}
],
"pagination": {
"total": 1,
"count": 1,
"per_page": 20,
"current_page": 1,
"total_pages": 1
}
}
Error Responses #
1. User Not Logged In #
Status Code: 403 Forbidden
{
"code": "FORBIDDEN",
"message": "You are not logged in."
}
2. Invalid API Key #
Status Code: 401 Unauthorized
{
"status": "error",
"error": "INVALID_API_KEY",
"code": "401",
"error_message": "Sorry, you are using invalid API Key."
}
3. Missing API Key Header #
Status Code: 401 Unauthorized
{
"status": "error",
"error": "MISSING_X_API_KEY_HEADER",
"code": "401",
"error_message": "X_API_KEY header not received. Either authorization header was not sent or it was removed by your server due to security reasons."
}
Notes #
- This endpoint returns only favourite listings saved by the user.
- Listings must be published to appear in results.
- Pagination data is returned only when results exist.
- If the user has no favourites,
datawill be an empty array andpaginationwill benull. - Authentication is mandatory for every request.