UCP Line Item

The UCP-formatted output structure returned when format=ucp is specified.

Interface

UcpLineItem
interface UcpLineItem {
  id: string;                    // Stable identifier (shopgraph::domain::slug)
  name: string;                  // Product name
  description: string | null;    // Product description
  unit_price: {
    amount: number;              // Price in smallest currency unit (cents)
    currency: string;            // ISO 4217 currency code
  } | null;
  quantity: number;              // Always 1 for single product extraction
  sku: string | null;            // Product SKU
  brand: string | null;          // Brand name
  category: string | null;       // Product category
  image_url: string | null;      // Primary image URL
  product_url: string;           // Canonical product URL
  availability: string | null;   // in_stock, out_of_stock, pre_order
  _extensions: {
    shopgraph: {
      extraction_method: string;
      confidence_score: number;
      field_confidence: Record;
    };
    b2b?: {                      // Present for B2B products
      moq: number | null;
      lead_time: string | null;
      bulk_pricing: BulkTier[];
      manufacturer_part_number: string | null;
    };
  };
}

Mapping from ProductData

ProductDataUcpLineItemTransformation
titlenameDirect
priceunit_price.amountMultiplied by 100 (dollars to cents)
currencyunit_price.currencyDirect
descriptiondescriptionDirect
skuskuDirect
brandbrandDirect
categorycategoryDirect
imageimage_urlDirect
urlproduct_urlDirect
availabilityavailabilityNormalized to lowercase with underscores
moq_extensions.b2b.moqMoved to B2B extension
lead_time_extensions.b2b.lead_timeMoved to B2B extension
bulk_pricing_extensions.b2b.bulk_pricingMoved to B2B extension
mpn_extensions.b2b.manufacturer_part_numberMoved to B2B extension

B2B Extensions

When B2B fields are detected (MOQ, lead time, bulk pricing, MPN), they are placed in the _extensions.b2b namespace:

B2B extensions example
{
  "_extensions": {
    "shopgraph": {
      "extraction_method": "hybrid",
      "confidence_score": 0.85
    },
    "b2b": {
      "moq": 10,
      "lead_time": "3-5 business days",
      "bulk_pricing": [
        { "min_quantity": 10, "price": 135.00 },
        { "min_quantity": 50, "price": 128.50 },
        { "min_quantity": 100, "price": 122.00 }
      ],
      "manufacturer_part_number": "4M206"
    }
  }
}