portage-ucp 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +15 -0
- data/LICENSE +21 -0
- data/README.md +97 -0
- data/exe/portage-ucp-check +25 -0
- data/lib/portage/ucp/adapter.rb +58 -0
- data/lib/portage/ucp/authenticator.rb +26 -0
- data/lib/portage/ucp/capabilities/cart.rb +16 -0
- data/lib/portage/ucp/capabilities/catalog.rb +11 -0
- data/lib/portage/ucp/capabilities/checkout.rb +17 -0
- data/lib/portage/ucp/capabilities/identity_linking.rb +13 -0
- data/lib/portage/ucp/capabilities/order.rb +11 -0
- data/lib/portage/ucp/capability.rb +27 -0
- data/lib/portage/ucp/capability_negotiator.rb +40 -0
- data/lib/portage/ucp/capability_registry.rb +21 -0
- data/lib/portage/ucp/check.rb +96 -0
- data/lib/portage/ucp/configuration.rb +35 -0
- data/lib/portage/ucp/dispatcher.rb +39 -0
- data/lib/portage/ucp/errors.rb +12 -0
- data/lib/portage/ucp/manifest.rb +58 -0
- data/lib/portage/ucp/mcp/server.rb +83 -0
- data/lib/portage/ucp/observability.rb +31 -0
- data/lib/portage/ucp/payment_token_guard.rb +41 -0
- data/lib/portage/ucp/rack/manifest_endpoint.rb +49 -0
- data/lib/portage/ucp/rack/webhook_endpoint.rb +54 -0
- data/lib/portage/ucp/rate_limiter.rb +27 -0
- data/lib/portage/ucp/resolver.rb +133 -0
- data/lib/portage/ucp/schema_validator.rb +53 -0
- data/lib/portage/ucp/support/amounts.rb +43 -0
- data/lib/portage/ucp/support/api_error.rb +39 -0
- data/lib/portage/ucp/support/checkout_state.rb +42 -0
- data/lib/portage/ucp/support/http_client.rb +54 -0
- data/lib/portage/ucp/support/idempotency.rb +26 -0
- data/lib/portage/ucp/support/line_item_status.rb +44 -0
- data/lib/portage/ucp/support/not_found.rb +25 -0
- data/lib/portage/ucp/support/token_exchange.rb +43 -0
- data/lib/portage/ucp/support/totals.rb +31 -0
- data/lib/portage/ucp/value_objects.rb +186 -0
- data/lib/portage/ucp/version.rb +5 -0
- data/lib/portage/ucp/wire_envelope.rb +25 -0
- data/lib/portage/ucp.rb +44 -0
- data/schemas/2026-04-08/schemas/capability.json +70 -0
- data/schemas/2026-04-08/schemas/payment_handler.json +67 -0
- data/schemas/2026-04-08/schemas/service.json +190 -0
- data/schemas/2026-04-08/schemas/shopping/cart.json +134 -0
- data/schemas/2026-04-08/schemas/shopping/catalog_lookup.json +207 -0
- data/schemas/2026-04-08/schemas/shopping/catalog_search.json +64 -0
- data/schemas/2026-04-08/schemas/shopping/checkout.json +131 -0
- data/schemas/2026-04-08/schemas/shopping/discount.json +148 -0
- data/schemas/2026-04-08/schemas/shopping/fulfillment.json +154 -0
- data/schemas/2026-04-08/schemas/shopping/order.json +113 -0
- data/schemas/2026-04-08/schemas/shopping/payment.json +16 -0
- data/schemas/2026-04-08/schemas/shopping/types/adjustment.json +69 -0
- data/schemas/2026-04-08/schemas/shopping/types/amount.json +8 -0
- data/schemas/2026-04-08/schemas/shopping/types/attribution.json +11 -0
- data/schemas/2026-04-08/schemas/shopping/types/available_payment_instrument.json +22 -0
- data/schemas/2026-04-08/schemas/shopping/types/business_fulfillment_config.json +38 -0
- data/schemas/2026-04-08/schemas/shopping/types/buyer.json +25 -0
- data/schemas/2026-04-08/schemas/shopping/types/category.json +20 -0
- data/schemas/2026-04-08/schemas/shopping/types/context.json +42 -0
- data/schemas/2026-04-08/schemas/shopping/types/description.json +22 -0
- data/schemas/2026-04-08/schemas/shopping/types/detail_option_value.json +22 -0
- data/schemas/2026-04-08/schemas/shopping/types/error_code.json +17 -0
- data/schemas/2026-04-08/schemas/shopping/types/error_response.json +31 -0
- data/schemas/2026-04-08/schemas/shopping/types/expectation.json +62 -0
- data/schemas/2026-04-08/schemas/shopping/types/fulfillment.json +25 -0
- data/schemas/2026-04-08/schemas/shopping/types/fulfillment_available_method.json +45 -0
- data/schemas/2026-04-08/schemas/shopping/types/fulfillment_destination.json +16 -0
- data/schemas/2026-04-08/schemas/shopping/types/fulfillment_event.json +67 -0
- data/schemas/2026-04-08/schemas/shopping/types/fulfillment_group.json +45 -0
- data/schemas/2026-04-08/schemas/shopping/types/fulfillment_method.json +67 -0
- data/schemas/2026-04-08/schemas/shopping/types/fulfillment_option.json +56 -0
- data/schemas/2026-04-08/schemas/shopping/types/info_code.json +13 -0
- data/schemas/2026-04-08/schemas/shopping/types/input_correlation.json +24 -0
- data/schemas/2026-04-08/schemas/shopping/types/item.json +33 -0
- data/schemas/2026-04-08/schemas/shopping/types/line_item.json +46 -0
- data/schemas/2026-04-08/schemas/shopping/types/link.json +25 -0
- data/schemas/2026-04-08/schemas/shopping/types/media.json +36 -0
- data/schemas/2026-04-08/schemas/shopping/types/message.json +18 -0
- data/schemas/2026-04-08/schemas/shopping/types/message_error.json +49 -0
- data/schemas/2026-04-08/schemas/shopping/types/message_info.json +37 -0
- data/schemas/2026-04-08/schemas/shopping/types/message_warning.json +53 -0
- data/schemas/2026-04-08/schemas/shopping/types/option_value.json +20 -0
- data/schemas/2026-04-08/schemas/shopping/types/order_confirmation.json +26 -0
- data/schemas/2026-04-08/schemas/shopping/types/order_line_item.json +69 -0
- data/schemas/2026-04-08/schemas/shopping/types/pagination.json +62 -0
- data/schemas/2026-04-08/schemas/shopping/types/payment_credential.json +17 -0
- data/schemas/2026-04-08/schemas/shopping/types/payment_instrument.json +58 -0
- data/schemas/2026-04-08/schemas/shopping/types/platform_fulfillment_config.json +14 -0
- data/schemas/2026-04-08/schemas/shopping/types/postal_address.json +44 -0
- data/schemas/2026-04-08/schemas/shopping/types/price.json +22 -0
- data/schemas/2026-04-08/schemas/shopping/types/price_filter.json +17 -0
- data/schemas/2026-04-08/schemas/shopping/types/price_range.json +21 -0
- data/schemas/2026-04-08/schemas/shopping/types/product.json +89 -0
- data/schemas/2026-04-08/schemas/shopping/types/product_option.json +25 -0
- data/schemas/2026-04-08/schemas/shopping/types/rating.json +34 -0
- data/schemas/2026-04-08/schemas/shopping/types/retail_location.json +28 -0
- data/schemas/2026-04-08/schemas/shopping/types/reverse_domain_name.json +8 -0
- data/schemas/2026-04-08/schemas/shopping/types/search_filters.json +20 -0
- data/schemas/2026-04-08/schemas/shopping/types/selected_option.json +25 -0
- data/schemas/2026-04-08/schemas/shopping/types/shipping_destination.json +26 -0
- data/schemas/2026-04-08/schemas/shopping/types/signals.json +22 -0
- data/schemas/2026-04-08/schemas/shopping/types/signed_amount.json +7 -0
- data/schemas/2026-04-08/schemas/shopping/types/total.json +75 -0
- data/schemas/2026-04-08/schemas/shopping/types/totals.json +98 -0
- data/schemas/2026-04-08/schemas/shopping/types/variant.json +193 -0
- data/schemas/2026-04-08/schemas/shopping/types/warning_code.json +13 -0
- data/schemas/2026-04-08/schemas/transports/embedded_config.json +27 -0
- data/schemas/2026-04-08/schemas/ucp.json +364 -0
- data/schemas/2026-04-08/services/shopping/embedded.openrpc.json +634 -0
- data/schemas/2026-04-08/services/shopping/mcp.openrpc.json +492 -0
- metadata +283 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/available_payment_instrument.json",
|
|
4
|
+
"title": "Available Payment Instrument",
|
|
5
|
+
"description": "An instrument type available from a payment handler with optional constraints.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"type"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"type": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The instrument type identifier (e.g., 'card', 'gift_card'). References an instrument schema's type constant."
|
|
14
|
+
},
|
|
15
|
+
"constraints": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"additionalProperties": true,
|
|
18
|
+
"description": "Constraints on this instrument type. Structure depends on instrument type and active capabilities.",
|
|
19
|
+
"minProperties": 1
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/business_fulfillment_config.json",
|
|
4
|
+
"title": "Business Fulfillment Config",
|
|
5
|
+
"description": "Business's fulfillment configuration.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"allows_multi_destination": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"description": "Permits multiple destinations per method type.",
|
|
11
|
+
"properties": {
|
|
12
|
+
"shipping": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"description": "Multiple shipping destinations allowed."
|
|
15
|
+
},
|
|
16
|
+
"pickup": {
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"description": "Multiple pickup locations allowed."
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"additionalProperties": false
|
|
22
|
+
},
|
|
23
|
+
"allows_method_combinations": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"description": "Allowed method type combinations.",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "array",
|
|
28
|
+
"items": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"enum": [
|
|
31
|
+
"shipping",
|
|
32
|
+
"pickup"
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/buyer.json",
|
|
4
|
+
"title": "Buyer",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"first_name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "First name of the buyer."
|
|
11
|
+
},
|
|
12
|
+
"last_name": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Last name of the buyer."
|
|
15
|
+
},
|
|
16
|
+
"email": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Email of the buyer."
|
|
19
|
+
},
|
|
20
|
+
"phone_number": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "E.164 standard."
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/category.json",
|
|
4
|
+
"title": "Category",
|
|
5
|
+
"description": "A product category with optional taxonomy identifier.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"value"
|
|
9
|
+
],
|
|
10
|
+
"properties": {
|
|
11
|
+
"value": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Category value or path (e.g., 'Apparel > Shirts', '1604')."
|
|
14
|
+
},
|
|
15
|
+
"taxonomy": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Source taxonomy. Well-known values: `google_product_category`, `shopify`, `merchant`."
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/context.json",
|
|
4
|
+
"title": "Context",
|
|
5
|
+
"description": "Provisional buyer signals for relevance and localization—not authoritative data. Businesses SHOULD use these values when verified inputs (e.g., shipping address) are absent, and MAY ignore or down-rank them if inconsistent with higher-confidence signals (authenticated account, risk detection) or regulatory constraints (export controls). Eligibility and policy enforcement MUST occur at checkout time using binding transaction data. Context SHOULD be non-identifying and can be disclosed progressively—coarse signals early, finer resolution as the session progresses. Higher-resolution data (shipping address, billing address) supersedes context.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": true,
|
|
8
|
+
"properties": {
|
|
9
|
+
"address_country": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example \"US\". For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as \"SGP\" or a full country name such as \"Singapore\" can also be used. Optional hint for market context (currency, availability, pricing)—higher-resolution data (e.g., shipping address) supersedes this value."
|
|
12
|
+
},
|
|
13
|
+
"address_region": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "The region in which the locality is, and which is in the country. For example, California or another appropriate first-level Administrative division. Optional hint for progressive localization—higher-resolution data (e.g., shipping address) supersedes this value."
|
|
16
|
+
},
|
|
17
|
+
"postal_code": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "The postal code. For example, 94043. Optional hint for regional refinement—higher-resolution data (e.g., shipping address) supersedes this value."
|
|
20
|
+
},
|
|
21
|
+
"intent": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Background context describing buyer's intent (e.g., 'looking for a gift under $50', 'need something durable for outdoor use'). Informs relevance, recommendations, and personalization."
|
|
24
|
+
},
|
|
25
|
+
"language": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Preferred language for content. Use IETF BCP 47 language tags (e.g., 'en', 'fr-CA', 'zh-Hans'). For REST, equivalent to Accept-Language header—platforms SHOULD fall back to Accept-Language when this field is absent; when provided, overrides Accept-Language. Businesses MAY return content in a different language if unavailable."
|
|
28
|
+
},
|
|
29
|
+
"currency": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "Preferred currency (ISO 4217, e.g., 'EUR', 'USD'). Businesses determine presentment currency from context and authoritative signals; this hint MAY inform selection in multi-currency markets. Also serves as the denomination for price filter values — platforms SHOULD include this field when sending price filters. Response prices include explicit currency confirming the resolution."
|
|
32
|
+
},
|
|
33
|
+
"eligibility": {
|
|
34
|
+
"type": "array",
|
|
35
|
+
"description": "Buyer claims about eligible benefits such as loyalty membership, payment instrument perks, and similar. Recognized claims MAY inform the Business response (e.g., member-only product availability, adjusted pricing in catalog, provisional discounts at cart or checkout). Businesses MUST ignore unrecognized values without error. Values MUST use reverse-domain naming (e.g., 'com.example.loyalty_gold', 'org.school.student') and MUST be non-identifying.",
|
|
36
|
+
"uniqueItems": true,
|
|
37
|
+
"items": {
|
|
38
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/reverse_domain_name.json"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/description.json",
|
|
4
|
+
"title": "Description",
|
|
5
|
+
"description": "Description content in one or more formats. At least one format must be provided.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"plain": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Plain text content."
|
|
11
|
+
},
|
|
12
|
+
"html": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "HTML-formatted content. Security: Platforms MUST sanitize before rendering—strip scripts, event handlers, and untrusted elements. Treat all rich text as untrusted input."
|
|
15
|
+
},
|
|
16
|
+
"markdown": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "Markdown-formatted content."
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"minProperties": 1
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/detail_option_value.json",
|
|
4
|
+
"title": "Detail Option Value",
|
|
5
|
+
"description": "An option value with availability signals relative to the current selections. Used in get_product responses where selected context exists.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/option_value.json"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"properties": {
|
|
13
|
+
"available": {
|
|
14
|
+
"type": "boolean",
|
|
15
|
+
"description": "Whether a variant matching this value and the current option selections is purchasable."
|
|
16
|
+
},
|
|
17
|
+
"exists": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "Whether a variant matching this value and the current option selections exists in the catalog."
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_code.json",
|
|
4
|
+
"title": "Error Code",
|
|
5
|
+
"description": "Error code identifying the type of error. Standard errors are defined in specification (see examples), and have standardized semantics; freeform codes are permitted.",
|
|
6
|
+
"type": "string",
|
|
7
|
+
"examples": [
|
|
8
|
+
"not_found",
|
|
9
|
+
"out_of_stock",
|
|
10
|
+
"item_unavailable",
|
|
11
|
+
"address_undeliverable",
|
|
12
|
+
"payment_failed",
|
|
13
|
+
"eligibility_invalid",
|
|
14
|
+
"identity_required",
|
|
15
|
+
"insufficient_scope"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json",
|
|
4
|
+
"title": "Error Response",
|
|
5
|
+
"description": "Generic error response when business logic prevents resource creation or failed to retrieve resource. Used when no valid resource can be established.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"ucp",
|
|
9
|
+
"messages"
|
|
10
|
+
],
|
|
11
|
+
"additionalProperties": false,
|
|
12
|
+
"properties": {
|
|
13
|
+
"ucp": {
|
|
14
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/ucp.json#/$defs/error",
|
|
15
|
+
"description": "UCP protocol metadata. Status MUST be 'error' for error response."
|
|
16
|
+
},
|
|
17
|
+
"messages": {
|
|
18
|
+
"type": "array",
|
|
19
|
+
"items": {
|
|
20
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/message.json"
|
|
21
|
+
},
|
|
22
|
+
"minItems": 1,
|
|
23
|
+
"description": "Array of messages describing why the operation failed."
|
|
24
|
+
},
|
|
25
|
+
"continue_url": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"format": "uri",
|
|
28
|
+
"description": "URL for buyer handoff or session recovery."
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/expectation.json",
|
|
4
|
+
"title": "Expectation",
|
|
5
|
+
"description": "Buyer-facing fulfillment expectation representing logical groupings of items (e.g., 'package'). Can be split, merged, or adjusted post-order to set buyer expectations for when/how items arrive.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"id",
|
|
9
|
+
"line_items",
|
|
10
|
+
"method_type",
|
|
11
|
+
"destination"
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Expectation identifier."
|
|
17
|
+
},
|
|
18
|
+
"line_items": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"required": [
|
|
23
|
+
"id",
|
|
24
|
+
"quantity"
|
|
25
|
+
],
|
|
26
|
+
"properties": {
|
|
27
|
+
"id": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "Line item ID reference."
|
|
30
|
+
},
|
|
31
|
+
"quantity": {
|
|
32
|
+
"type": "integer",
|
|
33
|
+
"minimum": 1,
|
|
34
|
+
"description": "Quantity of this item in this expectation."
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"description": "Which line items and quantities are in this expectation."
|
|
39
|
+
},
|
|
40
|
+
"method_type": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"enum": [
|
|
43
|
+
"shipping",
|
|
44
|
+
"pickup",
|
|
45
|
+
"digital"
|
|
46
|
+
],
|
|
47
|
+
"description": "Delivery method type (shipping, pickup, digital)."
|
|
48
|
+
},
|
|
49
|
+
"destination": {
|
|
50
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/postal_address.json",
|
|
51
|
+
"description": "Delivery destination address."
|
|
52
|
+
},
|
|
53
|
+
"description": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Human-readable delivery description (e.g., 'Arrives in 5-8 business days')."
|
|
56
|
+
},
|
|
57
|
+
"fulfillable_on": {
|
|
58
|
+
"type": "string",
|
|
59
|
+
"description": "When this expectation can be fulfilled: 'now' or ISO 8601 timestamp for future date (backorder, pre-order)."
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment.json",
|
|
4
|
+
"title": "Fulfillment",
|
|
5
|
+
"description": "Container for fulfillment methods and availability.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"ucp_shared_request": true,
|
|
8
|
+
"properties": {
|
|
9
|
+
"methods": {
|
|
10
|
+
"type": "array",
|
|
11
|
+
"description": "Fulfillment methods for cart items.",
|
|
12
|
+
"items": {
|
|
13
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_method.json"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"available_methods": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"description": "Inventory availability hints.",
|
|
19
|
+
"items": {
|
|
20
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_available_method.json"
|
|
21
|
+
},
|
|
22
|
+
"ucp_request": "omit"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_available_method.json",
|
|
4
|
+
"title": "Fulfillment Available Method",
|
|
5
|
+
"description": "Inventory availability hint for a fulfillment method type.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"ucp_shared_request": true,
|
|
8
|
+
"required": [
|
|
9
|
+
"type",
|
|
10
|
+
"line_item_ids"
|
|
11
|
+
],
|
|
12
|
+
"additionalProperties": true,
|
|
13
|
+
"properties": {
|
|
14
|
+
"type": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"enum": [
|
|
17
|
+
"shipping",
|
|
18
|
+
"pickup"
|
|
19
|
+
],
|
|
20
|
+
"description": "Fulfillment method type this availability applies to.",
|
|
21
|
+
"ucp_request": "omit"
|
|
22
|
+
},
|
|
23
|
+
"line_item_ids": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"description": "Line items available for this fulfillment method.",
|
|
26
|
+
"items": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"ucp_request": "omit"
|
|
30
|
+
},
|
|
31
|
+
"fulfillable_on": {
|
|
32
|
+
"type": [
|
|
33
|
+
"string",
|
|
34
|
+
"null"
|
|
35
|
+
],
|
|
36
|
+
"description": "'now' for immediate availability, or ISO 8601 date for future (preorders, transfers).",
|
|
37
|
+
"ucp_request": "omit"
|
|
38
|
+
},
|
|
39
|
+
"description": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Human-readable availability info (e.g., 'Available for pickup at Downtown Store today').",
|
|
42
|
+
"ucp_request": "omit"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_destination.json",
|
|
4
|
+
"title": "Fulfillment Destination",
|
|
5
|
+
"description": "A destination for fulfillment.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"ucp_shared_request": true,
|
|
8
|
+
"oneOf": [
|
|
9
|
+
{
|
|
10
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/shipping_destination.json"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/retail_location.json"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_event.json",
|
|
4
|
+
"title": "Fulfillment Event",
|
|
5
|
+
"description": "Append-only fulfillment event representing an actual shipment. References line items by ID.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"id",
|
|
9
|
+
"occurred_at",
|
|
10
|
+
"type",
|
|
11
|
+
"line_items"
|
|
12
|
+
],
|
|
13
|
+
"properties": {
|
|
14
|
+
"id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Fulfillment event identifier."
|
|
17
|
+
},
|
|
18
|
+
"occurred_at": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"format": "date-time",
|
|
21
|
+
"description": "RFC 3339 timestamp when this fulfillment event occurred."
|
|
22
|
+
},
|
|
23
|
+
"type": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Fulfillment event type. Common values include: processing (preparing to ship), shipped (handed to carrier), in_transit (in delivery network), delivered (received by buyer), failed_attempt (delivery attempt failed), canceled (fulfillment canceled), undeliverable (cannot be delivered), returned_to_sender (returned to merchant)."
|
|
26
|
+
},
|
|
27
|
+
"line_items": {
|
|
28
|
+
"type": "array",
|
|
29
|
+
"items": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"required": [
|
|
32
|
+
"id",
|
|
33
|
+
"quantity"
|
|
34
|
+
],
|
|
35
|
+
"properties": {
|
|
36
|
+
"id": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"description": "Line item ID reference."
|
|
39
|
+
},
|
|
40
|
+
"quantity": {
|
|
41
|
+
"type": "integer",
|
|
42
|
+
"minimum": 1,
|
|
43
|
+
"description": "Quantity fulfilled in this event."
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"description": "Which line items and quantities are fulfilled in this event."
|
|
48
|
+
},
|
|
49
|
+
"tracking_number": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "Carrier tracking number (required if type != processing)."
|
|
52
|
+
},
|
|
53
|
+
"tracking_url": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"format": "uri",
|
|
56
|
+
"description": "URL to track this shipment (required if type != processing)."
|
|
57
|
+
},
|
|
58
|
+
"carrier": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"description": "Carrier name (e.g., 'FedEx', 'USPS')."
|
|
61
|
+
},
|
|
62
|
+
"description": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"description": "Human-readable description of the shipment status or delivery information (e.g., 'Delivered to front door', 'Out for delivery')."
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_group.json",
|
|
4
|
+
"title": "Fulfillment Group",
|
|
5
|
+
"description": "A merchant-generated package/group of line items with fulfillment options.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"id",
|
|
9
|
+
"line_item_ids"
|
|
10
|
+
],
|
|
11
|
+
"additionalProperties": true,
|
|
12
|
+
"properties": {
|
|
13
|
+
"id": {
|
|
14
|
+
"type": "string",
|
|
15
|
+
"description": "Group identifier for referencing merchant-generated groups in updates.",
|
|
16
|
+
"ucp_request": {
|
|
17
|
+
"create": "omit",
|
|
18
|
+
"update": "required"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"line_item_ids": {
|
|
22
|
+
"type": "array",
|
|
23
|
+
"description": "Line item IDs included in this group/package.",
|
|
24
|
+
"items": {
|
|
25
|
+
"type": "string"
|
|
26
|
+
},
|
|
27
|
+
"ucp_request": "omit"
|
|
28
|
+
},
|
|
29
|
+
"options": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"description": "Available fulfillment options for this group.",
|
|
32
|
+
"items": {
|
|
33
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_option.json"
|
|
34
|
+
},
|
|
35
|
+
"ucp_request": "omit"
|
|
36
|
+
},
|
|
37
|
+
"selected_option_id": {
|
|
38
|
+
"type": [
|
|
39
|
+
"string",
|
|
40
|
+
"null"
|
|
41
|
+
],
|
|
42
|
+
"description": "ID of the selected fulfillment option for this group."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_method.json",
|
|
4
|
+
"title": "Fulfillment Method",
|
|
5
|
+
"description": "A fulfillment method (shipping or pickup) with destinations and groups.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"required": [
|
|
8
|
+
"id",
|
|
9
|
+
"type",
|
|
10
|
+
"line_item_ids"
|
|
11
|
+
],
|
|
12
|
+
"additionalProperties": true,
|
|
13
|
+
"properties": {
|
|
14
|
+
"id": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "Unique fulfillment method identifier.",
|
|
17
|
+
"ucp_request": {
|
|
18
|
+
"create": "omit",
|
|
19
|
+
"update": "optional"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"type": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"enum": [
|
|
25
|
+
"shipping",
|
|
26
|
+
"pickup"
|
|
27
|
+
],
|
|
28
|
+
"description": "Fulfillment method type.",
|
|
29
|
+
"ucp_request": {
|
|
30
|
+
"create": "required",
|
|
31
|
+
"update": "optional"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"line_item_ids": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"description": "Line item IDs fulfilled via this method.",
|
|
37
|
+
"items": {
|
|
38
|
+
"type": "string"
|
|
39
|
+
},
|
|
40
|
+
"ucp_request": {
|
|
41
|
+
"create": "optional",
|
|
42
|
+
"update": "required"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"destinations": {
|
|
46
|
+
"type": "array",
|
|
47
|
+
"description": "Available destinations. For shipping: addresses. For pickup: retail locations.",
|
|
48
|
+
"items": {
|
|
49
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_destination.json"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"selected_destination_id": {
|
|
53
|
+
"type": [
|
|
54
|
+
"string",
|
|
55
|
+
"null"
|
|
56
|
+
],
|
|
57
|
+
"description": "ID of the selected destination."
|
|
58
|
+
},
|
|
59
|
+
"groups": {
|
|
60
|
+
"type": "array",
|
|
61
|
+
"description": "Fulfillment groups for selecting options. Agent sets selected_option_id on groups to choose shipping method.",
|
|
62
|
+
"items": {
|
|
63
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_group.json"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment_option.json",
|
|
4
|
+
"title": "Fulfillment Option",
|
|
5
|
+
"description": "A fulfillment option within a group (e.g., Standard Shipping $5, Express $15).",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"ucp_shared_request": true,
|
|
8
|
+
"required": [
|
|
9
|
+
"id",
|
|
10
|
+
"title",
|
|
11
|
+
"totals"
|
|
12
|
+
],
|
|
13
|
+
"additionalProperties": true,
|
|
14
|
+
"properties": {
|
|
15
|
+
"id": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Unique fulfillment option identifier.",
|
|
18
|
+
"ucp_request": "omit"
|
|
19
|
+
},
|
|
20
|
+
"title": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "Short label (e.g., 'Express Shipping', 'Curbside Pickup').",
|
|
23
|
+
"ucp_request": "omit"
|
|
24
|
+
},
|
|
25
|
+
"description": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Complete context for buyer decision (e.g., 'Arrives Dec 12-15 via FedEx').",
|
|
28
|
+
"ucp_request": "omit"
|
|
29
|
+
},
|
|
30
|
+
"carrier": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Carrier name (for shipping).",
|
|
33
|
+
"ucp_request": "omit"
|
|
34
|
+
},
|
|
35
|
+
"earliest_fulfillment_time": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"format": "date-time",
|
|
38
|
+
"description": "Earliest fulfillment date.",
|
|
39
|
+
"ucp_request": "omit"
|
|
40
|
+
},
|
|
41
|
+
"latest_fulfillment_time": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"format": "date-time",
|
|
44
|
+
"description": "Latest fulfillment date.",
|
|
45
|
+
"ucp_request": "omit"
|
|
46
|
+
},
|
|
47
|
+
"totals": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": {
|
|
50
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/total.json"
|
|
51
|
+
},
|
|
52
|
+
"description": "Fulfillment option totals breakdown.",
|
|
53
|
+
"ucp_request": "omit"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://ucp.dev/2026-04-08/schemas/shopping/types/info_code.json",
|
|
4
|
+
"title": "Info Code",
|
|
5
|
+
"description": "Info code identifying the type of informational message. Standard codes are defined in capability specs (see examples), and have standardized semantics; freeform codes are permitted.",
|
|
6
|
+
"type": "string",
|
|
7
|
+
"examples": [
|
|
8
|
+
"identity_optional",
|
|
9
|
+
"signal",
|
|
10
|
+
"free_shipping",
|
|
11
|
+
"not_found"
|
|
12
|
+
]
|
|
13
|
+
}
|