@fleetless/contracts 9.2.0-next.1 → 10.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 (52) hide show
  1. package/CHANGELOG.md +19 -4
  2. package/artifacts/openapi.json +16927 -8920
  3. package/artifacts/routes.json +96 -54
  4. package/artifacts/schema/billing-change-response.schema.json +1527 -1727
  5. package/artifacts/schema/billing-decision-amounts.schema.json +244 -0
  6. package/artifacts/schema/billing-decision-display-request.schema.json +24 -0
  7. package/artifacts/schema/billing-decision-display-response.schema.json +3130 -0
  8. package/artifacts/schema/billing-decision-period.schema.json +550 -0
  9. package/artifacts/schema/billing-decision-snapshot.schema.json +3103 -0
  10. package/artifacts/schema/bridge-state.schema.json +0 -14
  11. package/artifacts/schema/checkout-request.schema.json +3 -4
  12. package/artifacts/schema/checkout-response.schema.json +492 -402
  13. package/artifacts/schema/client-robot-list-item.schema.json +0 -14
  14. package/artifacts/schema/client-robot-list-response.schema.json +0 -14
  15. package/artifacts/schema/confirmation-proof.schema.json +6 -0
  16. package/artifacts/schema/plan-change-decision-lookup-query.schema.json +16 -0
  17. package/artifacts/schema/plan-change-decision-status-response.schema.json +543 -0
  18. package/artifacts/schema/plan-change-prepare-request.schema.json +84 -0
  19. package/artifacts/schema/plan-change-prepare-response.schema.json +3162 -0
  20. package/artifacts/schema/plan-change-request.schema.json +177 -65
  21. package/artifacts/schema/purchase-conflict-details.schema.json +94 -0
  22. package/artifacts/schema/purchase-intent-accepted-without-payment.schema.json +95 -0
  23. package/artifacts/schema/purchase-intent-confirm-request.schema.json +146 -33
  24. package/artifacts/schema/purchase-intent-draft.schema.json +449 -0
  25. package/artifacts/schema/purchase-intent-payment-started.schema.json +184 -0
  26. package/artifacts/schema/purchase-intent-response.schema.json +1235 -168
  27. package/artifacts/schema/robot-detail-response.schema.json +0 -14
  28. package/artifacts/schema/robot-list-item.schema.json +0 -14
  29. package/artifacts/schema/robot-list-response.schema.json +0 -14
  30. package/dist/billing.d.ts +5665 -210
  31. package/dist/billing.js +224 -29
  32. package/dist/client-robots.d.ts +0 -6
  33. package/dist/confirmation-proof.d.ts +5 -0
  34. package/dist/confirmation-proof.js +6 -0
  35. package/dist/errors.d.ts +1 -1
  36. package/dist/errors.js +0 -12
  37. package/dist/iana-time-zones.d.ts +2 -0
  38. package/dist/iana-time-zones.js +426 -0
  39. package/dist/index.d.ts +7 -6
  40. package/dist/index.js +4 -3
  41. package/dist/plans.d.ts +125 -1
  42. package/dist/plans.js +19 -1
  43. package/dist/protocol.d.ts +0 -3
  44. package/dist/protocol.js +0 -1
  45. package/dist/purchase-operation-key.d.ts +4 -0
  46. package/dist/purchase-operation-key.js +4 -0
  47. package/dist/rest.d.ts +0 -52
  48. package/dist/rest.js +0 -15
  49. package/dist/routes.js +43 -35
  50. package/package.json +3 -1
  51. package/artifacts/schema/recover-held-job-request.schema.json +0 -29
  52. package/artifacts/schema/recover-held-job-response.schema.json +0 -125
