Skip to content

Products

API Type

eCommerce API - Uses API key in request body. See Authentication.

Load photobook products for a specific market with detailed specifications and pricing.

List Products

Retrieve all available photobook products for a market, including categories, pricing, and specifications.

Endpoint

POST https://{ecomm}.photobook.ai/api/v2/products/list-product.php

Replace {ecomm} with your assigned client identifier.

Example: https://yourclient.photobook.ai/api/v2/products/list-product.php

Authentication

See Authentication - eCommerce

Request Parameters

json
{
  "env": "dev",
  "key": "your-api-key",
  "language": "en",
  "os": "web",
  "marketId": 0,
  "printType": "photobook"
}
ParameterTypeRequiredDescription
envstringYesTarget environment: dev or prod
keystringYesYour programmatic access key
languagestringNoFirst 2 characters of language code (e.g., en). Defaults to en
osstringYesTarget platform. Use web for PWA
vintegerNoVersion target. Fetches products tagged with this value and lower. Leave undefined if unsure
schemaintegerNoSchema version for response structure. Leave undefined if unsure
marketIdintegerNoTarget market ID. Defaults to 0 (default market)
printTypestringNoProduct type filter. Use photobook (other types not yet supported)

Response Structure

json
{
  "baseUrl": "https://cdn.photobook.ai/products/",
  "pricesIncludeTax": false,
  "currency": {
    "code": "USD",
    "left": "$",
    "right": "",
    "decimals": 2
  },
  "products": [...],
  "categories": [...]
}

Response Fields

Top-Level Fields

FieldTypeDescription
baseUrlstringPrefix for image URLs. Prepend to thumbnail/image paths
currencyobjectCurrency information for the market
productsarrayList of available products
categoriesarrayList of product categories

Currency Object

FieldTypeDescription
codestringCurrency code (e.g., USD, EUR)
leftstringString to prepend to price values (e.g., "$")
rightstringString to append to price values
decimalsintegerNumber of decimal places for currency

Product Object

Each product in the products array contains:

json
{
  "id": 1,
  "sku": "PB001",
  "name": "Premium Photo Book",
  "description": "A beautiful hardcover photobook",
  "descriptionJson": [...],
  "metaTitle": "Premium Book",
  "thumbnail": "products/pb001-thumb.jpg",
  "payment": {
    "prices": [
      {
        "price": 29.99,
        "extraCostPerPage": 0.50
      }
    ]
  },
  "attributes": [...],
  "specifications": {...},
  "renderOptions": {
    "productId": "PB001",
    "psp": "PrinterName"
  },
  "disabled": false
}

Key Product Fields

FieldTypeDescription
idintegerInternal product ID
skustringProduct SKU/model identifier
namestringProduct display name
descriptionstringSingle-string description. Use this OR descriptionJson
descriptionJsonarrayStructured description. Use this OR description
metaTitlestringShort name, useful when space is limited
thumbnailstringPath to thumbnail. Prepend with baseUrl
payment.pricesarrayPricing information (usually contains 1 object)
payment.prices[0].pricefloatBase price of the product
payment.prices[0].extraCostPerPagefloatCost per additional page beyond base pages
attributesarrayCategories and variations (see below)
specificationsobjectPhysical product specifications
renderOptionsobjectProduct and printer information for API calls
disabledbooleanIf true, show product grayed out (upcoming product)

Product Attributes

The attributes array contains categories and sub-categories.

Important

The first object in attributes is always the parent category. This category also appears in the top-level categories array.

json
{
  "attributes": [
    {
      "categoryId": 1,
      "type": "category",
      "name": "Travel & Adventure",
      "subtitle": "Capture your journeys",
      "carousel": [
        {
          "image": "carousel/travel-1.jpg",
          "caption": "Explore the world"
        }
      ],
      "thumbnail": "categories/travel-thumb.jpg",
      "description": "Perfect for travel memories",
      "order": 1,
      "tag": "Popular",
      "topSeller": true,
      "disabled": false
    },
    {
      "type": "size",
      "name": "8x8 inches",
      "thumbnail": "variations/8x8.jpg",
      "order": 1
    }
  ]
}

Attribute Fields

FieldTypeDescription
typestringShows category for categories, else shows sub-category type name
namestringDisplay name
subtitlestringAdditional descriptive tag
carouselarray(category only) Images for carousel display. Prepend with baseUrl
thumbnailstringThumbnail image path. Prepend with baseUrl
descriptionstringSingle-string description
descriptionJsonarrayStructured description
orderintegerSort order
tagstringOptional ribbon tag (e.g., "New", "Popular")
topSellerbooleanIf true, consider prominent placement in UI
disabledbooleanIf true, show grayed out

Specifications Object

Contains physical product details:

json
{
  "specifications": {
    "min": {
      "photos": 20,
      "pages": 20
    },
    "max": {
      "photos": 200,
      "pages": 100
    },
    "psp": {
      "name": "PrinterName",
      "leadTime": {
        "value": 5,
        "unit": "days"
      }
    }
  }
}

Key Specification Fields

FieldTypeDescription
min.photosintegerMinimum number of photos user can select
max.photosintegerMaximum number of photos user can select
psp.namestringPrinter/manufacturer name

Categories Array

The top-level categories array contains all categories with their associated products:

json
{
  "categories": [
    {
      "categoryId": 1,
      "type": "category",
      "name": "Travel & Adventure",
      "thumbnail": "categories/travel-thumb.jpg",
      "products": [1, 2, 5, 8]
    }
  ]
}

The products field contains an array of product IDs that belong to this category.

Example Implementation

javascript
async function getProducts(marketId = 0) {
  const response = await fetch('https://{ecomm}.photobook.ai/api/v2/products/list-product.php', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      env: 'dev',
      key: 'your-api-key',
      language: 'en',
      os: 'web',
      marketId: marketId,
      printType: 'photobook'
    })
  });
  
  const data = await response.json();
  
  // Helper to get full image URL
  const getImageUrl = (path) => data.baseUrl + path;
  
  // Format price with currency
  const formatPrice = (price) => {
    return `${data.currency.left}${price.toFixed(data.currency.decimals)}${data.currency.right}`;
  };
  
  return {
    ...data,
    getImageUrl,
    formatPrice
  };
}

Suggested Practices

  1. Cache product data: Products don't change frequently. Consider caching with appropriate TTL
  2. Use metaTitle: When space is limited, use metaTitle instead of name
  3. Handle disabled products: Show disabled products grayed out to introduce upcoming items
  4. Highlight top sellers: Products with topSeller: true should get prominent placement
  5. Display categories: Use the carousel images or thumbnails to create an engaging category browser

photobook.ai Developer Documentation