Endpoint #
POST /wp-json/rtcl/v1/my/store/banner
Description #
Uploads or replaces the store banner image for the authenticated user.
If the user does not already have a store, a new store is automatically created before uploading the banner.
Authentication & Permission #
This endpoint requires: #
- REST API enabled in RTCL settings
- Valid authentication headers
- API Key
- Bearer JWT Token
- User must be:
- Logged in
Required Headers #
| Header | Required | Description |
|---|---|---|
Content-Type | ✅ | multipart/form-data |
X-API-KEY | ✅ | REST API key |
Authorization | ✅ | Bearer <access_token> |
Required Parameters #
| Field | Type | Required | Description |
|---|---|---|---|
banner | file | ✅ Yes | Store banner image file |
cURL Example #
curl -X POST "https://example.com/wp-json/rtcl/v1/my/store/banner" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-F "banner=@/path/to/banner.jpg"
Important #
- Use
-F, not-d - Field name must be exactly
banner - WordPress allowed image types apply (jpg, png, webp, etc.)
Successful Response (200) #
Response Body
"https://example.com/wp-content/uploads/classified-listing/2025/08/store-banner-1024x313.jpg"
✔ Returns banner image URL only (string)
Image size used:
rtcl-store-banner
Error Responses #
User not logged in #
Status: 403
{
"status": "error",
"error": "FORBIDDEN",
"code": "403",
"error_message": "You are not logged in."
}
Banner file missing #
Status: 400
{
"status": "error",
"error": "BADREQUEST",
"code": "400",
"error_message": "Banner file field is required."
}
Upload failed #
Status: 400
{
"status": "error",
"error": "BADREQUEST",
"code": "400",
"error_message": "File type is not permitted."
}
(Message depends on wp_handle_upload())
Attachment insert failed #
Status: 400
{
"status": "error",
"error": "BADREQUEST",
"code": "400",
"error_message": "Could not insert attachment."
}
REST API Disabled #
{
"code": "DENIED_REST_API",
"message": "Denied api call",
"data": {
"status": 403
}
}
Invalid API Key / Token #
{
"code": "rtcl_rest_authentication_error",
"message": "Invalid API authentication credentials.",
"data": {
"status": 403
}
}
Missing Authorization Header #
{
"status": "error",
"error": "MISSING_AUTHORIZATION_HEADER",
"code": "401",
"error_message": "Authorization header not received. Either authorization header was not sent or it was removed by your server due to security reasons."
}
Invalid Authorization Token Type #
{
"status": "error",
"error": "INVALID_AUTHORIZATION_HEADER_TOKEN_TYPE",
"code": "401",
"error_message": "Authorization header must be type of Bearer Token."
}
Invalid JWT Format (Segment Fault) #
{
"status": "error",
"error": "SEGMENT_FAULT",
"code": "401",
"error_message": "Incorrect JWT Format."
}
Invalid JWT Signature #
{
"status": "error",
"error": "INVALID_TOKEN",
"code": "401",
"error_message": "JWT signature verification failed."
}