@hyperscale0/udl 2.6.0 → 3.0.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.
Files changed (213) hide show
  1. package/CHANGELOG.md +2 -322
  2. package/LICENSING.md +1 -2
  3. package/README.md +3 -114
  4. package/TRADEMARKS.md +2 -2
  5. package/dist/diagnostics.d.ts +21 -201
  6. package/dist/diagnostics.d.ts.map +1 -1
  7. package/dist/diagnostics.js +29 -193
  8. package/dist/diagnostics.js.map +1 -1
  9. package/dist/evolution.d.ts +3 -132
  10. package/dist/evolution.d.ts.map +1 -1
  11. package/dist/evolution.js +29 -633
  12. package/dist/evolution.js.map +1 -1
  13. package/dist/finance.d.ts +5 -72
  14. package/dist/finance.d.ts.map +1 -1
  15. package/dist/finance.js +233 -737
  16. package/dist/finance.js.map +1 -1
  17. package/dist/index.d.ts +7 -18
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +7 -12
  20. package/dist/index.js.map +1 -1
  21. package/dist/instrument-references.d.ts.map +1 -1
  22. package/dist/instrument-references.js +3 -2
  23. package/dist/instrument-references.js.map +1 -1
  24. package/dist/schema.d.ts +2079 -4564
  25. package/dist/schema.d.ts.map +1 -1
  26. package/dist/schema.js +270 -1609
  27. package/dist/schema.js.map +1 -1
  28. package/dist/validation.d.ts +8 -104
  29. package/dist/validation.d.ts.map +1 -1
  30. package/dist/validation.js +653 -3271
  31. package/dist/validation.js.map +1 -1
  32. package/docs/README.md +147 -14
  33. package/package.json +7 -11
  34. package/spec/README.md +151 -164
  35. package/spec/darb.udl.json +249 -0
  36. package/spec/udl.schema.json +4104 -3202
  37. package/src/diagnostics.ts +51 -246
  38. package/src/evolution.ts +39 -1045
  39. package/src/finance.ts +287 -1127
  40. package/src/index.ts +18 -142
  41. package/src/instrument-references.ts +3 -2
  42. package/src/schema.ts +285 -1843
  43. package/src/validation.ts +870 -5611
  44. package/conformance/README.md +0 -82
  45. package/conformance/evolution/action-contract.expected.json +0 -10
  46. package/conformance/evolution/action-contract.live.udl +0 -44
  47. package/conformance/evolution/action-contract.next.udl +0 -45
  48. package/conformance/evolution/product-identity.expected.json +0 -10
  49. package/conformance/evolution/product-identity.live.udl +0 -55
  50. package/conformance/evolution/product-identity.next.udl +0 -55
  51. package/conformance/evolution/version-required.expected.json +0 -10
  52. package/conformance/evolution/version-required.live.udl +0 -55
  53. package/conformance/evolution/version-required.next.udl +0 -58
  54. package/conformance/invalid/action-without-transition.expected.json +0 -10
  55. package/conformance/invalid/action-without-transition.udl +0 -60
  56. package/conformance/invalid/agent-description-too-long.expected.json +0 -10
  57. package/conformance/invalid/agent-description-too-long.udl +0 -57
  58. package/conformance/invalid/blank-title.expected.json +0 -10
  59. package/conformance/invalid/blank-title.udl +0 -54
  60. package/conformance/invalid/call-binds-results.expected.json +0 -10
  61. package/conformance/invalid/call-binds-results.udl +0 -314
  62. package/conformance/invalid/call-unknown-action.expected.json +0 -10
  63. package/conformance/invalid/call-unknown-action.udl +0 -314
  64. package/conformance/invalid/composition-dial-duplicate-key.expected.json +0 -10
  65. package/conformance/invalid/composition-dial-duplicate-key.udl +0 -73
  66. package/conformance/invalid/depth-budget.expected.json +0 -10
  67. package/conformance/invalid/depth-budget.udl +0 -49
  68. package/conformance/invalid/duplicate-subject.expected.json +0 -10
  69. package/conformance/invalid/duplicate-subject.udl +0 -230
  70. package/conformance/invalid/forged-effects.expected.json +0 -10
  71. package/conformance/invalid/forged-effects.udl +0 -76
  72. package/conformance/invalid/format-version.expected.json +0 -10
  73. package/conformance/invalid/format-version.udl +0 -54
  74. package/conformance/invalid/instrument-id-not-snake-case.expected.json +0 -10
  75. package/conformance/invalid/instrument-id-not-snake-case.udl +0 -54
  76. package/conformance/invalid/invalid-aggregate-gate-shape.expected.json +0 -10
  77. package/conformance/invalid/invalid-aggregate-gate-shape.udl +0 -1819
  78. package/conformance/invalid/invalid-check-duration.expected.json +0 -10
  79. package/conformance/invalid/invalid-check-duration.udl +0 -219
  80. package/conformance/invalid/invalid-dial-anchor.expected.json +0 -10
  81. package/conformance/invalid/invalid-dial-anchor.udl +0 -219
  82. package/conformance/invalid/invalid-exception-parent-ref.expected.json +0 -10
  83. package/conformance/invalid/invalid-exception-parent-ref.udl +0 -2487
  84. package/conformance/invalid/invalid-exposure-shape.expected.json +0 -10
  85. package/conformance/invalid/invalid-exposure-shape.udl +0 -1819
  86. package/conformance/invalid/invalid-journeys.expected.json +0 -10
  87. package/conformance/invalid/invalid-journeys.udl +0 -77
  88. package/conformance/invalid/invalid-remainder.expected.json +0 -10
  89. package/conformance/invalid/invalid-remainder.udl +0 -220
  90. package/conformance/invalid/invalid-schema-keyword.expected.json +0 -10
  91. package/conformance/invalid/invalid-schema-keyword.udl +0 -220
  92. package/conformance/invalid/invalid-utf8.expected.json +0 -10
  93. package/conformance/invalid/invalid-utf8.udl +0 -1
  94. package/conformance/invalid/leaf-effect-mismatch.expected.json +0 -10
  95. package/conformance/invalid/leaf-effect-mismatch.udl +0 -314
  96. package/conformance/invalid/malformed-json.expected.json +0 -10
  97. package/conformance/invalid/malformed-json.udl +0 -1
  98. package/conformance/invalid/missing-create-action.expected.json +0 -10
  99. package/conformance/invalid/missing-create-action.udl +0 -48
  100. package/conformance/invalid/missing-exception-amount-field.expected.json +0 -10
  101. package/conformance/invalid/missing-exception-amount-field.udl +0 -2487
  102. package/conformance/invalid/missing-exception-contract.expected.json +0 -14
  103. package/conformance/invalid/missing-exception-contract.udl +0 -2523
  104. package/conformance/invalid/missing-exception-reason-field.expected.json +0 -10
  105. package/conformance/invalid/missing-exception-reason-field.udl +0 -2487
  106. package/conformance/invalid/not-an-object.expected.json +0 -10
  107. package/conformance/invalid/not-an-object.udl +0 -1
  108. package/conformance/invalid/payout-reconcile-not-a-bank-debit.expected.json +0 -10
  109. package/conformance/invalid/payout-reconcile-not-a-bank-debit.udl +0 -259
  110. package/conformance/invalid/piece-plan-without-partition.expected.json +0 -10
  111. package/conformance/invalid/piece-plan-without-partition.udl +0 -305
  112. package/conformance/invalid/private-action-independent-approval.expected.json +0 -10
  113. package/conformance/invalid/private-action-independent-approval.udl +0 -314
  114. package/conformance/invalid/quote-freeze-set-incomplete.expected.json +0 -10
  115. package/conformance/invalid/quote-freeze-set-incomplete.udl +0 -261
  116. package/conformance/invalid/quote-named-reference-gate.expected.json +0 -10
  117. package/conformance/invalid/quote-named-reference-gate.udl +0 -50
  118. package/conformance/invalid/reconcile-named-reference-gate.expected.json +0 -10
  119. package/conformance/invalid/reconcile-named-reference-gate.udl +0 -50
  120. package/conformance/invalid/unfund-order-not-reversed.expected.json +0 -10
  121. package/conformance/invalid/unfund-order-not-reversed.udl +0 -314
  122. package/conformance/invalid/unknown-key.expected.json +0 -10
  123. package/conformance/invalid/unknown-key.udl +0 -55
  124. package/conformance/invalid/unknown-reference-gate-field.expected.json +0 -10
  125. package/conformance/invalid/unknown-reference-gate-field.udl +0 -1819
  126. package/conformance/invalid/unknown-required-field.expected.json +0 -10
  127. package/conformance/invalid/unknown-required-field.udl +0 -220
  128. package/conformance/invalid/unreachable-state.expected.json +0 -10
  129. package/conformance/invalid/unreachable-state.udl +0 -55
  130. package/conformance/invalid/wrong-exception-amount-field.expected.json +0 -10
  131. package/conformance/invalid/wrong-exception-amount-field.udl +0 -2487
  132. package/conformance/invalid/wrong-exception-reason-field.expected.json +0 -10
  133. package/conformance/invalid/wrong-exception-reason-field.udl +0 -2487
  134. package/conformance/valid/agent-description.expected.json +0 -6
  135. package/conformance/valid/agent-description.udl +0 -66
  136. package/conformance/valid/attested.expected.json +0 -6
  137. package/conformance/valid/attested.udl +0 -251
  138. package/conformance/valid/cards.expected.json +0 -6
  139. package/conformance/valid/cards.udl +0 -1579
  140. package/conformance/valid/commerce-escrow.expected.json +0 -6
  141. package/conformance/valid/commerce-escrow.udl +0 -1512
  142. package/conformance/valid/compiled-crowdfunding.expected.json +0 -6
  143. package/conformance/valid/compiled-crowdfunding.udl +0 -1843
  144. package/conformance/valid/compiled-watch-club.expected.json +0 -6
  145. package/conformance/valid/compiled-watch-club.udl +0 -2486
  146. package/conformance/valid/complete-contract.expected.json +0 -6
  147. package/conformance/valid/complete-contract.udl +0 -218
  148. package/conformance/valid/effect-signatures.expected.json +0 -6
  149. package/conformance/valid/effect-signatures.udl +0 -75
  150. package/conformance/valid/hand-edited.expected.json +0 -6
  151. package/conformance/valid/hand-edited.udl +0 -1
  152. package/conformance/valid/insured-car-marketplace.expected.json +0 -6
  153. package/conformance/valid/insured-car-marketplace.udl +0 -1050
  154. package/conformance/valid/insured-travel.expected.json +0 -6
  155. package/conformance/valid/insured-travel.udl +0 -3469
  156. package/conformance/valid/minimal.expected.json +0 -6
  157. package/conformance/valid/minimal.udl +0 -62
  158. package/conformance/valid/piece-plan-calls.expected.json +0 -6
  159. package/conformance/valid/piece-plan-calls.udl +0 -314
  160. package/conformance/valid/protection.expected.json +0 -6
  161. package/conformance/valid/protection.udl +0 -1551
  162. package/conformance/valid/string-escaping.expected.json +0 -6
  163. package/conformance/valid/string-escaping.udl +0 -54
  164. package/conformance/valid/vocabulary.expected.json +0 -6
  165. package/conformance/valid/vocabulary.udl +0 -2012
  166. package/dist/allocation.d.ts +0 -60
  167. package/dist/allocation.d.ts.map +0 -1
  168. package/dist/allocation.js +0 -177
  169. package/dist/allocation.js.map +0 -1
  170. package/dist/check-profiles.d.ts +0 -57
  171. package/dist/check-profiles.d.ts.map +0 -1
  172. package/dist/check-profiles.js +0 -62
  173. package/dist/check-profiles.js.map +0 -1
  174. package/dist/distribution.d.ts +0 -15
  175. package/dist/distribution.d.ts.map +0 -1
  176. package/dist/distribution.js +0 -49
  177. package/dist/distribution.js.map +0 -1
  178. package/dist/effects.d.ts +0 -58
  179. package/dist/effects.d.ts.map +0 -1
  180. package/dist/effects.js +0 -1126
  181. package/dist/effects.js.map +0 -1
  182. package/dist/reference.d.ts +0 -3
  183. package/dist/reference.d.ts.map +0 -1
  184. package/dist/reference.js +0 -28
  185. package/dist/reference.js.map +0 -1
  186. package/dist/vocabulary.d.ts +0 -23
  187. package/dist/vocabulary.d.ts.map +0 -1
  188. package/dist/vocabulary.js +0 -1052
  189. package/dist/vocabulary.js.map +0 -1
  190. package/docs/funding-custody.md +0 -165
  191. package/docs/guide/01-a-document.md +0 -37
  192. package/docs/guide/02-money-steps.md +0 -23
  193. package/docs/guide/03-laws.md +0 -18
  194. package/docs/guide/04-fees-and-remainder.md +0 -36
  195. package/docs/guide/05-checks-updates-dials.md +0 -7
  196. package/docs/guide/06-effects.md +0 -11
  197. package/docs/guide/07-evolution.md +0 -11
  198. package/docs/guide/08-implementing.md +0 -13
  199. package/docs/guide/09-schedules-and-allocation.md +0 -132
  200. package/docs/llms-full.txt +0 -2008
  201. package/docs/llms.txt +0 -14
  202. package/docs/piece-plans.md +0 -148
  203. package/docs/reference/canonical.md +0 -16
  204. package/docs/reference/clauses.md +0 -1585
  205. package/docs/reference/cli.md +0 -24
  206. package/docs/reference/diagnostics.md +0 -38
  207. package/skills/udl/SKILL.md +0 -28
  208. package/src/allocation.ts +0 -259
  209. package/src/check-profiles.ts +0 -80
  210. package/src/distribution.ts +0 -61
  211. package/src/effects.ts +0 -1920
  212. package/src/reference.ts +0 -31
  213. package/src/vocabulary.ts +0 -1635
