Endpoint #
GET /wp-json/rtcl/v1/my/listings
Description #
Fetches authenticated user listings with metadata, pagination, and listing-related relations.
Authentication & Permissions #
This endpoint requires BOTH:
Request Headers #
| Header | Required | Description |
|---|---|---|
X-API-KEY | ✅ Yes | API key (checked in permission_check) |
Authorization | ✅ Yes | Bearer {JWT_TOKEN} |
Query Parameters #
| Parameter | Type | Default | Description |
|---|---|---|---|
search | string | — | Search listings by keyword |
per_page | integer | 20 | Listings per page (min: 1) |
page | integer | 1 | Page number (min: 1) |
order_by | string | — | Order by field (passed but not enforced in query) |
Behavior Summary #
- Returns only listings created by the logged-in user
- Includes all post statuses
- Supports pagination
- Returns listing IDs first, then maps full listing data
- Adds extra field
renewfor user-owned listings
Success Response (200 OK) #
{
"data": [
{
"listing_id": 123,
"author_id": 10,
"author": {
"id": 10,
"username": "demo_user",
"email": "user@example.com",
"first_name": "Demo",
"last_name": "User",
"description": "",
"phone": "",
"whatsapp_number": "",
"website": "",
"address": "",
"zipcode": "",
"latitude": "",
"longitude": "",
"locations": [],
"isAdmin": false,
"pp_thumb_url": "https://example.com/avatar.png",
"membership": {
"is_expired": false,
"expired_at": "2026-12-31 23:59:59",
"remaining_ads": "10",
"posted_ads": "2",
"free_ads": 0,
"promotions": {
"featured": {
"ads": 5,
"validate": 30
},
"_top": {
"ads": 5,
"validate": 15
},
"_bump_up": {
"ads": 10,
"validate": 7
}
}
},
"store": true
},
"title": "Demo Listing Title",
"pricing_type": "price",
"raw_price": "500",
"raw_max_price": "",
"price": "500",
"max_price": "0",
"price_type": "fixed",
"price_units": [],
"price_unit": "",
"categories": [
{
"term_id": 1,
"name": "Demo Category",
"slug": "demo-category",
"taxonomy": "rtcl_category",
"parent": 0,
"count": 5
}
],
"tags": [],
"ad_type": "sell",
"status": "publish",
"images": [],
"date_created": {
"date": "2026-01-01 10:00:00.000000",
"timezone": "+00:00"
},
"created_at": "2026-01-01 10:00:00",
"view_count": 0,
"promotions": [],
"badges": [
"is-new",
"is-sell"
],
"contact": {
"locations": [],
"latitude": "",
"longitude": "",
"hide_map": false,
"zipcode": "0000",
"address": "Demo City",
"phone": "0123456789",
"whatsapp_number": "0123456789",
"email": "contact@example.com",
"website": "https://example.com",
"geo_address": ""
},
"store": {
"id": 50,
"title": "Demo Store",
"slug": "demo-store",
"slogan": "Demo slogan here",
"email": "store@example.com",
"phone": "0123456789",
"whatsapp": "0123456789",
"website": "https://example.com",
"address": "Demo Address",
"description": "Demo store description",
"logo_url": "https://example.com/logo.png",
"banner_url": "https://example.com/banner.png"
},
"renew": false
}
],
"pagination": {
"total": 1,
"count": 1,
"per_page": 20,
"current_page": 1,
"total_pages": 1
}
}
Response Object Details #
Listing Object #
| Field | Type | Description |
|---|---|---|
listing_id | integer | Listing ID |
author_id | integer | Owner user ID |
author | object | User profile data |
title | string | Listing title |
pricing_type | string | Pricing type |
raw_price | string | Raw price |
price | string | Formatted price |
price_type | string | Fixed / negotiable |
categories | array | Listing categories |
tags | array|false | Listing tags |
status | string | Listing status |
images | array | Gallery images |
view_count | integer | Total views |
promotions | array | Active promotions |
badges | array | Listing badges |
contact | object | Contact & location info |
renew | boolean | Whether renew button is enabled (only for my listings) |
Pagination Object #
| Field | Description |
|---|---|
total | Total listings found |
count | Listings in current page |
per_page | Items per page |
current_page | Current page number |
total_pages | Total pages |
Error Responses #
Not Logged In #
Status: 403 Forbidden
{
"code": "FORBIDDEN",
"message": "You are not logged in.",
"data": { "status": 403 }
}
API Disabled #
Status: 403 Forbidden
{
"code": "DENIED_REST_API",
"message": "Denied api call",
"data": { "status": 403 }
}
Invalid / Missing API Key #
Status: 401 / 403
{
"status": "error",
"error": "INVALID_API_KEY",
"code": "401",
"error_message": "Invalid API key."
}
CURL Example #
curl -X GET "https://example.com/wp-json/rtcl/v1/my/listings?per_page=10&page=1" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Notes for Developers #
order_byis accepted but not applied in query (future-safe)renewappears only inmy/listings- Uses WordPress pagination logic
- Always returns
{ data, pagination }structure