Skip to main content

Banner Management

1 API call in this section.

List Banners

Storefront & Commerce / Banner Management
GET/storefront/banners?page=1&limit=20&search=sale&is_active=true&position=header

Retrieves banners for the tenant's market with advanced filtering and pagination. Only accessible by tenant administrators for banner management. Authentication: - Required: Valid Bearer token with tenant admin permissions Query Parameters: - page (optional): Page number for pagination (default: 1) - limit (optional): Items per page (default: 20, max: 100) - search (optional): Search banners by title, description, or URL content - is_active (optional): Filter by active status (true/false) - position (optional): Filter by banner position (header, footer, sidebar, etc.) Search & Filter Features: - Content Search: Find banners by title, description, or URL text - Position Filtering: Filter by specific banner positions - Status Filtering: Filter by active/inactive status - Combination Filters: Use multiple filters together for precise results - Client-Side Implementation: All filtering is performed on fetched data for optimal performance Features: - Admin-only access for banner management - Advanced search and filtering capabilities - Position-based filtering for layout management - Status-based filtering for workflow management - Content-based search for quick finding - Paginated results for large banner collections - Complete banner details with positioning info - Optimized performance with client-side filtering Performance Optimization: - Client-Side Filtering: All search and filtering operations are performed after fetching the data - Benefits: Faster initial query execution and reduced database complexity - Implementation: JavaScript-based filtering on the frontend for optimal user experience Response Data: - Complete banner details with content - Position and layout information - Active status and sort order - Title, description, and URL data - Creation and modification timestamps - Pagination metadata Use Cases: - Banner management dashboard - Layout and positioning workflows - Content moderation and review - Banner performance analysis - Bulk banner operations - Position-specific management - Campaign banner organization

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
1curl --request GET "$ONDI_BASE_URL/storefront/banners?page=1&limit=20&search=sale&is_active=true&position=header" \2  --header "Authorization: Bearer {{access_token}}"

Query parameters

pageOptional
query string

1

Page number for pagination (default: 1)

limitOptional
query string

20

Items per page (default: 20, max: 100)

searchOptional
query string

sale

Search banners by title, description, or URL

is_activeOptional
query string

true

Filter by active status (true/false)

positionOptional
query string

header

Filter by banner position (header, footer, sidebar, etc.)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

JWT token for tenant admin users (required)

Responses

Success - Banners List200OK
Response body
json
1{2  "success": true,3  "data": {4    "banners": [5      {6        "id": "banner-uuid-1",7        "url": "https://example.com/summer-sale-banner.jpg",8        "title": {9          "en": "Summer Sale",10          "ar": "تخفيضات الصيف",11          "ku": "فرۆشتنی هاوین"12        },13        "description": {14          "en": "Get up to 50% off on all summer items",15          "ar": "احصل على خصم يصل إلى 50% على جميع العناصر الصيفية",16          "ku": "تا 50% داشکاندن لەسەر هەموو بابەتەکانی هاوین"17        },18        "link_url": "/categories/summer-collection",19        "position": "header",20        "is_active": true,21        "sort_order": 1,22        "created_at": "2024-05-15T10:00:00Z",23        "updated_at": "2024-05-15T10:00:00Z"24      }25    ],26    "pagination": {27      "page": 1,28      "limit": 20,29      "total": 1,30      "totalPages": 131    }32  }33}
Success - No Banners Found200OK
Response body
json
1{2  "success": true,3  "data": {4    "banners": [],5    "pagination": {6      "page": 1,7      "limit": 20,8      "total": 0,9      "totalPages": 010    }11  }12}
Error - Unauthorized401Unauthorized
Response body
json
1{2  "success": false,3  "message": "Unauthorized"4}
Error - Market Not Found404Not Found
Response body
json
1{2  "success": false,3  "message": "Market not found"4}