Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JuanSCaicedo/Api-Ecommerce/llms.txt

Use this file to discover all available pages before exploring further.

Sliders populate the homepage banner carousel on the storefront. Each slider carries an image (stored on OCI Object Storage), display copy, an optional link, pricing display fields, and a type flag that controls which carousel zone it appears in:
type_sliderZoneTypical use
1Principal / HeroFull-width banner at the top of the homepage
2SecondarySmaller promotional strip below the hero
3Product carouselProduct-focused promotional banners
HomeView flags are database-backed feature toggles that control site-wide behaviour — most notably vista_mantenimiento, which activates maintenance mode when set to state = 1.
store, update, and destroy on sliders are throttled at 10 requests per minute per token.

Authentication

All /api/admin/ endpoints require:
Authorization: Bearer <admin_token>
See Products — Authentication for obtaining a token.

Sliders

List Sliders

GET /api/admin/sliders
Returns a paginated list of sliders, 10 per page, ordered by id descending. Query parameters
Filter by slider title (SQL LIKE %value%).
Response
total
integer
Total matching sliders across all pages.
sliders
array
Array of slider objects (plain array, not wrapped in a data key). The imagen field is a fully-qualified OCI Object Storage URL resolved at read time (or null if no image is set).
{
  "total": 6,
  "sliders": [
    {
      "id": 1,
      "title": "Summer Sale",
      "subtitle": "Up to 40% off",
      "label": "Shop Now",
      "imagen": "https://objectstorage.us-phoenix-1.oraclecloud.com/.../sliders/summer.jpg",
      "link": "/sale",
      "state": 1,
      "type_slider": 1,
      "type_width": "full",
      "price_original": 250000,
      "price_campaing": 150000,
      "color": "#FF5733"
    }
  ]
}

Create Slider

POST /api/admin/sliders
Request headers
HeaderValue
AuthorizationBearer <admin_token>
Content-Typemultipart/form-data
Body parameters
title
string
Slider headline text.
subtitle
string
Secondary text line displayed below the title.
label
string
Call-to-action button label (e.g., "Shop Now", "View Collection").
image
file
Banner image file (JPEG/PNG). The upload field name must be image (not imagen). The file is uploaded to OCI Object Storage under juandevops/ecommerce/public/sliders/. The OCI storage path is saved in the imagen column.
URL the slider links to when clicked (e.g., /sale, https://example.com/promo).
state
integer
1 = active (displayed on storefront), 0 = inactive.
type_slider
integer
Carousel zone.
ValueZone
1Principal / Hero
2Secondary
3Product carousel
type_width
string
Optional layout hint consumed by the frontend (e.g., "full", "half").
price_original
number
Original (pre-sale) price to display on the banner for visual comparison.
price_campaing
number
Campaign / discounted price to display on the banner.
color
string
Hex color code used for banner background or text overlay (e.g., "#FF5733").
Response
message
integer
200 on success.
id
integer
The newly created slider ID.
{ "message": 200, "id": 7 }
Example — create a hero slider
curl -X POST https://your-domain.com/api/admin/sliders \
  -H "Authorization: Bearer <admin_token>" \
  -F "title=Summer Sale" \
  -F "subtitle=Up to 40% off selected items" \
  -F "label=Shop Now" \
  -F "link=/sale" \
  -F "state=1" \
  -F "type_slider=1" \
  -F "price_original=250000" \
  -F "price_campaing=150000" \
  -F "color=#FF5733" \
  -F "image=@/path/to/summer-banner.jpg"

Get Slider

GET /api/admin/sliders/{id}
Path parameters
id
integer
required
Slider ID.
Response
slider
object
Full slider object with all fields. The imagen field is the resolved OCI public URL (or null if no image has been set).
{
  "slider": {
    "id": 7,
    "title": "Summer Sale",
    "subtitle": "Up to 40% off selected items",
    "label": "Shop Now",
    "imagen": "https://objectstorage.us-phoenix-1.oraclecloud.com/.../sliders/summer.jpg",
    "link": "/sale",
    "state": 1,
    "type_slider": 1,
    "type_width": "full",
    "price_original": 250000,
    "price_campaing": 150000,
    "color": "#FF5733"
  }
}

Update Slider

Uses POST (not PUT/PATCH) to support multipart file uploads.
POST /api/admin/sliders/{id}
Path parameters
id
integer
required
Slider ID to update.
Body parameters Same as Create Slider, plus special image handling:
image
string or file
The upload field name must be image (not imagen).
  • Omit — leave the current image unchanged.
  • Empty string ("") — delete the current image from OCI and set imagen to null.
  • New file — delete the old image from OCI and upload the new file.
Response
{ "message": 200 }

Delete Slider

DELETE /api/admin/sliders/{id}
Deletes the slider’s image from OCI Object Storage (if present), then soft-deletes the database record via the SoftDeletes trait (sets deleted_at). Path parameters
id
integer
required
Slider ID to delete.
Response
{ "message": 200 }

HomeView Feature Flags

HomeView records are pre-seeded named toggles stored in the database. They are updated (not created or deleted) via the admin API — the store and destroy actions are intentionally no-ops.

List HomeView Flags

GET /api/admin/home-view
Returns all flags, paginated 20 per page. Query parameters
search
string
Filter by flag name (SQL LIKE %value%).
Response
total
integer
Total number of home-view flags.
home_views
array
Array of flag objects (plain array, not wrapped in a data key). Each object includes id, name, state, and updated_at formatted as "YYYY-MM-DD hh:mm A".
{
  "total": 6,
  "home_views": [
    {
      "id": 1,
      "name": "vista_mantenimiento",
      "state": 0,
      "updated_at": "2024-06-01 10:00 AM"
    },
    {
      "id": 2,
      "name": "vista_electronico",
      "state": 1,
      "updated_at": "2024-05-20 03:45 PM"
    }
  ]
}

Update a HomeView Flag

PUT /api/admin/home-view/{id}
Setting vista_mantenimiento to state = 1 activates maintenance mode across the storefront. Disable it by setting state = 0.
Path parameters
id
integer
required
HomeView flag ID.
Body parameters
name
string
The flag’s identifying name. Must remain unique; sending a name that belongs to a different flag record returns {"message": 403}.
state
integer
1 = enabled, 0 = disabled.
Response
message
integer
200 on success, 403 on name conflict.
homeView
object
Updated flag object with id, name, state, and updated_at.
{
  "message": 200,
  "homeView": {
    "id": 1,
    "name": "vista_mantenimiento",
    "state": 1,
    "updated_at": "2024-06-10 08:00 AM"
  }
}
Example — enable maintenance mode
curl -X PUT https://your-domain.com/api/admin/home-view/1 \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "vista_mantenimiento", "state": 1}'
{
  "message": 200,
  "homeView": {
    "id": 1,
    "name": "vista_mantenimiento",
    "state": 1,
    "updated_at": "2024-06-10 08:00 AM"
  }
}
Example — disable maintenance mode
curl -X PUT https://your-domain.com/api/admin/home-view/1 \
  -H "Authorization: Bearer <admin_token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "vista_mantenimiento", "state": 0}'
{
  "message": 200,
  "homeView": {
    "id": 1,
    "name": "vista_mantenimiento",
    "state": 0,
    "updated_at": "2024-06-10 08:05 AM"
  }
}

Build docs developers (and LLMs) love