@@ -1,357 +1,448 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "oneOf": [
3
+ "anyOf": [
4
4
  {
5
- "type": "object",
6
- "properties": {
7
- "intent_id": {
8
- "type": "string",
9
- "format": "uuid",
10
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
11
- "description": "Opaque persisted purchase intent identity."
12
- },
13
- "operation_key": {
14
- "type": "string",
15
- "format": "uuid",
16
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
17
- "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
18
- },
19
- "operation": {
20
- "type": "string",
21
- "enum": [
22
- "checkout",
23
- "paid_change",
24
- "invoice_payment",
25
- "payment_method_invoice"
26
- ]
27
- },
28
- "invoice_id": {
29
- "description": "The due charge or issued invoice, for invoice-paying operations.",
30
- "type": "string",
31
- "format": "uuid",
32
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
33
- },
34
- "state": {
35
- "type": "string",
36
- "const": "awaiting_vies"
37
- },
38
- "reason": {
39
- "type": "string",
40
- "enum": [
41
- "vies_unavailable",
42
- "vies_unverified",
43
- "vies_identifier_missing"
44
- ]
45
- },
46
- "next_attempt_at": {
47
- "type": "string",
48
- "format": "date-time",
49
- "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
50
- }
51
- },
52
- "required": [
53
- "intent_id",
54
- "operation_key",
55
- "operation",
56
- "state",
57
- "reason",
58
- "next_attempt_at"
59
- ],
60
- "additionalProperties": false
61
- },
62
- {
63
- "type": "object",
64
- "properties": {
65
- "intent_id": {
66
- "type": "string",
67
- "format": "uuid",
68
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
69
- "description": "Opaque persisted purchase intent identity."
70
- },
71
- "operation_key": {
72
- "type": "string",
73
- "format": "uuid",
74
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
75
- "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
76
- },
77
- "operation": {
78
- "type": "string",
79
- "enum": [
80
- "checkout",
81
- "paid_change",
82
- "invoice_payment",
83
- "payment_method_invoice"
84
- ]
85
- },
86
- "invoice_id": {
87
- "description": "The due charge or issued invoice, for invoice-paying operations.",
88
- "type": "string",
89
- "format": "uuid",
90
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
91
- },
92
- "quote_revision": {
93
- "type": "string",
94
- "minLength": 1,
95
- "maxLength": 200,
96
- "description": "Opaque revision of the displayed quote; echo it when confirming."
97
- },
98
- "buyer_fingerprint": {
99
- "type": "string",
100
- "minLength": 1,
101
- "maxLength": 200,
102
- "description": "Opaque revision of buyer details and email policy; never full VIES evidence."
103
- },
104
- "state": {
105
- "type": "string",
106
- "const": "eligible"
107
- },
108
- "quote": {
5
+ "oneOf": [
6
+ {
109
7
  "type": "object",
110
8
  "properties": {
111
- "currency": {
112
- "type": "string",
113
- "const": "eur",
114
- "description": "Every new quote is in EUR."
115
- },
116
- "net_cents": {
117
- "type": "integer",
118
- "minimum": 0,
119
- "maximum": 9007199254740991,
120
- "description": "Current charge excluding VAT, in cents."
121
- },
122
- "vat_cents": {
123
- "type": "integer",
124
- "minimum": 0,
125
- "maximum": 9007199254740991,
126
- "description": "VAT on the current charge, in cents."
127
- },
128
- "gross_cents": {
129
- "type": "integer",
130
- "minimum": 0,
131
- "maximum": 9007199254740991,
132
- "description": "Total to confirm, including VAT, in cents."
133
- },
134
- "rate_percent": {
135
- "type": "integer",
136
- "minimum": 0,
137
- "maximum": 100,
138
- "description": "VAT rate in whole percent."
9
+ "intent_id": {
10
+ "type": "string",
11
+ "format": "uuid",
12
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
13
+ "description": "Opaque persisted purchase intent identity."
14
+ },
15
+ "operation_key": {
16
+ "type": "string",
17
+ "format": "uuid",
18
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
19
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
20
+ },
21
+ "operation": {
22
+ "type": "string",
23
+ "enum": [
24
+ "checkout",
25
+ "invoice_payment",
26
+ "payment_method_invoice"
27
+ ]
28
+ },
29
+ "invoice_id": {
30
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
31
+ "type": "string",
32
+ "format": "uuid",
33
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
34
+ },
35
+ "state": {
36
+ "type": "string",
37
+ "const": "awaiting_vies"
38
+ },
39
+ "reason": {
40
+ "type": "string",
41
+ "enum": [
42
+ "vies_unavailable",
43
+ "vies_unverified",
44
+ "vies_identifier_missing"
45
+ ]
46
+ },
47
+ "next_attempt_at": {
48
+ "type": "string",
49
+ "format": "date-time",
50
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
139
51
  }
140
52
  },
141
53
  "required": [
142
- "currency",
143
- "net_cents",
144
- "vat_cents",
145
- "gross_cents",
146
- "rate_percent"
54
+ "intent_id",
55
+ "operation_key",
56
+ "operation",
57
+ "state",
58
+ "reason",
59
+ "next_attempt_at"
147
60
  ],
148
61
  "additionalProperties": false
149
- }
150
- },
151
- "required": [
152
- "intent_id",
153
- "operation_key",
154
- "operation",
155
- "quote_revision",
156
- "buyer_fingerprint",
157
- "state",
158
- "quote"
159
- ],
160
- "additionalProperties": false
161
- },
162
- {
163
- "type": "object",
164
- "properties": {
165
- "intent_id": {
166
- "type": "string",
167
- "format": "uuid",
168
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
169
- "description": "Opaque persisted purchase intent identity."
170
- },
171
- "operation_key": {
172
- "type": "string",
173
- "format": "uuid",
174
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
175
- "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
176
- },
177
- "operation": {
178
- "type": "string",
179
- "enum": [
180
- "checkout",
181
- "paid_change",
182
- "invoice_payment",
183
- "payment_method_invoice",
184
- "mandate_setup"
185
- ]
186
- },
187
- "invoice_id": {
188
- "description": "The due charge or issued invoice, for invoice-paying operations.",
189
- "type": "string",
190
- "format": "uuid",
191
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
192
62
  },
193
- "state": {
194
- "type": "string",
195
- "const": "held"
196
- },
197
- "reason": {
198
- "type": "string",
199
- "enum": [
200
- "legacy_usd_invoice",
201
- "legacy_payer_unresolved",
202
- "mandate_policy_unresolved",
203
- "lexware_contact_pending",
204
- "lexware_contact_changed",
205
- "issuer_cutover_in_progress",
206
- "lexware_issuance_paused"
207
- ]
208
- },
209
- "original_amount": {
210
- "description": "Recorded balance of a held invoice; not a new quote or authorization.",
63
+ {
211
64
  "type": "object",
212
65
  "properties": {
213
- "currency": {
66
+ "intent_id": {
67
+ "type": "string",
68
+ "format": "uuid",
69
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
70
+ "description": "Opaque persisted purchase intent identity."
71
+ },
72
+ "operation_key": {
73
+ "type": "string",
74
+ "format": "uuid",
75
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
76
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
77
+ },
78
+ "operation": {
214
79
  "type": "string",
215
80
  "enum": [
216
- "eur",
217
- "usd"
81
+ "checkout",
82
+ "invoice_payment",
83
+ "payment_method_invoice"
218
84
  ]
219
85
  },
220
- "gross_cents": {
221
- "type": "integer",
222
- "minimum": 0,
223
- "maximum": 9007199254740991
86
+ "invoice_id": {
87
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
88
+ "type": "string",
89
+ "format": "uuid",
90
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
91
+ },
92
+ "quote_revision": {
93
+ "type": "string",
94
+ "minLength": 1,
95
+ "maxLength": 200,
96
+ "description": "Opaque revision of the displayed quote; echo it when confirming."
97
+ },
98
+ "buyer_fingerprint": {
99
+ "type": "string",
100
+ "minLength": 1,
101
+ "maxLength": 200,
102
+ "description": "Opaque revision of buyer details and email policy; never full VIES evidence."
103
+ },
104
+ "state": {
105
+ "type": "string",
106
+ "const": "eligible"
107
+ },
108
+ "quote": {
109
+ "type": "object",
110
+ "properties": {
111
+ "currency": {
112
+ "type": "string",
113
+ "const": "eur",
114
+ "description": "Every new quote is in EUR."
115
+ },
116
+ "net_cents": {
117
+ "type": "integer",
118
+ "minimum": 0,
119
+ "maximum": 9007199254740991,
120
+ "description": "Current charge excluding VAT, in cents."
121
+ },
122
+ "vat_cents": {
123
+ "type": "integer",
124
+ "minimum": 0,
125
+ "maximum": 9007199254740991,
126
+ "description": "VAT on the current charge, in cents."
127
+ },
128
+ "gross_cents": {
129
+ "type": "integer",
130
+ "minimum": 0,
131
+ "maximum": 9007199254740991,
132
+ "description": "Total to confirm, including VAT, in cents."
133
+ },
134
+ "rate_percent": {
135
+ "type": "integer",
136
+ "minimum": 0,
137
+ "maximum": 100,
138
+ "description": "VAT rate in whole percent."
139
+ }
140
+ },
141
+ "required": [
142
+ "currency",
143
+ "net_cents",
144
+ "vat_cents",
145
+ "gross_cents",
146
+ "rate_percent"
147
+ ],
148
+ "additionalProperties": false
224
149
  }
225
150
  },
226
151
  "required": [
227
- "currency",
228
- "gross_cents"
152
+ "intent_id",
153
+ "operation_key",
154
+ "operation",
155
+ "quote_revision",
156
+ "buyer_fingerprint",
157
+ "state",
158
+ "quote"
229
159
  ],
230
160
  "additionalProperties": false
231
- }
232
- },
233
- "required": [
234
- "intent_id",
235
- "operation_key",
236
- "operation",
237
- "state",
238
- "reason"
239
- ],
240
- "additionalProperties": false
241
- },
242
- {
243
- "type": "object",
244
- "properties": {
245
- "intent_id": {
246
- "type": "string",
247
- "format": "uuid",
248
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
249
- "description": "Opaque persisted purchase intent identity."
250
161
  },
251
- "operation_key": {
252
- "type": "string",
253
- "format": "uuid",
254
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
255
- "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
256
- },
257
- "operation": {
258
- "type": "string",
259
- "enum": [
260
- "checkout",
261
- "paid_change",
262
- "invoice_payment",
263
- "payment_method_invoice"
264
- ]
265
- },
266
- "invoice_id": {
267
- "description": "The due charge or issued invoice, for invoice-paying operations.",
268
- "type": "string",
269
- "format": "uuid",
270
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
271
- },
272
- "state": {
273
- "type": "string",
274
- "const": "invalid_vat_id"
162
+ {
163
+ "type": "object",
164
+ "properties": {
165
+ "intent_id": {
166
+ "type": "string",
167
+ "format": "uuid",
168
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
169
+ "description": "Opaque persisted purchase intent identity."
170
+ },
171
+ "operation_key": {
172
+ "type": "string",
173
+ "format": "uuid",
174
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
175
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
176
+ },
177
+ "operation": {
178
+ "type": "string",
179
+ "enum": [
180
+ "checkout",
181
+ "invoice_payment",
182
+ "payment_method_invoice",
183
+ "mandate_setup"
184
+ ]
185
+ },
186
+ "invoice_id": {
187
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
188
+ "type": "string",
189
+ "format": "uuid",
190
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
191
+ },
192
+ "state": {
193
+ "type": "string",
194
+ "const": "held"
195
+ },
196
+ "reason": {
197
+ "type": "string",
198
+ "enum": [
199
+ "legacy_usd_invoice",
200
+ "legacy_payer_unresolved",
201
+ "mandate_policy_unresolved",
202
+ "lexware_contact_pending",
203
+ "lexware_contact_changed",
204
+ "issuer_cutover_in_progress",
205
+ "lexware_issuance_paused"
206
+ ]
207
+ },
208
+ "original_amount": {
209
+ "description": "Recorded balance of a held invoice; not a new quote or authorization.",
210
+ "type": "object",
211
+ "properties": {
212
+ "currency": {
213
+ "type": "string",
214
+ "enum": [
215
+ "eur",
216
+ "usd"
217
+ ]
218
+ },
219
+ "gross_cents": {
220
+ "type": "integer",
221
+ "minimum": 0,
222
+ "maximum": 9007199254740991
223
+ }
224
+ },
225
+ "required": [
226
+ "currency",
227
+ "gross_cents"
228
+ ],
229
+ "additionalProperties": false
230
+ }
231
+ },
232
+ "required": [
233
+ "intent_id",
234
+ "operation_key",
235
+ "operation",
236
+ "state",
237
+ "reason"
238
+ ],
239
+ "additionalProperties": false
275
240
  },
276
- "field": {
277
- "type": "string",
278
- "const": "billing.vat_id"
241
+ {
242
+ "type": "object",
243
+ "properties": {
244
+ "intent_id": {
245
+ "type": "string",
246
+ "format": "uuid",
247
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
248
+ "description": "Opaque persisted purchase intent identity."
249
+ },
250
+ "operation_key": {
251
+ "type": "string",
252
+ "format": "uuid",
253
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
254
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
255
+ },
256
+ "operation": {
257
+ "type": "string",
258
+ "enum": [
259
+ "checkout",
260
+ "invoice_payment",
261
+ "payment_method_invoice"
262
+ ]
263
+ },
264
+ "invoice_id": {
265
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
266
+ "type": "string",
267
+ "format": "uuid",
268
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
269
+ },
270
+ "state": {
271
+ "type": "string",
272
+ "const": "invalid_vat_id"
273
+ },
274
+ "field": {
275
+ "type": "string",
276
+ "const": "billing.vat_id"
277
+ },
278
+ "rule": {
279
+ "type": "string",
280
+ "const": "vat_id_invalid"
281
+ }
282
+ },
283
+ "required": [
284
+ "intent_id",
285
+ "operation_key",
286
+ "operation",
287
+ "state",
288
+ "field",
289
+ "rule"
290
+ ],
291
+ "additionalProperties": false
279
292
  },
280
- "rule": {
281
- "type": "string",
282
- "const": "vat_id_invalid"
293
+ {
294
+ "type": "object",
295
+ "properties": {
296
+ "intent_id": {
297
+ "type": "string",
298
+ "format": "uuid",
299
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
300
+ "description": "Opaque persisted purchase intent identity."
301
+ },
302
+ "operation_key": {
303
+ "type": "string",
304
+ "format": "uuid",
305
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
306
+ "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
307
+ },
308
+ "operation": {
309
+ "type": "string",
310
+ "enum": [
311
+ "checkout",
312
+ "invoice_payment",
313
+ "payment_method_invoice"
314
+ ]
315
+ },
316
+ "invoice_id": {
317
+ "description": "The due charge or issued invoice, for invoice-paying operations.",
318
+ "type": "string",
319
+ "format": "uuid",
320
+ "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
321
+ },
322
+ "state": {
323
+ "type": "string",
324
+ "const": "refused"
325
+ },
326
+ "field": {
327
+ "type": "string",
328
+ "minLength": 1
329
+ },
330
+ "rule": {
331
+ "type": "string",
332
+ "enum": [
333
+ "company_required",
334
+ "vat_id_required",
335
+ "vat_id_invalid",
336
+ "tax_id_required",
337
+ "us_state_required",
338
+ "public_email_domain",
339
+ "invoice_not_open"
340
+ ]
341
+ }
342
+ },
343
+ "required": [
344
+ "intent_id",
345
+ "operation_key",
346
+ "operation",
347
+ "state",
348
+ "field",
349
+ "rule"
350
+ ],
351
+ "additionalProperties": false
283
352
  }
284
- },
285
- "required": [
286
- "intent_id",
287
- "operation_key",
288
- "operation",
289
- "state",
290
- "field",
291
- "rule"
292
353
  ],
293
- "additionalProperties": false
294
- },
295
- {
296
- "type": "object",
297
- "properties": {
298
- "intent_id": {
299
- "type": "string",
300
- "format": "uuid",
301
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
302
- "description": "Opaque persisted purchase intent identity."
303
- },
304
- "operation_key": {
305
- "type": "string",
306
- "format": "uuid",
307
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
308
- "description": "Client-generated UUID persisted before the start request. Unique per org and reused only for identical input."
309
- },
310
- "operation": {
311
- "type": "string",
312
- "enum": [
313
- "checkout",
314
- "paid_change",
315
- "invoice_payment",
316
- "payment_method_invoice"
317
- ]
318
- },
319
- "invoice_id": {
320
- "description": "The due charge or issued invoice, for invoice-paying operations.",
321
- "type": "string",
322
- "format": "uuid",
323
- "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
354
+ "allOf": [
355
+ {
356
+ "if": {
357
+ "properties": {
358
+ "operation": {
359
+ "enum": [
360
+ "invoice_payment",
361
+ "payment_method_invoice"
362
+ ]
363
+ }
364
+ },
365
+ "required": [
366
+ "operation"
367
+ ]
368
+ },
369
+ "then": {
370
+ "required": [
371
+ "invoice_id"
372
+ ]
373
+ }
324
374
  },
325
- "state": {
326
- "type": "string",
327
- "const": "refused"
375
+ {
376
+ "if": {
377
+ "properties": {
378
+ "operation": {
379
+ "const": "mandate_setup"
380
+ }
381
+ },
382
+ "required": [
383
+ "operation"
384
+ ]
385
+ },
386
+ "then": {
387
+ "properties": {
388
+ "state": {
389
+ "const": "held"
390
+ },
391
+ "reason": {
392
+ "const": "mandate_policy_unresolved"
393
+ }
394
+ },
395
+ "required": [
396
+ "reason"
397
+ ]
398
+ }
328
399
  },
329
- "field": {
330
- "type": "string",
331
- "minLength": 1
400
+ {
401
+ "if": {
402
+ "properties": {
403
+ "reason": {
404
+ "const": "mandate_policy_unresolved"
405
+ }
406
+ },
407
+ "required": [
408
+ "reason"
409
+ ]
410
+ },
411
+ "then": {
412
+ "properties": {
413
+ "operation": {
414
+ "const": "mandate_setup"
415
+ }
416
+ }
417
+ }
332
418
  },
333
- "rule": {
334
- "type": "string",
335
- "enum": [
336
- "company_required",
337
- "vat_id_required",
338
- "vat_id_invalid",
339
- "tax_id_required",
340
- "us_state_required",
341
- "public_email_domain",
342
- "invoice_not_open"
343
- ]
419
+ {
420
+ "if": {
421
+ "properties": {
422
+ "payment": {
423
+ "properties": {
424
+ "kind": {
425
+ "const": "mandate"
426
+ }
427
+ },
428
+ "required": [
429
+ "kind"
430
+ ]
431
+ }
432
+ },
433
+ "required": [
434
+ "payment"
435
+ ]
436
+ },
437
+ "then": {
438
+ "properties": {
439
+ "operation": {
440
+ "const": "paid_change"
441
+ }
442
+ }
443
+ }
344
444
  }
345
- },
346
- "required": [
347
- "intent_id",
348
- "operation_key",
349
- "operation",
350
- "state",
351
- "field",
352
- "rule"
353
- ],
354
- "additionalProperties": false
445
+ ]
355
446
  },
356
447
  {
357
448
  "type": "object",
@@ -372,7 +463,6 @@
372
463
  "type": "string",
373
464
  "enum": [
374
465
  "checkout",
375
- "paid_change",
376
466
  "invoice_payment",
377
467
  "payment_method_invoice"
378
468
  ]
@@ -442,99 +532,99 @@
442
532
  "payment_id",
443
533
  "payment"
444
534
  ],
445
- "additionalProperties": false
446
- }
447
- ],
448
- "allOf": [
449
- {
450
- "if": {
451
- "properties": {
452
- "operation": {
453
- "enum": [
454
- "invoice_payment",
455
- "payment_method_invoice"
535
+ "additionalProperties": false,
536
+ "allOf": [
537
+ {
538
+ "if": {
539
+ "properties": {
540
+ "operation": {
541
+ "enum": [
542
+ "invoice_payment",
543
+ "payment_method_invoice"
544
+ ]
545
+ }
546
+ },
547
+ "required": [
548
+ "operation"
456
549
  ]
457
- }
458
- },
459
- "required": [
460
- "operation"
461
- ]
462
- },
463
- "then": {
464
- "required": [
465
- "invoice_id"
466
- ]
467
- }
468
- },
469
- {
470
- "if": {
471
- "properties": {
472
- "operation": {
473
- "const": "mandate_setup"
474
- }
475
- },
476
- "required": [
477
- "operation"
478
- ]
479
- },
480
- "then": {
481
- "properties": {
482
- "state": {
483
- "const": "held"
484
550
  },
485
- "reason": {
486
- "const": "mandate_policy_unresolved"
551
+ "then": {
552
+ "required": [
553
+ "invoice_id"
554
+ ]
487
555
  }
488
556
  },
489
- "required": [
490
- "reason"
491
- ]
492
- }
493
- },
494
- {
495
- "if": {
496
- "properties": {
497
- "reason": {
498
- "const": "mandate_policy_unresolved"
557
+ {
558
+ "if": {
559
+ "properties": {
560
+ "operation": {
561
+ "const": "mandate_setup"
562
+ }
563
+ },
564
+ "required": [
565
+ "operation"
566
+ ]
567
+ },
568
+ "then": {
569
+ "properties": {
570
+ "state": {
571
+ "const": "held"
572
+ },
573
+ "reason": {
574
+ "const": "mandate_policy_unresolved"
575
+ }
576
+ },
577
+ "required": [
578
+ "reason"
579
+ ]
499
580
  }
500
581
  },
501
- "required": [
502
- "reason"
503
- ]
504
- },
505
- "then": {
506
- "properties": {
507
- "operation": {
508
- "const": "mandate_setup"
509
- }
510
- }
511
- }
512
- },
513
- {
514
- "if": {
515
- "properties": {
516
- "payment": {
582
+ {
583
+ "if": {
517
584
  "properties": {
518
- "kind": {
519
- "const": "mandate"
585
+ "reason": {
586
+ "const": "mandate_policy_unresolved"
520
587
  }
521
588
  },
522
589
  "required": [
523
- "kind"
590
+ "reason"
524
591
  ]
592
+ },
593
+ "then": {
594
+ "properties": {
595
+ "operation": {
596
+ "const": "mandate_setup"
597
+ }
598
+ }
525
599
  }
526
600
  },
527
- "required": [
528
- "payment"
529
- ]
530
- },
531
- "then": {
532
- "properties": {
533
- "operation": {
534
- "const": "paid_change"
601
+ {
602
+ "if": {
603
+ "properties": {
604
+ "payment": {
605
+ "properties": {
606
+ "kind": {
607
+ "const": "mandate"
608
+ }
609
+ },
610
+ "required": [
611
+ "kind"
612
+ ]
613
+ }
614
+ },
615
+ "required": [
616
+ "payment"
617
+ ]
618
+ },
619
+ "then": {
620
+ "properties": {
621
+ "operation": {
622
+ "const": "paid_change"
623
+ }
624
+ }
535
625
  }
536
626
  }
537
- }
627
+ ]
538
628
  }
539
629
  ]
540
630
  }