Skip to content

Products API

Manage your product catalog and menu items for QR code ordering.

The Product Object

json
{
  "id": "product-550e8400-e29b-41d4-a716-446655440000",
  "merchant_id": "merchant-abc123",
  "name": "Grilled Mahi Mahi",
  "description": "Fresh local mahi mahi grilled to perfection",
  "price": 2800,
  "currency": "BSD",
  "category": "entrees",
  "image_url": "https://yourbusiness.com/images/mahi.jpg",
  "sku": "FOOD-001",
  "stock_quantity": null,
  "is_available": true,
  "is_active": true,
  "metadata": {
    "spice_level": "mild",
    "dietary": ["gluten-free"]
  },
  "created_at": "2026-03-19T10:00:00Z",
  "updated_at": "2026-03-19T10:00:00Z"
}

Attributes

AttributeTypeDescription
idstringUnique product identifier
merchant_idstringMerchant who owns this product
namestringProduct name
descriptionstringProduct description (optional)
priceintegerPrice in cents (2800 = $28.00)
currencystringCurrency code (default: BSD)
categorystringProduct category (e.g., "entrees", "drinks", "appetizers")
image_urlstringURL to product image
skustringStock keeping unit / product code
stock_quantityintegerAvailable stock (null = unlimited)
is_availablebooleanWhether customers can order this item
is_activebooleanWhether product is active in catalog
metadataobjectCustom key-value pairs for product options
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp

Create a Product

Add a new item to your catalog.

bash
POST /v1/merchants/:id/products

Parameters

ParameterTypeRequiredDescription
namestringYesProduct name (1-255 characters)
descriptionstringNoProduct description
priceintegerYesPrice in cents (must be ≥ 0)
currencystringNoDefault: BSD
categorystringNoProduct category
image_urlstringNoURL to product image
skustringNoProduct SKU
stock_quantityintegerNoAvailable stock (null = unlimited)
is_availablebooleanNoDefault: true
metadataobjectNoCustom product options

Example Request

bash
curl -X POST https://api.dberi.com/v1/merchants/merchant-abc123/products \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Conch Fritters",
    "description": "Crispy fried conch fritters with spicy mayo",
    "price": 1200,
    "category": "appetizers",
    "image_url": "https://yourrestaurant.com/images/conch-fritters.jpg",
    "sku": "APP-001",
    "is_available": true,
    "metadata": {
      "serves": "2-3 people",
      "spice_level": "medium"
    }
  }'

Example Response

json
{
  "id": "product-xyz789",
  "merchant_id": "merchant-abc123",
  "name": "Conch Fritters",
  "description": "Crispy fried conch fritters with spicy mayo",
  "price": 1200,
  "currency": "BSD",
  "category": "appetizers",
  "image_url": "https://yourrestaurant.com/images/conch-fritters.jpg",
  "sku": "APP-001",
  "stock_quantity": null,
  "is_available": true,
  "is_active": true,
  "metadata": {
    "serves": "2-3 people",
    "spice_level": "medium"
  },
  "created_at": "2026-03-25T10:00:00Z",
  "updated_at": "2026-03-25T10:00:00Z"
}

List All Products

Get all products in your catalog.

bash
GET /v1/merchants/:id/products

Query Parameters

ParameterTypeDescription
active_onlybooleanOnly return active products (default: false)

Example Request

bash
curl "https://api.dberi.com/v1/merchants/merchant-abc123/products?active_only=true" \
  -H "Authorization: Bearer sk_live_your_api_key"

Example Response

json
[
  {
    "id": "product-xyz789",
    "merchant_id": "merchant-abc123",
    "name": "Conch Fritters",
    "price": 1200,
    "category": "appetizers",
    "is_available": true,
    "is_active": true
  },
  {
    "id": "product-abc456",
    "merchant_id": "merchant-abc123",
    "name": "Grilled Mahi Mahi",
    "price": 2800,
    "category": "entrees",
    "is_available": true,
    "is_active": true
  }
]

Get a Product

Retrieve a specific product.

bash
GET /v1/merchants/:id/products/:product_id

Example Request

bash
curl https://api.dberi.com/v1/merchants/merchant-abc123/products/product-xyz789 \
  -H "Authorization: Bearer sk_live_your_api_key"

Example Response

json
{
  "id": "product-xyz789",
  "merchant_id": "merchant-abc123",
  "name": "Conch Fritters",
  "description": "Crispy fried conch fritters with spicy mayo",
  "price": 1200,
  "currency": "BSD",
  "category": "appetizers",
  "is_available": true,
  "is_active": true,
  "created_at": "2026-03-25T10:00:00Z",
  "updated_at": "2026-03-25T10:00:00Z"
}

