Skip to main content

Overview

The Products API allows you to create, update, and delete products for a tenant. Products are the core items displayed on tenant websites, with support for pricing, images, badges, and featured status. Base Path: /tenant/{tenantId}/products Authentication: Required (Laravel session auth)

Create Product

curl -X POST https://app.synticorex.test/tenant/123/products \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Premium Service Package",
    "description": "Complete solution for your business needs",
    "price_usd": 299.99,
    "badge": "hot",
    "is_active": true,
    "is_featured": true
  }'
Creates a new product for the specified tenant.

Path Parameters

tenantId
integer
required
The ID of the tenant

Request Body

name
string
required
Product name (max 100 characters)
description
string
Product description (max 500 characters)
price_usd
number
required
Product price in USD (minimum 0, supports decimals)
badge
string
Badge indicator for the productOptions: hot, new, promo
is_active
boolean
default:true
Whether the product is active and visible
Whether the product should be featured/highlighted

Validation Rules

  • The tenant must have active status
  • Blueprint-aware limits apply based on tenant plan
  • Default plans allow 3-15 products depending on subscription tier
  • Position is automatically assigned (next available position)

Response

success
boolean
Indicates if the operation was successful
message
string
Success or error message
product
object
The created product object
{
  "success": true,
  "message": "Producto creado",
  "product": {
    "id": 456,
    "tenant_id": 123,
    "name": "Premium Service Package",
    "description": "Complete solution for your business needs",
    "price_usd": "299.99",
    "price_bs": null,
    "image_filename": null,
    "position": 3,
    "is_active": true,
    "is_featured": true,
    "badge": "hot",
    "created_at": "2026-03-08T10:30:00.000000Z",
    "updated_at": "2026-03-08T10:30:00.000000Z"
  }
}

Update Product

curl -X PUT https://app.synticorex.test/tenant/123/products/456 \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Premium Service Package - Updated",
    "description": "Enhanced complete solution",
    "price_usd": 349.99,
    "badge": "promo",
    "is_active": true,
    "is_featured": false
  }'
Updates an existing product.

Path Parameters

tenantId
integer
required
The ID of the tenant
productId
integer
required
The ID of the product to update

Request Body

All fields are the same as the Create Product endpoint. All fields are required when updating.
name
string
required
Product name (max 100 characters)
description
string
Product description (max 500 characters)
price_usd
number
required
Product price in USD (minimum 0)
badge
string
Badge indicator: hot, new, or promo
is_active
boolean
Active status
Featured status

Validation Rules

  • Product must belong to the specified tenant
  • Tenant must have active status
  • All create validation rules apply

Response

success
boolean
Indicates if the operation was successful
message
string
Success or error message
product
object
The updated product object (same structure as Create response)
{
  "success": true,
  "message": "Producto actualizado",
  "product": {
    "id": 456,
    "tenant_id": 123,
    "name": "Premium Service Package - Updated",
    "description": "Enhanced complete solution",
    "price_usd": "349.99",
    "price_bs": null,
    "image_filename": "product_456_main.jpg",
    "position": 3,
    "is_active": true,
    "is_featured": false,
    "badge": "promo",
    "created_at": "2026-03-08T10:30:00.000000Z",
    "updated_at": "2026-03-08T11:45:00.000000Z"
  }
}

Delete Product

curl -X DELETE https://app.synticorex.test/tenant/123/products/456
Deletes a product and its associated images.

Path Parameters

tenantId
integer
required
The ID of the tenant
productId
integer
required
The ID of the product to delete

Behavior

  • Deletes the main product image file (if exists)
  • Deletes all gallery images (Plan 3 feature)
  • Gallery image database records are cascade-deleted via foreign key
  • Removes the product record from the database

Response

success
boolean
Indicates if the operation was successful
message
string
Success or error message
{
  "success": true,
  "message": "Producto eliminado"
}

Product Model

Database Schema

Products are stored in the products table with the following attributes:
FieldTypeDescription
idintegerPrimary key
tenant_idintegerForeign key to tenants table
namestring(100)Product name
descriptionstring(500)Product description (nullable)
price_usddecimal(10,2)Price in USD
price_bsdecimal(10,2)Price in Bolivares (nullable)
image_filenamestringMain image filename (nullable)
image_urlstringExternal image URL (nullable)
positionintegerDisplay order
is_activebooleanVisibility status
is_featuredbooleanFeatured flag
badgeenumBadge type: hot, new, promo (nullable)
created_attimestampCreation date
updated_attimestampLast modification date

Relationships

  • Tenant: Each product belongs to one tenant (tenant_id foreign key)
  • Gallery Images: Products can have multiple gallery images (Plan 3 only, max 2 per product)

Plan Limits

Product limits vary by subscription plan and blueprint:
  • Plan 1 (OPORTUNIDAD): 3 products
  • Plan 2 (CRECIMIENTO): 10 products
  • Plan 3 (VISIÓN): 15 products
  • Blueprint-specific limits may override default plan limits

Features by Plan

FeaturePlan 1Plan 2Plan 3
Basic product info
Main product image
Badges (hot/new/promo)
Featured products
Gallery images (max 2)

Image Management

Product images are managed through separate upload endpoints:
  • Main Image: POST /tenant/{tenantId}/upload/product/{productId}
  • Gallery Images: POST /tenant/{tenantId}/upload/product/{productId}/gallery (Plan 3 only)
  • Delete Gallery Image: DELETE /tenant/{tenantId}/upload/product/{productId}/gallery/{imageId} (Plan 3 only)
Images are stored in /storage/tenants/{tenantId}/ directory.

Error Codes

HTTP StatusDescription
200Success
422Validation error or business logic error
401Unauthorized (not authenticated)
403Forbidden (tenant inactive)
404Product or tenant not found
500Server error

Build docs developers (and LLMs) love