@@ -1,1512 +0,0 @@
1
- {
2
- "instruments": [
3
- {
4
- "actionOrder": [
5
- "create",
6
- "publish",
7
- "reserve",
8
- "reopen",
9
- "sell",
10
- "withdraw",
11
- "expire"
12
- ],
13
- "actions": {
14
- "create": {
15
- "agentDescription": "Draft a private offer against one vehicle or merchandise subject at an asking price. The offer is not buyable yet. Publishing is a separate call. Headline, asking price, currency, and the seller's customer balance account are required.",
16
- "description": "Creates a private offer against one subject. Publishing is a separate, explicit decision.",
17
- "examples": [
18
- {
19
- "input": {
20
- "askingPrice": "240000",
21
- "currency": "SAR",
22
- "description": "Single owner, full service history, sold under escrow protection.",
23
- "expiresAt": "2026-08-31T21:00:00.000Z",
24
- "headline": "2021 Toyota Land Cruiser GXR",
25
- "imageUrl": "https://cdn.sandbox.example/listings/landcruiser-2021.jpg",
26
- "productId": "prd_sandbox_marketplace01",
27
- "sellerAccountId": "acct_sandbox_seller0001",
28
- "subject": "sbj_sandbox_landcruiser1",
29
- "tenantId": "ten_sandbox_riyadhresale01"
30
- },
31
- "name": "draft_vehicle_offer"
32
- }
33
- ],
34
- "moves": [],
35
- "steps": [],
36
- "summary": "Draft a listing"
37
- },
38
- "expire": {
39
- "description": "Withdraws an active offer at its declared expiry under the machine principal.",
40
- "due": {
41
- "field": "expiresAt"
42
- },
43
- "effects": {
44
- "schedules": [
45
- {
46
- "signature": "schedules.due",
47
- "source": "due"
48
- }
49
- ]
50
- },
51
- "examples": [
52
- {
53
- "input": {
54
- "listingId": "lst_sandbox_landcruiser1",
55
- "tenantId": "ten_sandbox_riyadhresale01"
56
- },
57
- "name": "expire_stale_offer"
58
- }
59
- ],
60
- "moves": [],
61
- "steps": [],
62
- "summary": "Expire a listing"
63
- },
64
- "publish": {
65
- "agentDescription": "Make a draft offer visible and buyable. Only a draft publishes and no money moves. Set expiresAt through listing.update first if the offer should withdraw itself at a deadline, since expiry only fires when that field is set.",
66
- "description": "Makes the draft visible and buyable.",
67
- "examples": [
68
- {
69
- "input": {
70
- "listingId": "lst_sandbox_landcruiser1",
71
- "tenantId": "ten_sandbox_riyadhresale01"
72
- },
73
- "name": "publish_vehicle_offer"
74
- }
75
- ],
76
- "moves": [],
77
- "steps": [],
78
- "summary": "Publish a listing"
79
- },
80
- "reopen": {
81
- "agentDescription": "Put a reserved offer back on the market after its escrow closed without paying the seller. The escrow order must be refunded, penalty_collected, canceled, or expired. Use sell instead when the escrow released the money to the seller.",
82
- "description": "Returns the offer to the market after escrow closes without releasing money to the seller.",
83
- "effects": {
84
- "reads": [
85
- {
86
- "signature": "reads.requires_refs",
87
- "source": "requiresRefs"
88
- }
89
- ]
90
- },
91
- "examples": [
92
- {
93
- "input": {
94
- "listingId": "lst_sandbox_landcruiser1",
95
- "tenantId": "ten_sandbox_riyadhresale01"
96
- },
97
- "name": "reopen_refunded_offer"
98
- }
99
- ],
100
- "moves": [],
101
- "requiresRefs": [
102
- {
103
- "field": "escrowOrderId",
104
- "match": {
105
- "instrumentInstanceId": "fields.listingId"
106
- },
107
- "statuses": [
108
- "refunded",
109
- "penalty_collected",
110
- "canceled",
111
- "expired"
112
- ]
113
- }
114
- ],
115
- "steps": [],
116
- "summary": "Reopen a listing"
117
- },
118
- "reserve": {
119
- "agentDescription": "Take an active offer off the market for one buyer. The named escrow order must be funded, opened against this same listing, and match its asking price, currency, and seller exactly. No money moves here because the escrow already holds it.",
120
- "description": "Takes the offer off the market only while its referenced escrow order holds the buyer's funds for this exact listing at its exact economics.",
121
- "effects": {
122
- "reads": [
123
- {
124
- "signature": "reads.requires_refs",
125
- "source": "requiresRefs"
126
- }
127
- ]
128
- },
129
- "examples": [
130
- {
131
- "input": {
132
- "escrowOrderId": "eord_sandbox_buyerorder01",
133
- "listingId": "lst_sandbox_landcruiser1",
134
- "tenantId": "ten_sandbox_riyadhresale01"
135
- },
136
- "name": "reserve_funded_offer"
137
- }
138
- ],
139
- "input": {
140
- "additionalProperties": false,
141
- "properties": {
142
- "escrowOrderId": {
143
- "description": "Escrow order whose held funds reserve this listing",
144
- "pattern": "^eord_(sandbox|live)_[a-z0-9]{8,64}$",
145
- "type": "string"
146
- }
147
- },
148
- "required": [
149
- "escrowOrderId"
150
- ],
151
- "type": "object"
152
- },
153
- "moves": [],
154
- "requiresRefs": [
155
- {
156
- "field": "escrowOrderId",
157
- "match": {
158
- "fields.askingPrice": "fields.amount",
159
- "fields.currency": "fields.currency",
160
- "fields.sellerAccountId": "fields.sellerAccountId",
161
- "instrumentInstanceId": "fields.listingId"
162
- },
163
- "statuses": [
164
- "funded"
165
- ]
166
- }
167
- ],
168
- "steps": [],
169
- "summary": "Reserve a listing",
170
- "updates": [
171
- "escrowOrderId"
172
- ]
173
- },
174
- "sell": {
175
- "agentDescription": "Close the offer as sold. The listing must be reserved, and the escrow order opened against this exact listing must already have released the full asking price to this seller. Call it after the money landed, never before. No money moves here.",
176
- "description": "Marks the subject sold only after the escrow opened against this exact listing has released the full asking price to this seller.",
177
- "effects": {
178
- "reads": [
179
- {
180
- "signature": "reads.requires_refs",
181
- "source": "requiresRefs"
182
- }
183
- ]
184
- },
185
- "eventName": "listing.sold",
186
- "examples": [
187
- {
188
- "input": {
189
- "listingId": "lst_sandbox_landcruiser1",
190
- "tenantId": "ten_sandbox_riyadhresale01"
191
- },
192
- "name": "sell_released_offer"
193
- }
194
- ],
195
- "moves": [],
196
- "requiresRefs": [
197
- {
198
- "field": "escrowOrderId",
199
- "match": {
200
- "fields.askingPrice": "fields.amount",
201
- "fields.currency": "fields.currency",
202
- "fields.sellerAccountId": "fields.sellerAccountId",
203
- "instrumentInstanceId": "fields.listingId"
204
- },
205
- "statuses": [
206
- "released"
207
- ]
208
- }
209
- ],
210
- "steps": [],
211
- "summary": "Sell a listing"
212
- },
213
- "withdraw": {
214
- "agentDescription": "Pull a draft or active offer off the market for good. It only works before any escrow reserves the listing, so a reserved offer has to reopen first. No money moves and the listing does not come back.",
215
- "description": "Closes a draft or active offer before any escrow reservation exists.",
216
- "eventName": "listing.withdrawn",
217
- "examples": [
218
- {
219
- "input": {
220
- "listingId": "lst_sandbox_landcruiser1",
221
- "tenantId": "ten_sandbox_riyadhresale01"
222
- },
223
- "name": "withdraw_unreserved_offer"
224
- }
225
- ],
226
- "moves": [],
227
- "steps": [],
228
- "summary": "Withdraw a listing"
229
- }
230
- },
231
- "agentDescription": "Reach for listing when the caller offers one vehicle or merchandise subject for sale, or moves that offer between draft, active, reserved, and closed. A listing never moves money itself. The buyer's cash sits in an escrow_order and the buy-side agreement is an order.",
232
- "callerParkedStates": {
233
- "active": "expire fires only when expiresAt is set; an open-ended listing waits on buyer or seller action",
234
- "draft": "publishing is the seller's authoring decision",
235
- "reserved": "a reservation resolves by sale or reopening, both party actions"
236
- },
237
- "description": "A listing starts as a private draft, becomes buyable when published, stays unavailable while funded escrow reserves it, and ends sold, withdrawn, or expired without ever moving money itself.",
238
- "dials": [
239
- {
240
- "field": "expiresAt",
241
- "key": "listing_window",
242
- "kind": "window",
243
- "maxOffset": "P90D",
244
- "summary": "Grace beyond the expiry timestamp before an active listing withdraws.",
245
- "title": "Listing window"
246
- }
247
- ],
248
- "fields": {
249
- "askingPrice": {
250
- "description": "Positive minor-unit integer amount serialized as a string (at most 18 digits)",
251
- "pattern": "^[1-9][0-9]{0,17}$",
252
- "type": "string"
253
- },
254
- "currency": {
255
- "description": "ISO 4217 currency code",
256
- "maxLength": 3,
257
- "minLength": 3,
258
- "pattern": "^[A-Z]{3}$",
259
- "type": "string"
260
- },
261
- "description": {
262
- "maxLength": 2000,
263
- "minLength": 1,
264
- "type": "string"
265
- },
266
- "escrowOrderId": {
267
- "description": "Escrow order whose held funds reserve this listing",
268
- "pattern": "^eord_(sandbox|live)_[a-z0-9]{8,64}$",
269
- "type": "string"
270
- },
271
- "expiresAt": {
272
- "format": "hyperscale-date-time",
273
- "type": "string"
274
- },
275
- "headline": {
276
- "maxLength": 120,
277
- "minLength": 1,
278
- "type": "string"
279
- },
280
- "imageUrl": {
281
- "format": "hyperscale-uri",
282
- "maxLength": 2000,
283
- "type": "string"
284
- },
285
- "sellerAccountId": {
286
- "description": "Hyperscale account ID",
287
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
288
- "type": "string",
289
- "x-hyperscale-reference-filter": {
290
- "column": "role",
291
- "values": [
292
- "customer_balance"
293
- ]
294
- }
295
- }
296
- },
297
- "id": "listing",
298
- "idPrefix": "lst",
299
- "lifecycle": {
300
- "initial": "draft",
301
- "states": [
302
- "draft",
303
- "active",
304
- "reserved",
305
- "sold",
306
- "withdrawn"
307
- ],
308
- "transitions": {
309
- "expire": {
310
- "from": [
311
- "active"
312
- ],
313
- "to": "withdrawn"
314
- },
315
- "publish": {
316
- "from": [
317
- "draft"
318
- ],
319
- "to": "active"
320
- },
321
- "reopen": {
322
- "from": [
323
- "reserved"
324
- ],
325
- "to": "active"
326
- },
327
- "reserve": {
328
- "from": [
329
- "active"
330
- ],
331
- "to": "reserved"
332
- },
333
- "sell": {
334
- "from": [
335
- "reserved"
336
- ],
337
- "to": "sold"
338
- },
339
- "withdraw": {
340
- "from": [
341
- "draft",
342
- "active"
343
- ],
344
- "to": "withdrawn"
345
- }
346
- }
347
- },
348
- "nav": [
349
- "Blueprints",
350
- "Listings"
351
- ],
352
- "parties": {
353
- "subjectHolder": "sellerAccountId"
354
- },
355
- "required": [
356
- "sellerAccountId",
357
- "headline",
358
- "askingPrice",
359
- "currency"
360
- ],
361
- "subject": {
362
- "kinds": [
363
- "vehicle",
364
- "merchandise"
365
- ]
366
- },
367
- "summary": "Subject-backed offer published by a seller.",
368
- "templateId": "marketplace",
369
- "title": "Listing",
370
- "update": {
371
- "examples": [
372
- {
373
- "input": {
374
- "askingPrice": "240000",
375
- "escrowOrderId": "eord_sandbox_buyerorder01",
376
- "listingId": "lst_sandbox_landcruiser1",
377
- "tenantId": "ten_sandbox_riyadhresale01"
378
- },
379
- "name": "attach_funded_escrow"
380
- }
381
- ],
382
- "fields": [
383
- "headline",
384
- "description",
385
- "askingPrice",
386
- "imageUrl",
387
- "escrowOrderId",
388
- "expiresAt"
389
- ],
390
- "states": [
391
- "draft",
392
- "active"
393
- ]
394
- }
395
- },
396
- {
397
- "actionOrder": [
398
- "create",
399
- "confirm",
400
- "fulfill",
401
- "cancel",
402
- "expire"
403
- ],
404
- "actions": {
405
- "cancel": {
406
- "agentDescription": "Abandon the agreement. It is allowed only while the escrow order is still created, or after it fully retreated into refunded, penalty_collected, canceled, or expired. A funded escrow blocks the cancellation until it unwinds first. No money moves here.",
407
- "description": "Closes the agreement only while escrow is still empty or after every held unit has safely returned to the buyer.",
408
- "effects": {
409
- "reads": [
410
- {
411
- "signature": "reads.requires_refs",
412
- "source": "requiresRefs"
413
- }
414
- ]
415
- },
416
- "examples": [
417
- {
418
- "input": {
419
- "orderId": "ord_sandbox_landcruiser01",
420
- "tenantId": "ten_sandbox_riyadhresale01"
421
- },
422
- "name": "cancel_safely_retired_purchase"
423
- }
424
- ],
425
- "moves": [],
426
- "requiresRefs": [
427
- {
428
- "field": "escrowOrderId",
429
- "statuses": [
430
- "created",
431
- "refunded",
432
- "penalty_collected",
433
- "canceled",
434
- "expired"
435
- ]
436
- }
437
- ],
438
- "steps": [],
439
- "summary": "Cancel an order"
440
- },
441
- "confirm": {
442
- "agentDescription": "Lock the agreement's terms. The listing must still be active at the agreed price with the same seller, and the escrow order must be funded for the full amount with matching buyer, seller, currency, and listing. No money moves. The escrow already holds it.",
443
- "description": "Makes the agreement final only while the listing is active at the agreed price and escrow holds the full purchase amount for that same listing.",
444
- "effects": {
445
- "reads": [
446
- {
447
- "signature": "reads.requires_refs",
448
- "source": "requiresRefs"
449
- }
450
- ]
451
- },
452
- "examples": [
453
- {
454
- "input": {
455
- "orderId": "ord_sandbox_landcruiser01",
456
- "tenantId": "ten_sandbox_riyadhresale01"
457
- },
458
- "name": "confirm_funded_purchase"
459
- }
460
- ],
461
- "moves": [],
462
- "requiresRefs": [
463
- {
464
- "field": "listingId",
465
- "match": {
466
- "fields.amount": "fields.askingPrice",
467
- "fields.currency": "fields.currency",
468
- "fields.sellerAccountId": "fields.sellerAccountId"
469
- },
470
- "statuses": [
471
- "active"
472
- ]
473
- },
474
- {
475
- "field": "escrowOrderId",
476
- "match": {
477
- "fields.amount": "fields.amount",
478
- "fields.buyerAccountId": "fields.buyerAccountId",
479
- "fields.currency": "fields.currency",
480
- "fields.listingId": "fields.listingId",
481
- "fields.sellerAccountId": "fields.sellerAccountId"
482
- },
483
- "statuses": [
484
- "funded"
485
- ]
486
- }
487
- ],
488
- "steps": [],
489
- "summary": "Confirm an order"
490
- },
491
- "create": {
492
- "agentDescription": "Record the proposed agreement between one buyer and seller against a listing and its escrow order. The escrow must be created or funded, must protect the same listing, and supplies the parties, amount, and currency. No money moves. Set confirmBy if an unconfirmed order should expire on its own.",
493
- "description": "Records the proposed buyer and seller agreement against one listing and one escrow order. The escrow must still hold or await the money, must protect the same listing, and supplies the parties and the amount. No money moves.",
494
- "effects": {
495
- "reads": [
496
- {
497
- "signature": "reads.requires_refs",
498
- "source": "requiresRefs"
499
- }
500
- ]
501
- },
502
- "examples": [
503
- {
504
- "input": {
505
- "confirmBy": "2026-08-01T20:00:00.000Z",
506
- "escrowOrderId": "eord_sandbox_buyerorder01",
507
- "listingId": "lst_sandbox_landcruiser1",
508
- "memo": "Purchase subject to funded escrow.",
509
- "productId": "prd_sandbox_marketplace01",
510
- "subject": "sbj_sandbox_landcruiser1",
511
- "tenantId": "ten_sandbox_riyadhresale01"
512
- },
513
- "name": "create_vehicle_purchase_order"
514
- }
515
- ],
516
- "moves": [],
517
- "requiresRefs": [
518
- {
519
- "bind": {
520
- "amount": "fields.amount",
521
- "buyerAccountId": "fields.buyerAccountId",
522
- "currency": "fields.currency",
523
- "sellerAccountId": "fields.sellerAccountId"
524
- },
525
- "field": "escrowOrderId",
526
- "match": {
527
- "fields.listingId": "fields.listingId"
528
- },
529
- "statuses": [
530
- "created",
531
- "funded"
532
- ]
533
- }
534
- ],
535
- "steps": [],
536
- "summary": "Create an order"
537
- },
538
- "expire": {
539
- "description": "Closes an unconfirmed agreement at its declared deadline under the machine principal.",
540
- "due": {
541
- "field": "confirmBy"
542
- },
543
- "effects": {
544
- "schedules": [
545
- {
546
- "signature": "schedules.due",
547
- "source": "due"
548
- }
549
- ]
550
- },
551
- "examples": [
552
- {
553
- "input": {
554
- "orderId": "ord_sandbox_landcruiser01",
555
- "tenantId": "ten_sandbox_riyadhresale01"
556
- },
557
- "name": "expire_unconfirmed_purchase"
558
- }
559
- ],
560
- "moves": [],
561
- "steps": [],
562
- "summary": "Expire an order"
563
- },
564
- "fulfill": {
565
- "agentDescription": "Close the agreement as delivered. The order must be confirmed and its escrow order must already be released to the seller, so call this after the money landed. No money moves here.",
566
- "description": "Closes the agreement after escrow has released the full purchase amount to the seller.",
567
- "effects": {
568
- "reads": [
569
- {
570
- "signature": "reads.requires_refs",
571
- "source": "requiresRefs"
572
- }
573
- ]
574
- },
575
- "eventName": "order.fulfilled",
576
- "examples": [
577
- {
578
- "input": {
579
- "orderId": "ord_sandbox_landcruiser01",
580
- "tenantId": "ten_sandbox_riyadhresale01"
581
- },
582
- "name": "fulfill_released_purchase"
583
- }
584
- ],
585
- "moves": [],
586
- "requiresRefs": [
587
- {
588
- "field": "escrowOrderId",
589
- "statuses": [
590
- "released"
591
- ]
592
- }
593
- ],
594
- "steps": [],
595
- "summary": "Fulfill an order"
596
- }
597
- },
598
- "agentDescription": "Reach for order when the caller records and drives the buy-side agreement for one listing, naming the buyer, the amount, and the escrow order behind it. An order never moves money. The listing carries the offer and the escrow order holds and releases the purchase money.",
599
- "callerParkedStates": {
600
- "confirmed": "fulfillment or cancellation is the merchant's operational act",
601
- "created": "expire fires only when confirmBy is set; without a confirmation deadline the order waits on the merchant"
602
- },
603
- "description": "An order records the buyer and seller agreement for one listing. Confirmation requires the listing to remain active and its escrow to hold the purchase money; fulfillment requires that escrow to release, while cancellation is allowed only before funding or after escrow safely retreats.",
604
- "dials": [
605
- {
606
- "field": "confirmBy",
607
- "key": "confirmation_window",
608
- "kind": "window",
609
- "maxOffset": "P30D",
610
- "summary": "Grace beyond the confirmBy timestamp before an unconfirmed order expires.",
611
- "title": "Confirmation window"
612
- }
613
- ],
614
- "fields": {
615
- "amount": {
616
- "description": "Positive minor-unit integer amount serialized as a string (at most 18 digits)",
617
- "pattern": "^[1-9][0-9]{0,17}$",
618
- "type": "string"
619
- },
620
- "buyerAccountId": {
621
- "description": "Hyperscale account ID",
622
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
623
- "type": "string",
624
- "x-hyperscale-reference-filter": {
625
- "column": "role",
626
- "values": [
627
- "customer_balance"
628
- ]
629
- }
630
- },
631
- "confirmBy": {
632
- "format": "hyperscale-date-time",
633
- "type": "string"
634
- },
635
- "currency": {
636
- "description": "ISO 4217 currency code",
637
- "maxLength": 3,
638
- "minLength": 3,
639
- "pattern": "^[A-Z]{3}$",
640
- "type": "string"
641
- },
642
- "escrowOrderId": {
643
- "description": "Escrow order holding this order's purchase money",
644
- "pattern": "^eord_(sandbox|live)_[a-z0-9]{8,64}$",
645
- "type": "string"
646
- },
647
- "listingId": {
648
- "description": "Listing whose subject the buyer agreed to purchase",
649
- "pattern": "^lst_(sandbox|live)_[a-z0-9]{8,64}$",
650
- "type": "string"
651
- },
652
- "memo": {
653
- "maxLength": 180,
654
- "minLength": 1,
655
- "type": "string"
656
- },
657
- "sellerAccountId": {
658
- "description": "Hyperscale account ID",
659
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
660
- "type": "string",
661
- "x-hyperscale-reference-filter": {
662
- "column": "role",
663
- "values": [
664
- "customer_balance"
665
- ]
666
- }
667
- }
668
- },
669
- "id": "order",
670
- "idPrefix": "ord",
671
- "lifecycle": {
672
- "initial": "created",
673
- "states": [
674
- "created",
675
- "confirmed",
676
- "fulfilled",
677
- "canceled",
678
- "expired"
679
- ],
680
- "transitions": {
681
- "cancel": {
682
- "from": [
683
- "created",
684
- "confirmed"
685
- ],
686
- "to": "canceled"
687
- },
688
- "confirm": {
689
- "from": [
690
- "created"
691
- ],
692
- "to": "confirmed"
693
- },
694
- "expire": {
695
- "from": [
696
- "created"
697
- ],
698
- "to": "expired"
699
- },
700
- "fulfill": {
701
- "from": [
702
- "confirmed"
703
- ],
704
- "to": "fulfilled"
705
- }
706
- }
707
- },
708
- "nav": [
709
- "Blueprints",
710
- "Orders"
711
- ],
712
- "parties": {
713
- "beneficiary": "sellerAccountId",
714
- "payer": "buyerAccountId"
715
- },
716
- "required": [
717
- "buyerAccountId",
718
- "sellerAccountId",
719
- "listingId",
720
- "escrowOrderId",
721
- "amount",
722
- "currency"
723
- ],
724
- "subject": {
725
- "kinds": [
726
- "vehicle",
727
- "merchandise"
728
- ]
729
- },
730
- "summary": "Agreement to buy one listed subject at an accepted amount.",
731
- "templateId": "marketplace",
732
- "title": "Order",
733
- "update": {
734
- "examples": [
735
- {
736
- "input": {
737
- "confirmBy": "2026-08-01T20:00:00.000Z",
738
- "memo": "Buyer confirms after inspection.",
739
- "orderId": "ord_sandbox_landcruiser01",
740
- "tenantId": "ten_sandbox_riyadhresale01"
741
- },
742
- "name": "annotate_unconfirmed_order"
743
- }
744
- ],
745
- "fields": [
746
- "confirmBy",
747
- "memo"
748
- ],
749
- "states": [
750
- "created"
751
- ]
752
- }
753
- },
754
- {
755
- "actionOrder": [
756
- "create",
757
- "fund",
758
- "dispute",
759
- "resume",
760
- "release",
761
- "quote",
762
- "refund",
763
- "collect_penalty",
764
- "cancel",
765
- "expire"
766
- ],
767
- "actions": {
768
- "cancel": {
769
- "agentDescription": "Close an escrow nobody funded. No money has moved and the escrow account must be empty, so this is a lifecycle transition only. A funded escrow refuses. Quote and refund the buyer instead.",
770
- "description": "Closes an unfunded escrow. Because no money moved, no unwind quote is required.",
771
- "examples": [
772
- {
773
- "input": {
774
- "escrowOrderId": "eord_sandbox_buyerorder01",
775
- "tenantId": "ten_sandbox_riyadhresale01"
776
- },
777
- "name": "cancel_unfunded_escrow"
778
- }
779
- ],
780
- "moves": [],
781
- "requiresDrainedAccount": {
782
- "path": "refs.escrowAccountId"
783
- },
784
- "steps": [],
785
- "summary": "Cancel an escrow order"
786
- },
787
- "collect_penalty": {
788
- "agentDescription": "Pay the penalty the refund retained out of escrow to the seller. This moves money. Run it only after refund, and only when refund reported a positive unwind penalty. Under the default zero-penalty schedule there is nothing to collect.",
789
- "description": "Pays the computed retained penalty to the seller after a penalized refund. Invoke only when refund returns a positive refs.unwindPenalty.",
790
- "effects": {
791
- "moves": [
792
- {
793
- "signature": "moves.transfer.internal",
794
- "source": "moves[0]"
795
- }
796
- ]
797
- },
798
- "eventName": "escrow_order.penalty_collected",
799
- "examples": [
800
- {
801
- "input": {
802
- "escrowOrderId": "eord_sandbox_buyerorder01",
803
- "tenantId": "ten_sandbox_riyadhresale01"
804
- },
805
- "name": "collect_disputed_refund_penalty"
806
- }
807
- ],
808
- "moves": [
809
- {
810
- "bind": {
811
- "amount": {
812
- "from": "instance",
813
- "path": "refs.unwindPenalty"
814
- },
815
- "currency": {
816
- "from": "instance",
817
- "path": "fields.currency"
818
- },
819
- "destinationAccountId": {
820
- "from": "instance",
821
- "path": "fields.sellerAccountId"
822
- },
823
- "productId": {
824
- "from": "instance",
825
- "path": "productId"
826
- },
827
- "sourceAccountId": {
828
- "from": "instance",
829
- "path": "refs.escrowAccountId"
830
- }
831
- },
832
- "capture": {
833
- "penaltyTransferId": "transferId"
834
- },
835
- "key": "transfer",
836
- "operation": "internal_transfer.create"
837
- }
838
- ],
839
- "steps": [],
840
- "summary": "Collect an escrow refund penalty"
841
- },
842
- "create": {
843
- "agentDescription": "Open escrow against an active listing and provision its dedicated escrow account. No money moves yet. The listing must be active, and its asking price, currency, and seller account are copied onto the escrow, so passing an amount is neither needed nor allowed.",
844
- "description": "Opens escrow against an active listing and provisions its dedicated product escrow account. The held amount is always the listing's askingPrice and is not caller supplied. For a security deposit use the standard library module security_deposit, and for a rental or booking fee use cancellable_booking. Both live under open/hsx/std/money_flows.",
845
- "effects": {
846
- "reads": [
847
- {
848
- "signature": "reads.requires_refs",
849
- "source": "requiresRefs"
850
- }
851
- ]
852
- },
853
- "examples": [
854
- {
855
- "input": {
856
- "buyerAccountId": "acct_sandbox_buyer000001",
857
- "fundBy": "2026-08-01T21:00:00.000Z",
858
- "listingId": "lst_sandbox_landcruiser1",
859
- "memo": "Release after the vehicle is handed over.",
860
- "productId": "prd_sandbox_marketplace01",
861
- "subject": "sbj_sandbox_landcruiser1",
862
- "tenantId": "ten_sandbox_riyadhresale01"
863
- },
864
- "name": "open_vehicle_escrow"
865
- }
866
- ],
867
- "moves": [],
868
- "requiresRefs": [
869
- {
870
- "bind": {
871
- "amount": "fields.askingPrice",
872
- "currency": "fields.currency",
873
- "sellerAccountId": "fields.sellerAccountId"
874
- },
875
- "field": "listingId",
876
- "statuses": [
877
- "active"
878
- ]
879
- }
880
- ],
881
- "steps": [
882
- {
883
- "bind": {
884
- "currency": {
885
- "from": "instance",
886
- "path": "fields.currency"
887
- },
888
- "owner.id": {
889
- "from": "instance",
890
- "path": "productId"
891
- },
892
- "owner.type": {
893
- "from": "const",
894
- "value": "product"
895
- },
896
- "productId": {
897
- "from": "instance",
898
- "path": "productId"
899
- },
900
- "role": {
901
- "from": "const",
902
- "value": "product_escrow"
903
- }
904
- },
905
- "capture": {
906
- "escrowAccountId": "accountId"
907
- },
908
- "operation": "account.escrow.provision"
909
- }
910
- ],
911
- "summary": "Create an escrow order"
912
- },
913
- "dispute": {
914
- "agentDescription": "Freeze a funded escrow so neither release nor refund can run until the parties settle the disagreement. No money moves and the whole balance stays put. Only a funded escrow disputes.",
915
- "description": "Freezes the fully funded escrow before either milestone releases, preserving the entire balance while the parties decide what happens next.",
916
- "examples": [
917
- {
918
- "input": {
919
- "escrowOrderId": "eord_sandbox_buyerorder01",
920
- "tenantId": "ten_sandbox_riyadhresale01"
921
- },
922
- "name": "hold_funds_for_dispute"
923
- }
924
- ],
925
- "moves": [],
926
- "steps": [],
927
- "summary": "Dispute an escrow order"
928
- },
929
- "expire": {
930
- "description": "Closes an unfunded escrow at its funding deadline under the machine principal.",
931
- "due": {
932
- "field": "fundBy"
933
- },
934
- "effects": {
935
- "schedules": [
936
- {
937
- "signature": "schedules.due",
938
- "source": "due"
939
- }
940
- ]
941
- },
942
- "examples": [
943
- {
944
- "input": {
945
- "escrowOrderId": "eord_sandbox_buyerorder01",
946
- "tenantId": "ten_sandbox_riyadhresale01"
947
- },
948
- "name": "expire_unfunded_escrow"
949
- }
950
- ],
951
- "moves": [],
952
- "requiresDrainedAccount": {
953
- "path": "refs.escrowAccountId"
954
- },
955
- "steps": [],
956
- "summary": "Expire an escrow order"
957
- },
958
- "fund": {
959
- "agentDescription": "Move the full purchase amount from the buyer's account into the escrow account. This moves money and the buyer cannot spend it again until the escrow resolves. Only a created escrow funds, and the listing must still be active.",
960
- "description": "Moves the full purchase amount from the buyer account into the dedicated escrow account while the listing remains active.",
961
- "effects": {
962
- "moves": [
963
- {
964
- "signature": "moves.collection.pay_in",
965
- "source": "moves[0]"
966
- }
967
- ],
968
- "reads": [
969
- {
970
- "signature": "reads.requires_refs",
971
- "source": "requiresRefs"
972
- }
973
- ]
974
- },
975
- "examples": [
976
- {
977
- "input": {
978
- "escrowOrderId": "eord_sandbox_buyerorder01",
979
- "tenantId": "ten_sandbox_riyadhresale01"
980
- },
981
- "name": "fund_purchase_escrow"
982
- }
983
- ],
984
- "moves": [
985
- {
986
- "bind": {
987
- "amount": {
988
- "from": "instance",
989
- "path": "fields.amount"
990
- },
991
- "currency": {
992
- "from": "instance",
993
- "path": "fields.currency"
994
- },
995
- "destinationAccountId": {
996
- "from": "instance",
997
- "path": "refs.escrowAccountId"
998
- },
999
- "productId": {
1000
- "from": "instance",
1001
- "path": "productId"
1002
- },
1003
- "sourceAccountId": {
1004
- "from": "instance",
1005
- "path": "fields.buyerAccountId"
1006
- }
1007
- },
1008
- "capture": {
1009
- "fundTransferId": "transferId"
1010
- },
1011
- "key": "transfer",
1012
- "operation": "internal_transfer.create"
1013
- }
1014
- ],
1015
- "requiresRefs": [
1016
- {
1017
- "field": "listingId",
1018
- "statuses": [
1019
- "active"
1020
- ]
1021
- }
1022
- ],
1023
- "sandboxFailurePoint": "funding",
1024
- "steps": [],
1025
- "summary": "Fund an escrow order"
1026
- },
1027
- "quote": {
1028
- "agentDescription": "Price the buyer's refund under the penalty schedule and park the escrow for an explicit confirmation. No money moves at quote time. Only a disputed escrow quotes, and the money only leaves when refund runs.",
1029
- "description": "Calculates the full buyer refund while disputed and parks the escrow for explicit confirmation. No money moves at quote time.",
1030
- "effects": {
1031
- "holds": [
1032
- {
1033
- "signature": "holds.quote",
1034
- "source": "quote"
1035
- }
1036
- ],
1037
- "schedules": [
1038
- {
1039
- "signature": "schedules.expiry",
1040
- "source": "quote"
1041
- }
1042
- ]
1043
- },
1044
- "examples": [
1045
- {
1046
- "input": {
1047
- "escrowOrderId": "eord_sandbox_buyerorder01",
1048
- "tenantId": "ten_sandbox_riyadhresale01"
1049
- },
1050
- "name": "quote_disputed_refund"
1051
- }
1052
- ],
1053
- "moves": [],
1054
- "quote": {
1055
- "baseField": "amount",
1056
- "chargeRef": "unwindPenalty",
1057
- "charges": [
1058
- {
1059
- "bps": 0
1060
- }
1061
- ],
1062
- "expires": {
1063
- "offset": "PT15M"
1064
- },
1065
- "fixes": [
1066
- "amount",
1067
- "buyerAccountId"
1068
- ],
1069
- "netDestinationField": "buyerAccountId",
1070
- "netRef": "unwindRefund"
1071
- },
1072
- "steps": [],
1073
- "summary": "Quote an escrow refund"
1074
- },
1075
- "refund": {
1076
- "agentDescription": "Confirm the quoted retreat and send the refunded amount from escrow back to the buyer. This moves money and does not reverse. Only an escrow already parked by quote refunds. Any retained penalty stays in escrow for collect_penalty.",
1077
- "commit": "quote",
1078
- "description": "Confirms the quoted retreat and returns the full held amount from escrow to the buyer.",
1079
- "effects": {
1080
- "moves": [
1081
- {
1082
- "signature": "moves.transfer.internal",
1083
- "source": "moves[0]"
1084
- }
1085
- ]
1086
- },
1087
- "examples": [
1088
- {
1089
- "input": {
1090
- "escrowOrderId": "eord_sandbox_buyerorder01",
1091
- "tenantId": "ten_sandbox_riyadhresale01"
1092
- },
1093
- "name": "confirm_disputed_refund"
1094
- }
1095
- ],
1096
- "moves": [
1097
- {
1098
- "bind": {
1099
- "amount": {
1100
- "from": "instance",
1101
- "path": "refs.unwindRefund"
1102
- },
1103
- "currency": {
1104
- "from": "instance",
1105
- "path": "fields.currency"
1106
- },
1107
- "destinationAccountId": {
1108
- "from": "instance",
1109
- "path": "fields.buyerAccountId"
1110
- },
1111
- "productId": {
1112
- "from": "instance",
1113
- "path": "productId"
1114
- },
1115
- "sourceAccountId": {
1116
- "from": "instance",
1117
- "path": "refs.escrowAccountId"
1118
- }
1119
- },
1120
- "capture": {
1121
- "refundTransferId": "transferId"
1122
- },
1123
- "key": "transfer",
1124
- "operation": "internal_transfer.create"
1125
- }
1126
- ],
1127
- "steps": [],
1128
- "summary": "Refund an escrow order"
1129
- },
1130
- "release": {
1131
- "agentDescription": "Pay the seller the full escrow balance and close the order. This moves money and does not reverse. Only a funded escrow releases, and the listing must be reserved and name this escrow back, so an escrow that lost its listing can never pay out.",
1132
- "description": "Pays the seller the full escrow amount once and closes escrow with no balance remaining. Only the escrow that reserved the listing can release: the listing must name this escrow back.",
1133
- "earnable": true,
1134
- "effects": {
1135
- "moves": [
1136
- {
1137
- "signature": "moves.transfer.internal",
1138
- "source": "moves[0]"
1139
- }
1140
- ],
1141
- "reads": [
1142
- {
1143
- "signature": "reads.requires_refs",
1144
- "source": "requiresRefs"
1145
- }
1146
- ]
1147
- },
1148
- "examples": [
1149
- {
1150
- "input": {
1151
- "escrowOrderId": "eord_sandbox_buyerorder01",
1152
- "tenantId": "ten_sandbox_riyadhresale01"
1153
- },
1154
- "name": "release_escrow"
1155
- }
1156
- ],
1157
- "moves": [
1158
- {
1159
- "bind": {
1160
- "amount": {
1161
- "from": "instance",
1162
- "path": "fields.amount"
1163
- },
1164
- "currency": {
1165
- "from": "instance",
1166
- "path": "fields.currency"
1167
- },
1168
- "destinationAccountId": {
1169
- "from": "instance",
1170
- "path": "fields.sellerAccountId"
1171
- },
1172
- "productId": {
1173
- "from": "instance",
1174
- "path": "productId"
1175
- },
1176
- "sourceAccountId": {
1177
- "from": "instance",
1178
- "path": "refs.escrowAccountId"
1179
- }
1180
- },
1181
- "capture": {
1182
- "releaseTransferId": "transferId"
1183
- },
1184
- "key": "transfer",
1185
- "operation": "internal_transfer.create"
1186
- }
1187
- ],
1188
- "requiresRefs": [
1189
- {
1190
- "field": "listingId",
1191
- "match": {
1192
- "instrumentInstanceId": "fields.escrowOrderId"
1193
- },
1194
- "statuses": [
1195
- "reserved"
1196
- ]
1197
- }
1198
- ],
1199
- "sandboxFailurePoint": "release",
1200
- "steps": [],
1201
- "summary": "Release an escrow order"
1202
- },
1203
- "resume": {
1204
- "agentDescription": "Lift the dispute hold and put the escrow back where it was, funded and ready to release. No money moves and the balance was never touched. Only a disputed escrow resumes. Use this when the parties settled without a refund.",
1205
- "description": "Ends the dispute hold without moving money and returns the fully funded escrow to its first milestone.",
1206
- "examples": [
1207
- {
1208
- "input": {
1209
- "escrowOrderId": "eord_sandbox_buyerorder01",
1210
- "tenantId": "ten_sandbox_riyadhresale01"
1211
- },
1212
- "name": "resume_after_resolution"
1213
- }
1214
- ],
1215
- "moves": [],
1216
- "steps": [],
1217
- "summary": "Resume an escrow order"
1218
- }
1219
- },
1220
- "agentDescription": "Reach for escrow_order when a buyer's money must sit against an active listing until the seller earns it. The amount, currency, and seller come from the locked listing, never from the caller, so you open one by naming a listing. Release pays the seller once and closes. A dispute freezes the balance until the parties resume or confirm a quoted refund.",
1221
- "callerParkedStates": {
1222
- "created": "expire fires only when fundBy is set; without a funding deadline the escrow waits on the buyer to fund or cancel",
1223
- "disputed": "dispute resolution is a human judgment; the parties resume the escrow or quote a refund",
1224
- "funded": "releasing or disputing held value is a party decision; escrow deliberately holds until the parties act",
1225
- "refund_quoted": "a quoted refund moves money only when the caller confirms it",
1226
- "refunded": "the residual penalty is collected by the operator as a deliberate follow-up transfer"
1227
- },
1228
- "description": "An escrow order holds the full purchase amount and releases it to the seller exactly once. Before release, a dispute freezes the full balance until work resumes or a quoted refund is confirmed.",
1229
- "dials": [
1230
- {
1231
- "field": "fundBy",
1232
- "key": "funding_window",
1233
- "kind": "window",
1234
- "maxOffset": "P30D",
1235
- "summary": "Grace beyond the fundBy timestamp before an unfunded escrow expires.",
1236
- "title": "Funding window"
1237
- },
1238
- {
1239
- "key": "refund_penalty",
1240
- "kind": "unwind_penalty",
1241
- "summary": "Replaces the zero-penalty schedule refunds are quoted against, e.g. a restocking fee tier.",
1242
- "title": "Refund penalty schedule"
1243
- }
1244
- ],
1245
- "fields": {
1246
- "amount": {
1247
- "description": "Positive minor-unit integer amount serialized as a string (at most 18 digits)",
1248
- "pattern": "^[1-9][0-9]{0,17}$",
1249
- "type": "string"
1250
- },
1251
- "buyerAccountId": {
1252
- "description": "Hyperscale account ID",
1253
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1254
- "type": "string",
1255
- "x-hyperscale-reference-filter": {
1256
- "column": "role",
1257
- "values": [
1258
- "customer_balance"
1259
- ]
1260
- }
1261
- },
1262
- "currency": {
1263
- "description": "ISO 4217 currency code",
1264
- "maxLength": 3,
1265
- "minLength": 3,
1266
- "pattern": "^[A-Z]{3}$",
1267
- "type": "string"
1268
- },
1269
- "fundBy": {
1270
- "format": "hyperscale-date-time",
1271
- "type": "string"
1272
- },
1273
- "listingId": {
1274
- "description": "Listing whose subject and availability this escrow protects",
1275
- "pattern": "^lst_(sandbox|live)_[a-z0-9]{8,64}$",
1276
- "type": "string"
1277
- },
1278
- "memo": {
1279
- "maxLength": 180,
1280
- "minLength": 1,
1281
- "type": "string"
1282
- },
1283
- "sellerAccountId": {
1284
- "description": "Hyperscale account ID",
1285
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1286
- "type": "string",
1287
- "x-hyperscale-reference-filter": {
1288
- "column": "role",
1289
- "values": [
1290
- "customer_balance"
1291
- ]
1292
- }
1293
- }
1294
- },
1295
- "id": "escrow_order",
1296
- "idPrefix": "eord",
1297
- "lifecycle": {
1298
- "initial": "created",
1299
- "states": [
1300
- "created",
1301
- "funded",
1302
- "disputed",
1303
- "refund_quoted",
1304
- "released",
1305
- "refunded",
1306
- "penalty_collected",
1307
- "canceled",
1308
- "expired"
1309
- ],
1310
- "transitions": {
1311
- "cancel": {
1312
- "from": [
1313
- "created"
1314
- ],
1315
- "to": "canceled"
1316
- },
1317
- "collect_penalty": {
1318
- "from": [
1319
- "refunded"
1320
- ],
1321
- "to": "penalty_collected"
1322
- },
1323
- "dispute": {
1324
- "from": [
1325
- "funded"
1326
- ],
1327
- "to": "disputed"
1328
- },
1329
- "expire": {
1330
- "from": [
1331
- "created"
1332
- ],
1333
- "to": "expired"
1334
- },
1335
- "fund": {
1336
- "from": [
1337
- "created"
1338
- ],
1339
- "to": "funded"
1340
- },
1341
- "quote": {
1342
- "from": [
1343
- "disputed"
1344
- ],
1345
- "to": "refund_quoted"
1346
- },
1347
- "refund": {
1348
- "from": [
1349
- "refund_quoted"
1350
- ],
1351
- "to": "refunded"
1352
- },
1353
- "release": {
1354
- "from": [
1355
- "funded"
1356
- ],
1357
- "to": "released"
1358
- },
1359
- "resume": {
1360
- "from": [
1361
- "disputed"
1362
- ],
1363
- "to": "funded"
1364
- }
1365
- }
1366
- },
1367
- "nav": [
1368
- "Blueprints",
1369
- "Escrow Orders"
1370
- ],
1371
- "parties": {
1372
- "beneficiary": "sellerAccountId",
1373
- "payer": "buyerAccountId"
1374
- },
1375
- "required": [
1376
- "buyerAccountId",
1377
- "sellerAccountId",
1378
- "listingId",
1379
- "amount",
1380
- "currency"
1381
- ],
1382
- "subject": {
1383
- "kinds": [
1384
- "vehicle",
1385
- "merchandise"
1386
- ]
1387
- },
1388
- "summary": "Purchase money held between buyer and seller.",
1389
- "templateId": "escrow",
1390
- "title": "Escrow order",
1391
- "update": {
1392
- "examples": [
1393
- {
1394
- "input": {
1395
- "escrowOrderId": "eord_sandbox_buyerorder01",
1396
- "fundBy": "2026-08-01T21:00:00.000Z",
1397
- "memo": "Buyer funds after inspection booking.",
1398
- "tenantId": "ten_sandbox_riyadhresale01"
1399
- },
1400
- "name": "annotate_unfunded_escrow"
1401
- }
1402
- ],
1403
- "fields": [
1404
- "fundBy",
1405
- "memo"
1406
- ],
1407
- "states": [
1408
- "created"
1409
- ]
1410
- }
1411
- }
1412
- ],
1413
- "product": "commerce_escrow",
1414
- "subjects": [
1415
- {
1416
- "declaredValue": "required",
1417
- "kind": "vehicle",
1418
- "schema": {
1419
- "additionalProperties": false,
1420
- "properties": {
1421
- "make": {
1422
- "maxLength": 60,
1423
- "minLength": 1,
1424
- "type": "string"
1425
- },
1426
- "mileageKm": {
1427
- "maximum": 9007199254740991,
1428
- "minimum": 0,
1429
- "type": "integer"
1430
- },
1431
- "model": {
1432
- "maxLength": 60,
1433
- "minLength": 1,
1434
- "type": "string"
1435
- },
1436
- "vin": {
1437
- "maxLength": 17,
1438
- "minLength": 11,
1439
- "type": "string"
1440
- },
1441
- "year": {
1442
- "pattern": "^\\d{4}$",
1443
- "type": "string"
1444
- }
1445
- },
1446
- "required": [
1447
- "vin",
1448
- "make",
1449
- "model",
1450
- "year",
1451
- "mileageKm"
1452
- ],
1453
- "type": "object"
1454
- },
1455
- "title": "Vehicle",
1456
- "version": 1
1457
- },
1458
- {
1459
- "declaredValue": "required",
1460
- "kind": "merchandise",
1461
- "schema": {
1462
- "additionalProperties": false,
1463
- "properties": {
1464
- "brand": {
1465
- "maxLength": 60,
1466
- "minLength": 1,
1467
- "type": "string"
1468
- },
1469
- "category": {
1470
- "maxLength": 60,
1471
- "minLength": 1,
1472
- "type": "string"
1473
- },
1474
- "condition": {
1475
- "enum": [
1476
- "new",
1477
- "excellent",
1478
- "good",
1479
- "fair",
1480
- "poor"
1481
- ],
1482
- "type": "string"
1483
- },
1484
- "model": {
1485
- "maxLength": 60,
1486
- "minLength": 1,
1487
- "type": "string"
1488
- },
1489
- "serialNumber": {
1490
- "maxLength": 80,
1491
- "minLength": 1,
1492
- "type": "string"
1493
- },
1494
- "yearOfManufacture": {
1495
- "pattern": "^\\d{4}$",
1496
- "type": "string"
1497
- }
1498
- },
1499
- "required": [
1500
- "category",
1501
- "condition"
1502
- ],
1503
- "type": "object"
1504
- },
1505
- "title": "Merchandise",
1506
- "version": 1
1507
- }
1508
- ],
1509
- "title": "Commerce and escrow",
1510
- "udl": 1,
1511
- "version": 1
1512
- }