Update a Product

Update product details.

bash
PATCH /v1/merchants/:id/products/:product_id

Parameters

All parameters are optional. Only provided fields will be updated.

ParameterTypeDescription
namestringProduct name
descriptionstringProduct description
priceintegerPrice in cents
categorystringProduct category
image_urlstringProduct image URL
skustringProduct SKU
stock_quantityintegerAvailable stock
is_availablebooleanWhether product is available for ordering
is_activebooleanWhether product is active in catalog
metadataobjectCustom product options

Example Request

bash
curl -X PATCH https://api.dberi.com/v1/merchants/merchant-abc123/products/product-xyz789 \
  -H "Authorization: Bearer sk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "price": 1400,
    "is_available": false
  }'

Example Response

json
{
  "id": "product-xyz789",
  "merchant_id": "merchant-abc123",
  "name": "Conch Fritters",
  "price": 1400,
  "is_available": false,
  "updated_at": "2026-03-25T11:30:00Z"
}

Delete a Product

Soft delete a product (removes from catalog but preserves data).

bash
DELETE /v1/merchants/:id/products/:product_id

Soft Delete

This sets is_active to false. The product is hidden from listings but data is preserved for order history.

Example Request

bash
curl -X DELETE https://api.dberi.com/v1/merchants/merchant-abc123/products/product-xyz789 \
  -H "Authorization: Bearer sk_live_your_api_key"

Example Response

json
{
  "message": "Product deleted successfully"
}

Use Cases

Restaurant Menu

javascript
// Create full menu
const appetizers = [
  { name: "Conch Fritters", price: 1200, category: "appetizers" },
  { name: "Coconut Shrimp", price: 1500, category: "appetizers" }
]

const entrees = [
  { name: "Grilled Mahi Mahi", price: 2800, category: "entrees" },
  { name: "Lobster Tail", price: 4500, category: "entrees" }
]

const drinks = [
  { name: "Bahama Mama", price: 900, category: "drinks" },
  { name: "Rum Punch", price: 800, category: "drinks" }
]

// Create all products
for (const item of [...appetizers, ...entrees, ...drinks]) {
  await createProduct(merchantId, item)
}

Daily Specials

javascript
// Mark item as unavailable when sold out
await updateProduct(merchantId, productId, {
  is_available: false
})

// Update price for happy hour
await updateProduct(merchantId, drinkId, {
  price: 600, // $6.00
  metadata: {
    happy_hour: true,
    original_price: 900
  }
}
)

Inventory Management

javascript
// Product with stock tracking
await createProduct(merchantId, {
  name: "Limited Edition T-Shirt",
  price: 2500,
  stock_quantity: 50,
  category: "retail"
})

// Auto-disable when out of stock
const product = await getProduct(merchantId, productId)
if (product.stock_quantity === 0) {
  await updateProduct(merchantId, productId, {
    is_available: false
  })
}

Best Practices

1. Use Categories

Organize products by category for better menu display:

appetizers, entrees, sides, desserts, drinks, retail, etc.

2. High-Quality Images

  • Use 1:1 square images (minimum 800x800px)
  • Compress images for faster loading
  • Host on a CDN for best performance

3. Detailed Descriptions

Help customers make informed choices:

javascript
{
  "name": "Grilled Mahi Mahi",
  "description": "Fresh local mahi mahi grilled to perfection, served with rice and vegetables",
  "metadata": {
    "dietary": ["gluten-free"],
    "spice_level": "mild",
    "allergens": ["fish"]
  }
}

4. Stock Management

For limited items, use stock_quantity:

javascript
// Track inventory
{
  "name": "Daily Catch",
  "stock_quantity": 12
}

// Unlimited items
{
  "name": "French Fries",
  "stock_quantity": null
}

5. Seasonal Items

Use is_active for seasonal products:

javascript
// Enable for summer
await updateProduct(merchantId, productId, {
  is_active: true,
  is_available: true
})

// Disable for winter
await updateProduct(merchantId, productId, {
  is_active: false
})

Errors

CodeDescription
PRODUCT_NOT_FOUNDProduct ID doesn't exist
INVALID_PRICEPrice must be non-negative integer
NAME_REQUIREDProduct name is required
MERCHANT_MISMATCHProduct doesn't belong to this merchant

Next Steps

Built for the Caribbean, powered by innovation