Create an account or sign in
The server returns an independent token for the device or integration.
مرجع المطورين لربط تطبيقات الويب والموبايل بخدمات الحسابات، الإعلانات، المحادثات، الإشعارات والعمولات.
$ curl "https://haraj.tzaid.sa/wp-json/tz/v1/ads?per_page=2"
HTTP/2 200 OK
{
"success": true,
"message": "OK",
"data": [ ... ]
}
GET STARTED IN MINUTES
Always use HTTPS in production.
https://haraj.tzaid.sa/wp-json/tz/v1
The server returns an independent token for the device or integration.
The full value is shown when issued. Never commit it to public code.
Add the Bearer token to every endpoint that requires authentication.
SECURE ACCESS
After registration or sign-in, send the token in the header of every protected request. One user can have multiple independent sessions.
Authorization: Bearer tz_your_token_here
Accept: application/json
Content-Type: application/json
curl -X POST "https://haraj.tzaid.sa/wp-json/tz/v1/auth/login" \
-H "Content-Type: application/json" \
-d '{
"identifier": "user@example.com",
"password": "PASSWORD",
"device_name": "Flutter iPhone"
}'
/auth/refresh replaces the current token./auth/logout revokes only the active session.CONSISTENT AND PREDICTABLE
{
"success": true,
"message": "OK",
"data": {}
}
{
"success": false,
"code": "tz_validation_failed",
"message": "Validation failed.",
"details": {}
}
List responses include a pagination object containing page, per_page, total, total_pages, and has_more.
COMPLETE REFERENCE
/auth/register
Create an account and issue a new token
Public/auth/login
Sign in and create an independent session
Public/auth/refresh
Rotate the token used by the current session
Authenticated/auth/forgot-password
Send a secure password recovery link
Public/auth/logout
Revoke the token used by the current request
Authenticated/auth/me
Get the currently authenticated user
Authenticated/me/profile
Get the complete account profile
Authenticated/me/profile
Update profile and privacy settings
Authenticated/me/avatar
Upload a profile picture
Authenticated/me/password
Change the password and revoke old sessions
Authenticated/users/{id}
Get a public seller profile
Public/catalog/config
Get app configuration and dynamic fields
Public/categories
Get categories as a tree or flat list
Public/categories/{id}
Get a category and its custom fields
Public/cities
Get the city list
Public/cities/{id}
Get city details
Public/ads
Search, filter, sort, and paginate published ads
Public/ads/{id}
Get ad details
Public/ads
Create an ad with pending review status
Authenticated/ads/{id}
Partially or fully update an ad
Owner/ads/{id}
Move an ad to trash
Owner/ads/{id}/status
Update sale or visibility status
Owner/me/ads
Get the current user's ads
Authenticated/ads/{id}/images
Upload images using multipart/form-data
Owner/ads/{id}/images/order
Reorder an ad's images
Owner/ads/{id}/images/{attachment_id}
Remove an image from an ad
Owner/ads/{id}/comments
Get approved comments for an ad
Public/ads/{id}/comments
Add a comment or reply
Authenticated/comments/{id}
Delete a comment
Author/chat/conversations
List the current user's conversations
Authenticated/chat/conversations
Start a conversation for an ad
Authenticated/chat/conversations/{id}
Update conversation status
Authenticated/chat/conversations/{id}/messages
Get messages from a conversation
Authenticated/chat/conversations/{id}/messages
Send a message
Authenticated/chat/conversations/{id}/read
Mark a conversation as read
Authenticated/chat/messages/{id}
Hide a message for the current user
Authenticated/chat/unread-count
Get the unread message count
Authenticated/notifications
List notifications
Authenticated/notifications/{id}
Get a single notification
Authenticated/notifications/{id}
Mark a notification as read or unread
Authenticated/notifications/{id}
Delete a notification
Authenticated/notifications/read-all
Mark all notifications as read
Authenticated/notifications/unread-count
Get the unread notification count
Authenticated/commissions/config
Get the commission rate and calculator
Public/commissions
Record a commission and create an invoice
Public / Authenticated/commissions/{invoice_id}
Get an invoice
Public/me/commissions
Get the current user's invoices
Authenticated/admin/stats
Get system statistics
Admin/admin/ads
List ads across all moderation states
Admin/admin/ads/{id}/moderation
Approve, reject, or return an ad to pending
Admin/admin/users
List users
Admin/admin/commissions
Get the commission log
Admin/admin/comments
List comments for moderation
Admin/admin/comments/{id}
Moderate a comment
Admin/health
Check service health
Public/core/token-check
Validate an access token
AuthenticatedTry another keyword or display all request methods.
HANDLE EVERY OUTCOME
Never share tokens in URLs or public repositories. Store them in Keychain or Keystore on mobile devices.