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
| ProductData | UcpLineItem | Transformation |
|---|---|---|
title | name | Direct |
price | unit_price.amount | Multiplied by 100 (dollars to cents) |
currency | unit_price.currency | Direct |
description | description | Direct |
sku | sku | Direct |
brand | brand | Direct |
category | category | Direct |
image | image_url | Direct |
url | product_url | Direct |
availability | availability | Normalized to lowercase with underscores |
moq | _extensions.b2b.moq | Moved to B2B extension |
lead_time | _extensions.b2b.lead_time | Moved to B2B extension |
bulk_pricing | _extensions.b2b.bulk_pricing | Moved to B2B extension |
mpn | _extensions.b2b.manufacturer_part_number | Moved 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"
}
}
}