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,634 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openrpc": "1.3.2",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "UCP Shopping Embedded Protocol",
|
|
5
|
+
"description": "Embedded Protocol (EP) methods for the UCP shopping service. Methods are sent from Merchant to Host via postMessage using JSON-RPC 2.0. Method prefixes indicate capability scope: ep.{capability} (i.e. ep.checkout). Schema references are logical pointers - actual payload shape is determined by negotiated capabilities.\n\nEmbedded Protocol is a client-to-client postMessage interface, so there is no endpoint URL to access this API. Platforms detect merchant support for this protocol based on the presence of `services[\"dev.ucp.shopping\"][transport=embedded]` in discovery responses.",
|
|
6
|
+
"version": "2026-04-08"
|
|
7
|
+
},
|
|
8
|
+
"servers": [],
|
|
9
|
+
"methods": [
|
|
10
|
+
{
|
|
11
|
+
"name": "ec.ready",
|
|
12
|
+
"summary": "Handshake from merchant to host",
|
|
13
|
+
"description": "Initiates the Embedded Checkout Protocol. Merchant declares which delegations it accepts and requests any additional authorization, host responds with optional channel upgrade, auth credential, and initial checkout state.",
|
|
14
|
+
"params": [
|
|
15
|
+
{
|
|
16
|
+
"name": "delegate",
|
|
17
|
+
"required": true,
|
|
18
|
+
"schema": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"description": "Delegation types the merchant accepts. Must be subset of checkout.embedded.delegations.",
|
|
21
|
+
"items": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^[a-z_]+(?:\\.[a-z_]+)*$"
|
|
24
|
+
},
|
|
25
|
+
"uniqueItems": true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "auth",
|
|
30
|
+
"schema": {
|
|
31
|
+
"$ref": "#/components/schemas/auth"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"result": {
|
|
36
|
+
"name": "readyResult",
|
|
37
|
+
"schema": {
|
|
38
|
+
"oneOf": [
|
|
39
|
+
{
|
|
40
|
+
"type": "object",
|
|
41
|
+
"description": "Handshake response from host.",
|
|
42
|
+
"required": [
|
|
43
|
+
"ucp"
|
|
44
|
+
],
|
|
45
|
+
"properties": {
|
|
46
|
+
"ucp": {
|
|
47
|
+
"$ref": "#/components/schemas/ucp_success"
|
|
48
|
+
},
|
|
49
|
+
"upgrade": {
|
|
50
|
+
"type": "object",
|
|
51
|
+
"description": "Channel upgrade instructions. If present, switch to provided MessagePort.",
|
|
52
|
+
"properties": {
|
|
53
|
+
"port": {
|
|
54
|
+
"type": "object",
|
|
55
|
+
"description": "MessagePort for upgraded channel. Runtime type is MessagePort."
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"credential": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"description": "Requested authorization. Some common examples include API key and OAuth token."
|
|
62
|
+
},
|
|
63
|
+
"checkout": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"description": "Initial delegation state from host. Fields are permitted only when the corresponding delegation is accepted.",
|
|
66
|
+
"properties": {
|
|
67
|
+
"payment": {
|
|
68
|
+
"$ref": "#/components/schemas/payment_instrument_selection"
|
|
69
|
+
},
|
|
70
|
+
"fulfillment": {
|
|
71
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/fulfillment.json"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json"
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "ec.auth",
|
|
86
|
+
"summary": "Authorization exchange between host & business.",
|
|
87
|
+
"description": "Augments Embedded Checkout Protocol by doing auth exchanges per business requirement. Can be used by business to refresh a previously exchanged authorization.",
|
|
88
|
+
"params": [
|
|
89
|
+
{
|
|
90
|
+
"name": "type",
|
|
91
|
+
"schema": {
|
|
92
|
+
"$ref": "#/components/schemas/type"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"result": {
|
|
97
|
+
"name": "authResult",
|
|
98
|
+
"schema": {
|
|
99
|
+
"oneOf": [
|
|
100
|
+
{
|
|
101
|
+
"type": "object",
|
|
102
|
+
"description": "Auth response from host containing the requested authorization data.",
|
|
103
|
+
"required": [
|
|
104
|
+
"ucp",
|
|
105
|
+
"credential"
|
|
106
|
+
],
|
|
107
|
+
"properties": {
|
|
108
|
+
"ucp": {
|
|
109
|
+
"$ref": "#/components/schemas/ucp_success"
|
|
110
|
+
},
|
|
111
|
+
"credential": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"description": "Requested authorization. Some common examples include API key and OAuth token."
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "ec.error",
|
|
126
|
+
"summary": "A session-level error has occurred.",
|
|
127
|
+
"description": "Business notifies host that a session-level error, unrelated to the checkout resource, has occurred.",
|
|
128
|
+
"params": [
|
|
129
|
+
{
|
|
130
|
+
"name": "error",
|
|
131
|
+
"required": true,
|
|
132
|
+
"schema": {
|
|
133
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json",
|
|
134
|
+
"description": "Session-level error raised by the business."
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"name": "ec.start",
|
|
141
|
+
"summary": "Checkout visible to buyer",
|
|
142
|
+
"description": "Merchant notifies host that checkout UI is visible and ready for interaction. Sent after successful ec.ready handshake.",
|
|
143
|
+
"params": [
|
|
144
|
+
{
|
|
145
|
+
"name": "checkout",
|
|
146
|
+
"required": true,
|
|
147
|
+
"schema": {
|
|
148
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/checkout.json",
|
|
149
|
+
"description": "Current checkout state."
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"name": "ec.complete",
|
|
156
|
+
"summary": "Checkout completed successfully",
|
|
157
|
+
"description": "Merchant notifies host that order has been placed successfully.",
|
|
158
|
+
"params": [
|
|
159
|
+
{
|
|
160
|
+
"name": "checkout",
|
|
161
|
+
"required": true,
|
|
162
|
+
"schema": {
|
|
163
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/checkout.json",
|
|
164
|
+
"description": "Final checkout state."
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
"name": "ec.messages.change",
|
|
171
|
+
"summary": "Checkout messages changed",
|
|
172
|
+
"description": "Merchant notifies host that checkout.messages has changed. Includes errors, warnings, and info. Host should update UI accordingly.",
|
|
173
|
+
"params": [
|
|
174
|
+
{
|
|
175
|
+
"name": "checkout",
|
|
176
|
+
"required": true,
|
|
177
|
+
"schema": {
|
|
178
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/checkout.json",
|
|
179
|
+
"description": "Current checkout state with updated messages."
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "ec.line_items.change",
|
|
186
|
+
"summary": "Line items changed",
|
|
187
|
+
"description": "Merchant notifies host that checkout.line_items has changed (item added, removed, quantity updated).",
|
|
188
|
+
"params": [
|
|
189
|
+
{
|
|
190
|
+
"name": "checkout",
|
|
191
|
+
"required": true,
|
|
192
|
+
"schema": {
|
|
193
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/checkout.json",
|
|
194
|
+
"description": "Current checkout state with updated line items."
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"name": "ec.buyer.change",
|
|
201
|
+
"summary": "Buyer information changed",
|
|
202
|
+
"description": "Merchant notifies host that checkout.buyer has changed (email, phone, address updated).",
|
|
203
|
+
"params": [
|
|
204
|
+
{
|
|
205
|
+
"name": "checkout",
|
|
206
|
+
"required": true,
|
|
207
|
+
"schema": {
|
|
208
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/checkout.json",
|
|
209
|
+
"description": "Current checkout state with updated buyer."
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"name": "ec.totals.change",
|
|
216
|
+
"summary": "Checkout totals changed",
|
|
217
|
+
"description": "Merchant notifies host that checkout.totals has changed. Covers all total line updates including taxes, fees, discounts, and fulfillment costs. For changes that also affect a specific domain (e.g., fulfillment cost update), this message MUST be sent after the domain-specific change message (e.g., ec.fulfillment.change).",
|
|
218
|
+
"params": [
|
|
219
|
+
{
|
|
220
|
+
"name": "checkout",
|
|
221
|
+
"required": true,
|
|
222
|
+
"schema": {
|
|
223
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/checkout.json",
|
|
224
|
+
"description": "Current checkout state with updated totals."
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "ec.payment.change",
|
|
231
|
+
"summary": "Payment state changed",
|
|
232
|
+
"description": "Merchant notifies host that checkout.payment has changed (instrument selected, status updated).",
|
|
233
|
+
"params": [
|
|
234
|
+
{
|
|
235
|
+
"name": "checkout",
|
|
236
|
+
"required": true,
|
|
237
|
+
"schema": {
|
|
238
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/checkout.json",
|
|
239
|
+
"description": "Current checkout state with updated payment."
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "ec.payment.instruments_change_request",
|
|
246
|
+
"summary": "Request payment instrument change",
|
|
247
|
+
"description": "Merchant requests host to present payment instrument selection UI for the buyer to change their payment method.",
|
|
248
|
+
"params": [
|
|
249
|
+
{
|
|
250
|
+
"name": "checkout",
|
|
251
|
+
"required": true,
|
|
252
|
+
"schema": {
|
|
253
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/checkout.json",
|
|
254
|
+
"description": "Current checkout state."
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
],
|
|
258
|
+
"result": {
|
|
259
|
+
"name": "instrumentsChangeResult",
|
|
260
|
+
"schema": {
|
|
261
|
+
"oneOf": [
|
|
262
|
+
{
|
|
263
|
+
"type": "object",
|
|
264
|
+
"description": "Checkout state after instrument selection.",
|
|
265
|
+
"required": [
|
|
266
|
+
"ucp",
|
|
267
|
+
"checkout"
|
|
268
|
+
],
|
|
269
|
+
"properties": {
|
|
270
|
+
"ucp": {
|
|
271
|
+
"$ref": "#/components/schemas/ucp_success"
|
|
272
|
+
},
|
|
273
|
+
"checkout": {
|
|
274
|
+
"type": "object",
|
|
275
|
+
"description": "Partial checkout update with payment instrument selection.",
|
|
276
|
+
"properties": {
|
|
277
|
+
"payment": {
|
|
278
|
+
"$ref": "#/components/schemas/payment_instrument_selection"
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json"
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"name": "ec.payment.credential_request",
|
|
293
|
+
"summary": "Request payment credential",
|
|
294
|
+
"description": "Merchant requests host to collect payment credential for selected instrument (CVV, 3DS, wallet confirmation).",
|
|
295
|
+
"params": [
|
|
296
|
+
{
|
|
297
|
+
"name": "checkout",
|
|
298
|
+
"required": true,
|
|
299
|
+
"schema": {
|
|
300
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/checkout.json",
|
|
301
|
+
"description": "Current checkout state with selected instrument."
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
],
|
|
305
|
+
"result": {
|
|
306
|
+
"name": "credentialResult",
|
|
307
|
+
"schema": {
|
|
308
|
+
"oneOf": [
|
|
309
|
+
{
|
|
310
|
+
"type": "object",
|
|
311
|
+
"description": "Checkout state with payment credential ready for completion.",
|
|
312
|
+
"required": [
|
|
313
|
+
"ucp",
|
|
314
|
+
"checkout"
|
|
315
|
+
],
|
|
316
|
+
"properties": {
|
|
317
|
+
"ucp": {
|
|
318
|
+
"$ref": "#/components/schemas/ucp_success"
|
|
319
|
+
},
|
|
320
|
+
"checkout": {
|
|
321
|
+
"type": "object",
|
|
322
|
+
"description": "Partial checkout update with payment credential.",
|
|
323
|
+
"properties": {
|
|
324
|
+
"payment": {
|
|
325
|
+
"$ref": "#/components/schemas/payment_instruments"
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json"
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
"name": "ec.window.open_request",
|
|
340
|
+
"summary": "Request window open",
|
|
341
|
+
"description": "The buyer activated a link within checkout. The host MUST present the content to the buyer and respond with a success result, or respond with a window_open_rejected_error error if host policy prevented the navigation.",
|
|
342
|
+
"params": [
|
|
343
|
+
{
|
|
344
|
+
"name": "url",
|
|
345
|
+
"required": true,
|
|
346
|
+
"schema": {
|
|
347
|
+
"type": "string",
|
|
348
|
+
"format": "uri",
|
|
349
|
+
"description": "The URL of the resource to present."
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
],
|
|
353
|
+
"result": {
|
|
354
|
+
"name": "windowOpenResult",
|
|
355
|
+
"schema": {
|
|
356
|
+
"oneOf": [
|
|
357
|
+
{
|
|
358
|
+
"type": "object",
|
|
359
|
+
"description": "Acknowledgement that the host handled the request.",
|
|
360
|
+
"required": [
|
|
361
|
+
"ucp"
|
|
362
|
+
],
|
|
363
|
+
"properties": {
|
|
364
|
+
"ucp": {
|
|
365
|
+
"$ref": "#/components/schemas/ucp_success"
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json"
|
|
371
|
+
}
|
|
372
|
+
]
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/fulfillment.json#/embedded/methods/ec.fulfillment.change"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/fulfillment.json#/embedded/methods/ec.fulfillment.address_change_request"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"name": "ep.cart.ready",
|
|
384
|
+
"summary": "Handshake from business to host",
|
|
385
|
+
"description": "Initiates the Embedded Cart Protocol. Business declares which delegation it supports and requests any additional authorization, host responds with optional channel upgrade and auth credential.",
|
|
386
|
+
"params": [
|
|
387
|
+
{
|
|
388
|
+
"name": "delegate",
|
|
389
|
+
"required": true,
|
|
390
|
+
"schema": {
|
|
391
|
+
"type": "array",
|
|
392
|
+
"description": "Delegation types the merchant accepts.",
|
|
393
|
+
"items": {
|
|
394
|
+
"type": "string",
|
|
395
|
+
"pattern": "^[a-z_]+(?:\\.[a-z_]+)*$"
|
|
396
|
+
},
|
|
397
|
+
"uniqueItems": true
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"name": "auth",
|
|
402
|
+
"schema": {
|
|
403
|
+
"$ref": "#/components/schemas/auth"
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
],
|
|
407
|
+
"result": {
|
|
408
|
+
"name": "readyResult",
|
|
409
|
+
"schema": {
|
|
410
|
+
"oneOf": [
|
|
411
|
+
{
|
|
412
|
+
"type": "object",
|
|
413
|
+
"description": "Handshake response from host.",
|
|
414
|
+
"required": [
|
|
415
|
+
"ucp"
|
|
416
|
+
],
|
|
417
|
+
"properties": {
|
|
418
|
+
"ucp": {
|
|
419
|
+
"$ref": "#/components/schemas/ucp_success"
|
|
420
|
+
},
|
|
421
|
+
"upgrade": {
|
|
422
|
+
"type": "object",
|
|
423
|
+
"description": "Channel upgrade instructions. If present, switch to provided MessagePort.",
|
|
424
|
+
"properties": {
|
|
425
|
+
"port": {
|
|
426
|
+
"type": "object",
|
|
427
|
+
"description": "MessagePort for upgraded channel. Runtime type is MessagePort."
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
"credential": {
|
|
432
|
+
"type": "string",
|
|
433
|
+
"description": "Requested authorization. Some common examples include API key and OAuth token."
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json"
|
|
439
|
+
}
|
|
440
|
+
]
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"name": "ep.cart.auth",
|
|
446
|
+
"summary": "Authorization exchange between host & business.",
|
|
447
|
+
"description": "Augments Embedded Cart Protocol by doing auth exchanges per business requirement. Can be used by business to refresh a previously exchanged authorization.",
|
|
448
|
+
"params": [
|
|
449
|
+
{
|
|
450
|
+
"name": "type",
|
|
451
|
+
"schema": {
|
|
452
|
+
"$ref": "#/components/schemas/type"
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
],
|
|
456
|
+
"result": {
|
|
457
|
+
"name": "authResult",
|
|
458
|
+
"schema": {
|
|
459
|
+
"oneOf": [
|
|
460
|
+
{
|
|
461
|
+
"type": "object",
|
|
462
|
+
"description": "Auth response from host containing the requested authorization data.",
|
|
463
|
+
"required": [
|
|
464
|
+
"ucp",
|
|
465
|
+
"credential"
|
|
466
|
+
],
|
|
467
|
+
"properties": {
|
|
468
|
+
"ucp": {
|
|
469
|
+
"$ref": "#/components/schemas/ucp_success"
|
|
470
|
+
},
|
|
471
|
+
"credential": {
|
|
472
|
+
"type": "string",
|
|
473
|
+
"description": "Requested authorization. Some common examples include API key and OAuth token."
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json"
|
|
479
|
+
}
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
"name": "ep.cart.error",
|
|
486
|
+
"summary": "A session-level error has occurred.",
|
|
487
|
+
"description": "Business notifies host that a session-level error, unrelated to the cart resource, has occurred.",
|
|
488
|
+
"params": [
|
|
489
|
+
{
|
|
490
|
+
"name": "error",
|
|
491
|
+
"required": true,
|
|
492
|
+
"schema": {
|
|
493
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/error_response.json",
|
|
494
|
+
"description": "Session-level error raised by the business."
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
]
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "ep.cart.start",
|
|
501
|
+
"summary": "Cart visible to buyer",
|
|
502
|
+
"description": "Business notifies host that cart UI is visible and ready for interaction.",
|
|
503
|
+
"params": [
|
|
504
|
+
{
|
|
505
|
+
"name": "cart",
|
|
506
|
+
"required": true,
|
|
507
|
+
"schema": {
|
|
508
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/cart.json",
|
|
509
|
+
"description": "Current cart state."
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
]
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
"name": "ep.cart.complete",
|
|
516
|
+
"summary": "Cart completed successfully",
|
|
517
|
+
"description": "Business notifies host that cart building has completed.",
|
|
518
|
+
"params": [
|
|
519
|
+
{
|
|
520
|
+
"name": "cart",
|
|
521
|
+
"required": true,
|
|
522
|
+
"schema": {
|
|
523
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/cart.json",
|
|
524
|
+
"description": "Final cart state."
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
]
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"name": "ep.cart.line_items.change",
|
|
531
|
+
"summary": "Line items changed",
|
|
532
|
+
"description": "Business notifies host that cart.line_items has changed (item added, removed, quantity updated).",
|
|
533
|
+
"params": [
|
|
534
|
+
{
|
|
535
|
+
"name": "cart",
|
|
536
|
+
"required": true,
|
|
537
|
+
"schema": {
|
|
538
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/cart.json",
|
|
539
|
+
"description": "Current cart state with updated line items."
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
]
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "ep.cart.buyer.change",
|
|
546
|
+
"summary": "Buyer information changed",
|
|
547
|
+
"description": "Business notifies host that cart.buyer has changed (email, phone, name updated).",
|
|
548
|
+
"params": [
|
|
549
|
+
{
|
|
550
|
+
"name": "cart",
|
|
551
|
+
"required": true,
|
|
552
|
+
"schema": {
|
|
553
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/cart.json",
|
|
554
|
+
"description": "Current cart state with updated buyer."
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
]
|
|
558
|
+
},
|
|
559
|
+
{
|
|
560
|
+
"name": "ep.cart.messages.change",
|
|
561
|
+
"summary": "Cart messages changed",
|
|
562
|
+
"description": "Business notifies host that cart.messages has changed. Includes errors, warnings, and info. Host should update UI accordingly.",
|
|
563
|
+
"params": [
|
|
564
|
+
{
|
|
565
|
+
"name": "cart",
|
|
566
|
+
"required": true,
|
|
567
|
+
"schema": {
|
|
568
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/cart.json",
|
|
569
|
+
"description": "Current cart state with updated messages."
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
}
|
|
574
|
+
],
|
|
575
|
+
"components": {
|
|
576
|
+
"schemas": {
|
|
577
|
+
"ucp_success": {
|
|
578
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/ucp.json#/$defs/success"
|
|
579
|
+
},
|
|
580
|
+
"payment_instruments": {
|
|
581
|
+
"type": "object",
|
|
582
|
+
"description": "Payment instruments from host.",
|
|
583
|
+
"properties": {
|
|
584
|
+
"instruments": {
|
|
585
|
+
"type": "array",
|
|
586
|
+
"items": {
|
|
587
|
+
"$ref": "https://ucp.dev/2026-04-08/schemas/shopping/types/payment_instrument.json#/$defs/selected_payment_instrument"
|
|
588
|
+
},
|
|
589
|
+
"description": "Available payment instruments."
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
"payment_instrument_selection": {
|
|
594
|
+
"description": "Payment instruments with selected instrument ID.",
|
|
595
|
+
"allOf": [
|
|
596
|
+
{
|
|
597
|
+
"$ref": "#/components/schemas/payment_instruments"
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
"properties": {
|
|
601
|
+
"selected_instrument_id": {
|
|
602
|
+
"type": "string",
|
|
603
|
+
"description": "ID of the selected payment instrument."
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
},
|
|
609
|
+
"type": {
|
|
610
|
+
"type": "string",
|
|
611
|
+
"description": "The type of authorization data business is requesting from the host.",
|
|
612
|
+
"examples": [
|
|
613
|
+
"oauth",
|
|
614
|
+
"api_key",
|
|
615
|
+
"jwt"
|
|
616
|
+
]
|
|
617
|
+
},
|
|
618
|
+
"auth": {
|
|
619
|
+
"type": "object",
|
|
620
|
+
"properties": {
|
|
621
|
+
"type": {
|
|
622
|
+
"$ref": "#/components/schemas/type"
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
"x-delegations": [
|
|
629
|
+
"payment.instruments_change",
|
|
630
|
+
"payment.credential",
|
|
631
|
+
"fulfillment.address_change",
|
|
632
|
+
"window.open"
|
|
633
|
+
]
|
|
634
|
+
}
|