@hyodotdev/openiap-commerce-protocol 0.0.0-bootstrap.0 → 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.
- package/CONVENTION.md +168 -0
- package/DESIGN.md +1056 -0
- package/README.md +227 -5
- package/SPEC.md +1471 -0
- package/conformance/index.d.ts +303 -0
- package/conformance/index.mjs +2126 -0
- package/conformance/mock-provider.mjs +491 -0
- package/examples/entitlement-granted-no-subscription.json +12 -0
- package/examples/entitlement-revoked.json +21 -0
- package/examples/provider-capabilities.json +209 -0
- package/examples/store-event-mapping.json +287 -0
- package/examples/subscription-canceled.json +22 -0
- package/examples/subscription-product-changed.json +30 -0
- package/examples/subscription-renewed.json +29 -0
- package/examples/verify-purchase-request.json +6 -0
- package/examples/verify-purchase-result.json +7 -0
- package/generated/bindings/graphql-operations.json +87 -0
- package/generated/bindings/http-binding.json +143 -0
- package/generated/bindings/introspection-signature.json +320 -0
- package/generated/bindings/operations-sdl.json +4 -0
- package/generated/bindings/operations.graphql +366 -0
- package/generated/commerce-protocol.graphql +1219 -0
- package/generated/openapi/commerce-protocol.openapi.json +1413 -0
- package/generated/schemas/commerce-event.schema.json +499 -0
- package/generated/schemas/commerce-protocol.bundle.schema.json +1576 -0
- package/generated/schemas/operations.schema.json +578 -0
- package/generated/schemas/primitives.schema.json +101 -0
- package/generated/schemas/provider-capabilities.schema.json +205 -0
- package/generated/schemas/store-event-mapping.schema.json +211 -0
- package/generated/vectors/lifecycle.json +908 -0
- package/generated/vectors/operations.json +1122 -0
- package/package.json +62 -12
- package/schema/01-primitives.graphql +102 -0
- package/schema/02-commerce-event.graphql +195 -0
- package/schema/03-provider-capabilities.graphql +139 -0
- package/schema/04-store-event-mapping.graphql +98 -0
- package/schema/05-operations.graphql +461 -0
- package/schema/06-compiler-vocabulary.graphql +139 -0
- package/schema/07-protocol-metadata.graphql +76 -0
- package/src/index.d.ts +63 -0
- package/src/index.mjs +121 -0
- package/vectors/signatures.json +139 -0
|
@@ -0,0 +1,1413 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.1.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "OpenIAP Commerce Protocol",
|
|
5
|
+
"version": "1.0",
|
|
6
|
+
"description": "REST binding of the OpenIAP Commerce Protocol operation surface. Generated from commerce-protocol.graphql — do not edit. Error statuses follow the manifest's errorStatus table; every error body is a ProtocolErrorResponse.",
|
|
7
|
+
"license": {
|
|
8
|
+
"name": "MIT"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"paths": {
|
|
12
|
+
"/commerce/v1/capabilities": {
|
|
13
|
+
"get": {
|
|
14
|
+
"operationId": "providerCapabilities",
|
|
15
|
+
"summary": "What this provider implements: protocol version, profiles, bindings, and per-store capability",
|
|
16
|
+
"description": "What this provider implements: protocol version, profiles, bindings, and per-store capability. Public and free of commerce data, so a consumer or a conformance runner reads it without credentials and without any central registry.",
|
|
17
|
+
"tags": [
|
|
18
|
+
"core"
|
|
19
|
+
],
|
|
20
|
+
"security": [],
|
|
21
|
+
"responses": {
|
|
22
|
+
"200": {
|
|
23
|
+
"description": "Success",
|
|
24
|
+
"content": {
|
|
25
|
+
"application/json": {
|
|
26
|
+
"schema": {
|
|
27
|
+
"$ref": "#/components/schemas/ProviderCapabilities"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"429": {
|
|
33
|
+
"description": "`RATE_LIMITED`",
|
|
34
|
+
"headers": {
|
|
35
|
+
"Retry-After": {
|
|
36
|
+
"description": "Seconds to wait before retrying.",
|
|
37
|
+
"schema": {
|
|
38
|
+
"type": "integer",
|
|
39
|
+
"minimum": 1
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"content": {
|
|
44
|
+
"application/json": {
|
|
45
|
+
"schema": {
|
|
46
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"500": {
|
|
52
|
+
"description": "`INTERNAL_ERROR`",
|
|
53
|
+
"content": {
|
|
54
|
+
"application/json": {
|
|
55
|
+
"schema": {
|
|
56
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"/commerce/v1/subscriptions/status": {
|
|
65
|
+
"get": {
|
|
66
|
+
"operationId": "subscriptionStatus",
|
|
67
|
+
"summary": "A developer backend reads one authenticated user's subscription standing",
|
|
68
|
+
"description": "A developer backend reads one authenticated user's subscription standing. Server role only: a shipped app must not be able to walk arbitrary user identities, which is why the verification role is refused here.",
|
|
69
|
+
"tags": [
|
|
70
|
+
"entitlements"
|
|
71
|
+
],
|
|
72
|
+
"security": [
|
|
73
|
+
{
|
|
74
|
+
"serverCredential": []
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"responses": {
|
|
78
|
+
"200": {
|
|
79
|
+
"description": "Success",
|
|
80
|
+
"content": {
|
|
81
|
+
"application/json": {
|
|
82
|
+
"schema": {
|
|
83
|
+
"$ref": "#/components/schemas/SubscriptionStatusResult"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"400": {
|
|
89
|
+
"description": "`INVALID_REQUEST`",
|
|
90
|
+
"content": {
|
|
91
|
+
"application/json": {
|
|
92
|
+
"schema": {
|
|
93
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"401": {
|
|
99
|
+
"description": "`UNAUTHORIZED`",
|
|
100
|
+
"content": {
|
|
101
|
+
"application/json": {
|
|
102
|
+
"schema": {
|
|
103
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"403": {
|
|
109
|
+
"description": "`FORBIDDEN`",
|
|
110
|
+
"content": {
|
|
111
|
+
"application/json": {
|
|
112
|
+
"schema": {
|
|
113
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"429": {
|
|
119
|
+
"description": "`RATE_LIMITED`",
|
|
120
|
+
"headers": {
|
|
121
|
+
"Retry-After": {
|
|
122
|
+
"description": "Seconds to wait before retrying.",
|
|
123
|
+
"schema": {
|
|
124
|
+
"type": "integer",
|
|
125
|
+
"minimum": 1
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"content": {
|
|
130
|
+
"application/json": {
|
|
131
|
+
"schema": {
|
|
132
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"500": {
|
|
138
|
+
"description": "`INTERNAL_ERROR`",
|
|
139
|
+
"content": {
|
|
140
|
+
"application/json": {
|
|
141
|
+
"schema": {
|
|
142
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"parameters": [
|
|
149
|
+
{
|
|
150
|
+
"name": "userId",
|
|
151
|
+
"in": "query",
|
|
152
|
+
"required": true,
|
|
153
|
+
"schema": {
|
|
154
|
+
"description": "The opaque app-scoped user identity the caller's backend selected, in the identity space shared by provider and caller.",
|
|
155
|
+
"$ref": "#/components/schemas/Identifier"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"/commerce/v1/entitlements": {
|
|
162
|
+
"get": {
|
|
163
|
+
"operationId": "entitlements",
|
|
164
|
+
"summary": "A developer backend reads one authenticated user's access decision",
|
|
165
|
+
"description": "A developer backend reads one authenticated user's access decision. Server role only, and fail-close: anything the provider cannot classify as currently entitled is absent from the answer.",
|
|
166
|
+
"tags": [
|
|
167
|
+
"entitlements"
|
|
168
|
+
],
|
|
169
|
+
"security": [
|
|
170
|
+
{
|
|
171
|
+
"serverCredential": []
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"responses": {
|
|
175
|
+
"200": {
|
|
176
|
+
"description": "Success",
|
|
177
|
+
"content": {
|
|
178
|
+
"application/json": {
|
|
179
|
+
"schema": {
|
|
180
|
+
"$ref": "#/components/schemas/EntitlementsResult"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"400": {
|
|
186
|
+
"description": "`INVALID_REQUEST`",
|
|
187
|
+
"content": {
|
|
188
|
+
"application/json": {
|
|
189
|
+
"schema": {
|
|
190
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"401": {
|
|
196
|
+
"description": "`UNAUTHORIZED`",
|
|
197
|
+
"content": {
|
|
198
|
+
"application/json": {
|
|
199
|
+
"schema": {
|
|
200
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"403": {
|
|
206
|
+
"description": "`FORBIDDEN`",
|
|
207
|
+
"content": {
|
|
208
|
+
"application/json": {
|
|
209
|
+
"schema": {
|
|
210
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"429": {
|
|
216
|
+
"description": "`RATE_LIMITED`",
|
|
217
|
+
"headers": {
|
|
218
|
+
"Retry-After": {
|
|
219
|
+
"description": "Seconds to wait before retrying.",
|
|
220
|
+
"schema": {
|
|
221
|
+
"type": "integer",
|
|
222
|
+
"minimum": 1
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
"content": {
|
|
227
|
+
"application/json": {
|
|
228
|
+
"schema": {
|
|
229
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
"500": {
|
|
235
|
+
"description": "`INTERNAL_ERROR`",
|
|
236
|
+
"content": {
|
|
237
|
+
"application/json": {
|
|
238
|
+
"schema": {
|
|
239
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
245
|
+
"parameters": [
|
|
246
|
+
{
|
|
247
|
+
"name": "userId",
|
|
248
|
+
"in": "query",
|
|
249
|
+
"required": true,
|
|
250
|
+
"schema": {
|
|
251
|
+
"description": "The opaque app-scoped user identity the caller's backend selected, in the identity space shared by provider and caller.",
|
|
252
|
+
"$ref": "#/components/schemas/Identifier"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
"/commerce/v1/purchases/verify": {
|
|
259
|
+
"post": {
|
|
260
|
+
"operationId": "verifyPurchase",
|
|
261
|
+
"summary": "Verifies store evidence and returns the verdict",
|
|
262
|
+
"description": "Verifies store evidence and returns the verdict. The verification role suffices: this operation binds no user, reads no account, and repeating it with the same evidence is safe. VERIFICATION_FAILED means the provider could not obtain a verdict — it never stands in for the store rejecting the evidence, which is a successful result with `isValid: false`.",
|
|
263
|
+
"tags": [
|
|
264
|
+
"verification"
|
|
265
|
+
],
|
|
266
|
+
"security": [
|
|
267
|
+
{
|
|
268
|
+
"verificationCredential": []
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"responses": {
|
|
272
|
+
"200": {
|
|
273
|
+
"description": "Success",
|
|
274
|
+
"content": {
|
|
275
|
+
"application/json": {
|
|
276
|
+
"schema": {
|
|
277
|
+
"$ref": "#/components/schemas/VerifyPurchaseResult"
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"400": {
|
|
283
|
+
"description": "`INVALID_REQUEST`",
|
|
284
|
+
"content": {
|
|
285
|
+
"application/json": {
|
|
286
|
+
"schema": {
|
|
287
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
},
|
|
292
|
+
"401": {
|
|
293
|
+
"description": "`UNAUTHORIZED`",
|
|
294
|
+
"content": {
|
|
295
|
+
"application/json": {
|
|
296
|
+
"schema": {
|
|
297
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
"422": {
|
|
303
|
+
"description": "`UNSUPPORTED_STORE`",
|
|
304
|
+
"content": {
|
|
305
|
+
"application/json": {
|
|
306
|
+
"schema": {
|
|
307
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
"429": {
|
|
313
|
+
"description": "`RATE_LIMITED`",
|
|
314
|
+
"headers": {
|
|
315
|
+
"Retry-After": {
|
|
316
|
+
"description": "Seconds to wait before retrying.",
|
|
317
|
+
"schema": {
|
|
318
|
+
"type": "integer",
|
|
319
|
+
"minimum": 1
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
"content": {
|
|
324
|
+
"application/json": {
|
|
325
|
+
"schema": {
|
|
326
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
"500": {
|
|
332
|
+
"description": "`INTERNAL_ERROR`",
|
|
333
|
+
"content": {
|
|
334
|
+
"application/json": {
|
|
335
|
+
"schema": {
|
|
336
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
"502": {
|
|
342
|
+
"description": "`VERIFICATION_FAILED`",
|
|
343
|
+
"content": {
|
|
344
|
+
"application/json": {
|
|
345
|
+
"schema": {
|
|
346
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
"requestBody": {
|
|
353
|
+
"required": true,
|
|
354
|
+
"content": {
|
|
355
|
+
"application/json": {
|
|
356
|
+
"schema": {
|
|
357
|
+
"$ref": "#/components/schemas/VerifyPurchaseInput"
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
},
|
|
364
|
+
"/commerce/v1/purchases/bind": {
|
|
365
|
+
"post": {
|
|
366
|
+
"operationId": "bindPurchase",
|
|
367
|
+
"summary": "Binds a verified purchase to the adopter's opaque user identity",
|
|
368
|
+
"description": "Binds a verified purchase to the adopter's opaque user identity. Server role only; retrying is idempotent.",
|
|
369
|
+
"tags": [
|
|
370
|
+
"accountLifecycle"
|
|
371
|
+
],
|
|
372
|
+
"security": [
|
|
373
|
+
{
|
|
374
|
+
"serverCredential": []
|
|
375
|
+
}
|
|
376
|
+
],
|
|
377
|
+
"responses": {
|
|
378
|
+
"200": {
|
|
379
|
+
"description": "Success",
|
|
380
|
+
"content": {
|
|
381
|
+
"application/json": {
|
|
382
|
+
"schema": {
|
|
383
|
+
"$ref": "#/components/schemas/BindPurchaseResult"
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"400": {
|
|
389
|
+
"description": "`INVALID_REQUEST`",
|
|
390
|
+
"content": {
|
|
391
|
+
"application/json": {
|
|
392
|
+
"schema": {
|
|
393
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"401": {
|
|
399
|
+
"description": "`UNAUTHORIZED`",
|
|
400
|
+
"content": {
|
|
401
|
+
"application/json": {
|
|
402
|
+
"schema": {
|
|
403
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
"403": {
|
|
409
|
+
"description": "`FORBIDDEN`",
|
|
410
|
+
"content": {
|
|
411
|
+
"application/json": {
|
|
412
|
+
"schema": {
|
|
413
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
"422": {
|
|
419
|
+
"description": "`UNSUPPORTED_STORE`",
|
|
420
|
+
"content": {
|
|
421
|
+
"application/json": {
|
|
422
|
+
"schema": {
|
|
423
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
},
|
|
428
|
+
"429": {
|
|
429
|
+
"description": "`RATE_LIMITED`",
|
|
430
|
+
"headers": {
|
|
431
|
+
"Retry-After": {
|
|
432
|
+
"description": "Seconds to wait before retrying.",
|
|
433
|
+
"schema": {
|
|
434
|
+
"type": "integer",
|
|
435
|
+
"minimum": 1
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
"content": {
|
|
440
|
+
"application/json": {
|
|
441
|
+
"schema": {
|
|
442
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
"500": {
|
|
448
|
+
"description": "`INTERNAL_ERROR`",
|
|
449
|
+
"content": {
|
|
450
|
+
"application/json": {
|
|
451
|
+
"schema": {
|
|
452
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
"requestBody": {
|
|
459
|
+
"required": true,
|
|
460
|
+
"content": {
|
|
461
|
+
"application/json": {
|
|
462
|
+
"schema": {
|
|
463
|
+
"$ref": "#/components/schemas/BindPurchaseInput"
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
"/commerce/v1/users/erase": {
|
|
471
|
+
"post": {
|
|
472
|
+
"operationId": "eraseUser",
|
|
473
|
+
"summary": "Removes a user identity from the provider's subscription records and protocol event identity",
|
|
474
|
+
"description": "Removes a user identity from the provider's subscription records and protocol event identity. Server role only; re-requesting the same user is idempotent and reports the current job.",
|
|
475
|
+
"tags": [
|
|
476
|
+
"accountLifecycle"
|
|
477
|
+
],
|
|
478
|
+
"security": [
|
|
479
|
+
{
|
|
480
|
+
"serverCredential": []
|
|
481
|
+
}
|
|
482
|
+
],
|
|
483
|
+
"responses": {
|
|
484
|
+
"202": {
|
|
485
|
+
"description": "Success",
|
|
486
|
+
"content": {
|
|
487
|
+
"application/json": {
|
|
488
|
+
"schema": {
|
|
489
|
+
"$ref": "#/components/schemas/EraseUserResult"
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
"400": {
|
|
495
|
+
"description": "`INVALID_REQUEST`",
|
|
496
|
+
"content": {
|
|
497
|
+
"application/json": {
|
|
498
|
+
"schema": {
|
|
499
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
},
|
|
504
|
+
"401": {
|
|
505
|
+
"description": "`UNAUTHORIZED`",
|
|
506
|
+
"content": {
|
|
507
|
+
"application/json": {
|
|
508
|
+
"schema": {
|
|
509
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
"403": {
|
|
515
|
+
"description": "`FORBIDDEN`",
|
|
516
|
+
"content": {
|
|
517
|
+
"application/json": {
|
|
518
|
+
"schema": {
|
|
519
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
"429": {
|
|
525
|
+
"description": "`RATE_LIMITED`",
|
|
526
|
+
"headers": {
|
|
527
|
+
"Retry-After": {
|
|
528
|
+
"description": "Seconds to wait before retrying.",
|
|
529
|
+
"schema": {
|
|
530
|
+
"type": "integer",
|
|
531
|
+
"minimum": 1
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
"content": {
|
|
536
|
+
"application/json": {
|
|
537
|
+
"schema": {
|
|
538
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
},
|
|
543
|
+
"500": {
|
|
544
|
+
"description": "`INTERNAL_ERROR`",
|
|
545
|
+
"content": {
|
|
546
|
+
"application/json": {
|
|
547
|
+
"schema": {
|
|
548
|
+
"$ref": "#/components/schemas/ProtocolErrorResponse"
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
"requestBody": {
|
|
555
|
+
"required": true,
|
|
556
|
+
"content": {
|
|
557
|
+
"application/json": {
|
|
558
|
+
"schema": {
|
|
559
|
+
"$ref": "#/components/schemas/EraseUserInput"
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
"components": {
|
|
568
|
+
"schemas": {
|
|
569
|
+
"ProviderCapabilities": {
|
|
570
|
+
"title": "OpenIAP Commerce Protocol implementation descriptor",
|
|
571
|
+
"description": "What an implementation supports: the specification version it speaks, the event types it can emit, and what it can actually observe per store. This is the document a consumer, an operator, or a tool reads to determine compatibility without guessing and without reading prose. It contains no commerce data.",
|
|
572
|
+
"type": "object",
|
|
573
|
+
"required": [
|
|
574
|
+
"specVersion",
|
|
575
|
+
"eventTypes",
|
|
576
|
+
"stores"
|
|
577
|
+
],
|
|
578
|
+
"additionalProperties": true,
|
|
579
|
+
"properties": {
|
|
580
|
+
"specVersion": {
|
|
581
|
+
"description": "OpenIAP Commerce Protocol version this declaration was written against, as MAJOR.MINOR.",
|
|
582
|
+
"type": "string",
|
|
583
|
+
"pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
|
|
584
|
+
},
|
|
585
|
+
"implementation": {
|
|
586
|
+
"description": "Free-form name and version of the backend making this declaration. Present so an operator can tell two backends apart; it carries no normative meaning.",
|
|
587
|
+
"type": "object",
|
|
588
|
+
"additionalProperties": true,
|
|
589
|
+
"properties": {
|
|
590
|
+
"name": {
|
|
591
|
+
"description": "Name of the backend making this declaration, for an operator reading a descriptor without knowing where it came from.",
|
|
592
|
+
"type": "string",
|
|
593
|
+
"minLength": 1
|
|
594
|
+
},
|
|
595
|
+
"version": {
|
|
596
|
+
"description": "Version of that backend, when it publishes one. Not a specification version — that is `specVersion`.",
|
|
597
|
+
"type": "string",
|
|
598
|
+
"minLength": 1
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
"eventTypes": {
|
|
603
|
+
"description": "Event types this implementation can emit. A consumer uses it to know which lifecycle signals to expect; absence of a type here means this implementation never produces it, which is different from a type that simply has not occurred yet.",
|
|
604
|
+
"type": "array",
|
|
605
|
+
"items": {
|
|
606
|
+
"type": "string",
|
|
607
|
+
"pattern": "^[a-z]+\\.[a-z_]+$"
|
|
608
|
+
},
|
|
609
|
+
"minItems": 1,
|
|
610
|
+
"uniqueItems": true
|
|
611
|
+
},
|
|
612
|
+
"stores": {
|
|
613
|
+
"description": "Keyed by store, using the same open value space as the event envelope. An implementation declares only the stores it actually integrates.",
|
|
614
|
+
"type": "object",
|
|
615
|
+
"minProperties": 1,
|
|
616
|
+
"propertyNames": {
|
|
617
|
+
"pattern": "^[a-z][a-z0-9_]*$"
|
|
618
|
+
},
|
|
619
|
+
"additionalProperties": {
|
|
620
|
+
"$ref": "#/components/schemas/CapabilitiesStoreCapabilities"
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
"profiles": {
|
|
624
|
+
"description": "Operation profiles this implementation serves, keyed by profile name with the profile version as the value. This version names `verification`, `entitlements`, `events`, and `accountLifecycle`; the key space is open, so a consumer MUST ignore a profile it does not recognise. An implementation MUST declare only profiles it implements and passes conformance for, and MUST NOT declare a profile it partially implements. Absent on a descriptor from an events-only emitter that predates the operation surface.",
|
|
625
|
+
"type": "object",
|
|
626
|
+
"minProperties": 1,
|
|
627
|
+
"propertyNames": {
|
|
628
|
+
"pattern": "^[a-z][a-zA-Z0-9]*$"
|
|
629
|
+
},
|
|
630
|
+
"additionalProperties": {
|
|
631
|
+
"type": "string",
|
|
632
|
+
"pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
"bindings": {
|
|
636
|
+
"description": "Transport bindings this implementation serves for the declared profiles, keyed by binding name with the binding version as the value. This version names `rest` and `graphql`; the key space is open. Declaring a binding means every declared profile operation is reachable over it. An implementation MAY serve one binding only. Absent on a descriptor from an events-only emitter.",
|
|
637
|
+
"type": "object",
|
|
638
|
+
"minProperties": 1,
|
|
639
|
+
"propertyNames": {
|
|
640
|
+
"pattern": "^[a-z][a-zA-Z0-9]*$"
|
|
641
|
+
},
|
|
642
|
+
"additionalProperties": {
|
|
643
|
+
"type": "string",
|
|
644
|
+
"pattern": "^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
"SubscriptionStatusInput": {
|
|
650
|
+
"description": "Selects the user whose subscription standing the caller's backend reads.",
|
|
651
|
+
"type": "object",
|
|
652
|
+
"required": [
|
|
653
|
+
"userId"
|
|
654
|
+
],
|
|
655
|
+
"additionalProperties": true,
|
|
656
|
+
"properties": {
|
|
657
|
+
"userId": {
|
|
658
|
+
"description": "The opaque app-scoped user identity the caller's backend selected, in the identity space shared by provider and caller.",
|
|
659
|
+
"$ref": "#/components/schemas/Identifier"
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
},
|
|
663
|
+
"SubscriptionStatusResult": {
|
|
664
|
+
"description": "The user's current subscription standing. `active` answers the gate for the user as a whole; `subscription` is the most relevant record — the current entitling subscription when one exists, otherwise the provider's most recent record as context. It is omitted when the provider has no record for this user. A provider that cannot enumerate the user's records completely MUST fail the operation instead of answering from a partial read.",
|
|
665
|
+
"type": "object",
|
|
666
|
+
"required": [
|
|
667
|
+
"active"
|
|
668
|
+
],
|
|
669
|
+
"additionalProperties": false,
|
|
670
|
+
"properties": {
|
|
671
|
+
"active": {
|
|
672
|
+
"description": "Whether the user is entitled to anything right now. The gate for simple access checks.",
|
|
673
|
+
"type": "boolean"
|
|
674
|
+
},
|
|
675
|
+
"subscription": {
|
|
676
|
+
"$ref": "#/components/schemas/SubscriptionStatusSnapshot"
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
},
|
|
680
|
+
"EntitlementsInput": {
|
|
681
|
+
"description": "Selects the user whose access decision the caller's backend reads.",
|
|
682
|
+
"type": "object",
|
|
683
|
+
"required": [
|
|
684
|
+
"userId"
|
|
685
|
+
],
|
|
686
|
+
"additionalProperties": true,
|
|
687
|
+
"properties": {
|
|
688
|
+
"userId": {
|
|
689
|
+
"description": "The opaque app-scoped user identity the caller's backend selected, in the identity space shared by provider and caller.",
|
|
690
|
+
"$ref": "#/components/schemas/Identifier"
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
"EntitlementsResult": {
|
|
695
|
+
"description": "Every product the user may access right now, with the entitling subscription records. Unknown, expired, and ambiguous records contribute nothing: a product appears only when its gate is open at the provider's read time. A provider that cannot enumerate the user's records completely MUST fail the operation instead of answering from a partial read.",
|
|
696
|
+
"type": "object",
|
|
697
|
+
"required": [
|
|
698
|
+
"userId",
|
|
699
|
+
"productIds",
|
|
700
|
+
"subscriptions"
|
|
701
|
+
],
|
|
702
|
+
"additionalProperties": false,
|
|
703
|
+
"properties": {
|
|
704
|
+
"userId": {
|
|
705
|
+
"$ref": "#/components/schemas/Identifier"
|
|
706
|
+
},
|
|
707
|
+
"productIds": {
|
|
708
|
+
"description": "Every product the user may access right now, deduplicated.",
|
|
709
|
+
"type": "array",
|
|
710
|
+
"items": {
|
|
711
|
+
"type": "string",
|
|
712
|
+
"minLength": 1
|
|
713
|
+
},
|
|
714
|
+
"uniqueItems": true
|
|
715
|
+
},
|
|
716
|
+
"subscriptions": {
|
|
717
|
+
"description": "The subscription records whose open gates produced `productIds`.",
|
|
718
|
+
"type": "array",
|
|
719
|
+
"items": {
|
|
720
|
+
"$ref": "#/components/schemas/SubscriptionStatusSnapshot"
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
},
|
|
725
|
+
"VerifyPurchaseInput": {
|
|
726
|
+
"description": "One purchase's store evidence, discriminated by `store`. The store space stays open: a provider that does not integrate the named store rejects the call with UNSUPPORTED_STORE rather than failing schema validation, so a future store is a MINOR evidence-member addition, not a breaking change. For each store this version names, the matching evidence member is required.",
|
|
727
|
+
"type": "object",
|
|
728
|
+
"required": [
|
|
729
|
+
"store"
|
|
730
|
+
],
|
|
731
|
+
"additionalProperties": true,
|
|
732
|
+
"properties": {
|
|
733
|
+
"store": {
|
|
734
|
+
"$ref": "#/components/schemas/Store"
|
|
735
|
+
},
|
|
736
|
+
"apple": {
|
|
737
|
+
"$ref": "#/components/schemas/AppleEvidence"
|
|
738
|
+
},
|
|
739
|
+
"google": {
|
|
740
|
+
"$ref": "#/components/schemas/GoogleEvidence"
|
|
741
|
+
},
|
|
742
|
+
"horizon": {
|
|
743
|
+
"$ref": "#/components/schemas/HorizonEvidence"
|
|
744
|
+
},
|
|
745
|
+
"amazon": {
|
|
746
|
+
"$ref": "#/components/schemas/AmazonEvidence"
|
|
747
|
+
}
|
|
748
|
+
},
|
|
749
|
+
"allOf": [
|
|
750
|
+
{
|
|
751
|
+
"if": {
|
|
752
|
+
"properties": {
|
|
753
|
+
"store": {
|
|
754
|
+
"const": "apple"
|
|
755
|
+
}
|
|
756
|
+
},
|
|
757
|
+
"required": [
|
|
758
|
+
"store"
|
|
759
|
+
]
|
|
760
|
+
},
|
|
761
|
+
"then": {
|
|
762
|
+
"properties": {
|
|
763
|
+
"apple": {}
|
|
764
|
+
},
|
|
765
|
+
"required": [
|
|
766
|
+
"apple"
|
|
767
|
+
]
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"if": {
|
|
772
|
+
"properties": {
|
|
773
|
+
"store": {
|
|
774
|
+
"const": "google"
|
|
775
|
+
}
|
|
776
|
+
},
|
|
777
|
+
"required": [
|
|
778
|
+
"store"
|
|
779
|
+
]
|
|
780
|
+
},
|
|
781
|
+
"then": {
|
|
782
|
+
"properties": {
|
|
783
|
+
"google": {}
|
|
784
|
+
},
|
|
785
|
+
"required": [
|
|
786
|
+
"google"
|
|
787
|
+
]
|
|
788
|
+
}
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
"if": {
|
|
792
|
+
"properties": {
|
|
793
|
+
"store": {
|
|
794
|
+
"const": "horizon"
|
|
795
|
+
}
|
|
796
|
+
},
|
|
797
|
+
"required": [
|
|
798
|
+
"store"
|
|
799
|
+
]
|
|
800
|
+
},
|
|
801
|
+
"then": {
|
|
802
|
+
"properties": {
|
|
803
|
+
"horizon": {}
|
|
804
|
+
},
|
|
805
|
+
"required": [
|
|
806
|
+
"horizon"
|
|
807
|
+
]
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
{
|
|
811
|
+
"if": {
|
|
812
|
+
"properties": {
|
|
813
|
+
"store": {
|
|
814
|
+
"const": "amazon"
|
|
815
|
+
}
|
|
816
|
+
},
|
|
817
|
+
"required": [
|
|
818
|
+
"store"
|
|
819
|
+
]
|
|
820
|
+
},
|
|
821
|
+
"then": {
|
|
822
|
+
"properties": {
|
|
823
|
+
"amazon": {}
|
|
824
|
+
},
|
|
825
|
+
"required": [
|
|
826
|
+
"amazon"
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
]
|
|
831
|
+
},
|
|
832
|
+
"VerifyPurchaseResult": {
|
|
833
|
+
"description": "The verification verdict. `isValid` is the authoritative acceptance gate: a caller MUST read it and MUST NOT re-derive acceptance from `state`. A verdict is a statement about the evidence at verification time, never an account mutation — verification binds no user.",
|
|
834
|
+
"type": "object",
|
|
835
|
+
"required": [
|
|
836
|
+
"store",
|
|
837
|
+
"isValid",
|
|
838
|
+
"state"
|
|
839
|
+
],
|
|
840
|
+
"additionalProperties": true,
|
|
841
|
+
"properties": {
|
|
842
|
+
"store": {
|
|
843
|
+
"$ref": "#/components/schemas/Store"
|
|
844
|
+
},
|
|
845
|
+
"isValid": {
|
|
846
|
+
"description": "Whether the provider accepts the evidence. The single authoritative acceptance gate.",
|
|
847
|
+
"type": "boolean"
|
|
848
|
+
},
|
|
849
|
+
"state": {
|
|
850
|
+
"description": "The verification verdict for one piece of purchase evidence, as a normalized token. This is the purchase-validation axis SPEC.md 2.3 warns about — a CANCELED verification verdict and a canceled-but-still-entitled subscription are different facts. The value space is OPEN: a caller MUST tolerate a token it does not know and gate on `isValid` alone.",
|
|
851
|
+
"type": "string",
|
|
852
|
+
"pattern": "^[A-Z][A-Z0-9_]*$",
|
|
853
|
+
"examples": [
|
|
854
|
+
"ENTITLED",
|
|
855
|
+
"PENDING_ACKNOWLEDGMENT",
|
|
856
|
+
"PENDING",
|
|
857
|
+
"CANCELED",
|
|
858
|
+
"EXPIRED",
|
|
859
|
+
"READY_TO_CONSUME",
|
|
860
|
+
"CONSUMED",
|
|
861
|
+
"UNKNOWN",
|
|
862
|
+
"INAUTHENTIC"
|
|
863
|
+
]
|
|
864
|
+
},
|
|
865
|
+
"productId": {
|
|
866
|
+
"description": "The product the store verified, when its response exposes one. Never the caller's claim.",
|
|
867
|
+
"type": "string",
|
|
868
|
+
"minLength": 1
|
|
869
|
+
},
|
|
870
|
+
"environment": {
|
|
871
|
+
"description": "The store environment the provider verified against, using the same open value space as the event envelope.",
|
|
872
|
+
"$ref": "#/components/schemas/Environment"
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
},
|
|
876
|
+
"BindPurchaseInput": {
|
|
877
|
+
"description": "Connects verified store evidence to the adopter's own opaque user identity. Binding is a server-side account mutation: only the server role may call it, and possession of a purchase token is deliberately not proof of ownership — a provider MUST refuse to move an existing binding through this operation.",
|
|
878
|
+
"type": "object",
|
|
879
|
+
"required": [
|
|
880
|
+
"userId",
|
|
881
|
+
"store"
|
|
882
|
+
],
|
|
883
|
+
"additionalProperties": true,
|
|
884
|
+
"properties": {
|
|
885
|
+
"userId": {
|
|
886
|
+
"$ref": "#/components/schemas/Identifier"
|
|
887
|
+
},
|
|
888
|
+
"store": {
|
|
889
|
+
"$ref": "#/components/schemas/Store"
|
|
890
|
+
},
|
|
891
|
+
"apple": {
|
|
892
|
+
"$ref": "#/components/schemas/AppleEvidence"
|
|
893
|
+
},
|
|
894
|
+
"google": {
|
|
895
|
+
"$ref": "#/components/schemas/GoogleEvidence"
|
|
896
|
+
},
|
|
897
|
+
"horizon": {
|
|
898
|
+
"$ref": "#/components/schemas/HorizonEvidence"
|
|
899
|
+
},
|
|
900
|
+
"amazon": {
|
|
901
|
+
"$ref": "#/components/schemas/AmazonEvidence"
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
"allOf": [
|
|
905
|
+
{
|
|
906
|
+
"if": {
|
|
907
|
+
"properties": {
|
|
908
|
+
"store": {
|
|
909
|
+
"const": "apple"
|
|
910
|
+
}
|
|
911
|
+
},
|
|
912
|
+
"required": [
|
|
913
|
+
"store"
|
|
914
|
+
]
|
|
915
|
+
},
|
|
916
|
+
"then": {
|
|
917
|
+
"properties": {
|
|
918
|
+
"apple": {}
|
|
919
|
+
},
|
|
920
|
+
"required": [
|
|
921
|
+
"apple"
|
|
922
|
+
]
|
|
923
|
+
}
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
"if": {
|
|
927
|
+
"properties": {
|
|
928
|
+
"store": {
|
|
929
|
+
"const": "google"
|
|
930
|
+
}
|
|
931
|
+
},
|
|
932
|
+
"required": [
|
|
933
|
+
"store"
|
|
934
|
+
]
|
|
935
|
+
},
|
|
936
|
+
"then": {
|
|
937
|
+
"properties": {
|
|
938
|
+
"google": {}
|
|
939
|
+
},
|
|
940
|
+
"required": [
|
|
941
|
+
"google"
|
|
942
|
+
]
|
|
943
|
+
}
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
"if": {
|
|
947
|
+
"properties": {
|
|
948
|
+
"store": {
|
|
949
|
+
"const": "horizon"
|
|
950
|
+
}
|
|
951
|
+
},
|
|
952
|
+
"required": [
|
|
953
|
+
"store"
|
|
954
|
+
]
|
|
955
|
+
},
|
|
956
|
+
"then": {
|
|
957
|
+
"properties": {
|
|
958
|
+
"horizon": {}
|
|
959
|
+
},
|
|
960
|
+
"required": [
|
|
961
|
+
"horizon"
|
|
962
|
+
]
|
|
963
|
+
}
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
"if": {
|
|
967
|
+
"properties": {
|
|
968
|
+
"store": {
|
|
969
|
+
"const": "amazon"
|
|
970
|
+
}
|
|
971
|
+
},
|
|
972
|
+
"required": [
|
|
973
|
+
"store"
|
|
974
|
+
]
|
|
975
|
+
},
|
|
976
|
+
"then": {
|
|
977
|
+
"properties": {
|
|
978
|
+
"amazon": {}
|
|
979
|
+
},
|
|
980
|
+
"required": [
|
|
981
|
+
"amazon"
|
|
982
|
+
]
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
]
|
|
986
|
+
},
|
|
987
|
+
"BindPurchaseResult": {
|
|
988
|
+
"description": "Whether a binding now exists between this user and the evidenced purchase. `bound: false` covers every non-binding outcome — unknown evidence, evidence bound to a different user, or a store the provider cannot bind — without distinguishing them, so the operation cannot be used to probe whether someone else's purchase exists. Re-binding the same user to the same evidence is idempotent and reports `bound: true`.",
|
|
989
|
+
"type": "object",
|
|
990
|
+
"required": [
|
|
991
|
+
"bound"
|
|
992
|
+
],
|
|
993
|
+
"additionalProperties": true,
|
|
994
|
+
"properties": {
|
|
995
|
+
"bound": {
|
|
996
|
+
"description": "True when a binding between this user and the evidenced purchase now exists.",
|
|
997
|
+
"type": "boolean"
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
},
|
|
1001
|
+
"EraseUserInput": {
|
|
1002
|
+
"description": "Selects the user identity to erase from the provider's records.",
|
|
1003
|
+
"type": "object",
|
|
1004
|
+
"required": [
|
|
1005
|
+
"userId"
|
|
1006
|
+
],
|
|
1007
|
+
"additionalProperties": true,
|
|
1008
|
+
"properties": {
|
|
1009
|
+
"userId": {
|
|
1010
|
+
"description": "The opaque app-scoped user identity to remove from the provider's subscription records and protocol event identity.",
|
|
1011
|
+
"$ref": "#/components/schemas/Identifier"
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
},
|
|
1015
|
+
"EraseUserResult": {
|
|
1016
|
+
"description": "Acknowledgement of an erasure request. Erasure removes the user identity from the provider's own records and event store; it is asynchronous where the provider processes it as a job, and re-requesting the same user is idempotent — it reports the current job rather than failing. A provider CANNOT unsend events: copies already delivered to the caller's own systems are the caller's responsibility to erase.",
|
|
1017
|
+
"type": "object",
|
|
1018
|
+
"required": [
|
|
1019
|
+
"accepted"
|
|
1020
|
+
],
|
|
1021
|
+
"additionalProperties": true,
|
|
1022
|
+
"properties": {
|
|
1023
|
+
"accepted": {
|
|
1024
|
+
"description": "Whether the provider accepted the erasure request.",
|
|
1025
|
+
"type": "boolean"
|
|
1026
|
+
},
|
|
1027
|
+
"jobId": {
|
|
1028
|
+
"$ref": "#/components/schemas/Identifier"
|
|
1029
|
+
},
|
|
1030
|
+
"status": {
|
|
1031
|
+
"description": "The lifecycle state of a user-erasure job. The value space is open; `completed` is the only terminal token this version names.",
|
|
1032
|
+
"type": "string",
|
|
1033
|
+
"pattern": "^[a-z][a-z_]*$",
|
|
1034
|
+
"examples": [
|
|
1035
|
+
"queued",
|
|
1036
|
+
"running",
|
|
1037
|
+
"completed"
|
|
1038
|
+
]
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
},
|
|
1042
|
+
"ProtocolErrorResponse": {
|
|
1043
|
+
"description": "The REST error envelope. Every non-success REST response carries exactly this shape — CLOSED, so an error body cannot smuggle members past the tokenless rules (a failure response is the easiest place to hide a leak, because callers rarely inspect it).",
|
|
1044
|
+
"type": "object",
|
|
1045
|
+
"required": [
|
|
1046
|
+
"error"
|
|
1047
|
+
],
|
|
1048
|
+
"additionalProperties": false,
|
|
1049
|
+
"properties": {
|
|
1050
|
+
"error": {
|
|
1051
|
+
"$ref": "#/components/schemas/ProtocolError"
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
},
|
|
1055
|
+
"CapabilitiesStoreCapabilities": {
|
|
1056
|
+
"description": "What one store's commerce surface offers and what this backend consumes of it, axis by axis. The container stays open: a version that names a new axis is a MINOR addition older consumers ignore.",
|
|
1057
|
+
"type": "object",
|
|
1058
|
+
"required": [
|
|
1059
|
+
"initialValidation",
|
|
1060
|
+
"serverNotifications",
|
|
1061
|
+
"subscriptions",
|
|
1062
|
+
"renewalEvents",
|
|
1063
|
+
"refundEvents",
|
|
1064
|
+
"expiration",
|
|
1065
|
+
"reconciliation",
|
|
1066
|
+
"entitlements",
|
|
1067
|
+
"revenueAmount"
|
|
1068
|
+
],
|
|
1069
|
+
"additionalProperties": true,
|
|
1070
|
+
"properties": {
|
|
1071
|
+
"initialValidation": {
|
|
1072
|
+
"description": "Server-side receipt or token validation on demand.",
|
|
1073
|
+
"$ref": "#/components/schemas/CapabilitiesSupport"
|
|
1074
|
+
},
|
|
1075
|
+
"serverNotifications": {
|
|
1076
|
+
"description": "The store pushes lifecycle notifications to the backend.",
|
|
1077
|
+
"$ref": "#/components/schemas/CapabilitiesSupport"
|
|
1078
|
+
},
|
|
1079
|
+
"subscriptions": {
|
|
1080
|
+
"description": "A canonical subscription record can be maintained for this store.",
|
|
1081
|
+
"$ref": "#/components/schemas/CapabilitiesSupport"
|
|
1082
|
+
},
|
|
1083
|
+
"renewalEvents": {
|
|
1084
|
+
"description": "Renewal is observable as a distinct lifecycle event.",
|
|
1085
|
+
"$ref": "#/components/schemas/CapabilitiesSupport"
|
|
1086
|
+
},
|
|
1087
|
+
"refundEvents": {
|
|
1088
|
+
"description": "Refund or revocation is observable as a distinct lifecycle event.",
|
|
1089
|
+
"$ref": "#/components/schemas/CapabilitiesSupport"
|
|
1090
|
+
},
|
|
1091
|
+
"expiration": {
|
|
1092
|
+
"description": "Expiration is observable, rather than only inferred from a timestamp having passed.",
|
|
1093
|
+
"$ref": "#/components/schemas/CapabilitiesSupport"
|
|
1094
|
+
},
|
|
1095
|
+
"reconciliation": {
|
|
1096
|
+
"description": "A scheduled pass re-reads authoritative store state, so a lost notification can self-heal.",
|
|
1097
|
+
"$ref": "#/components/schemas/CapabilitiesSupport"
|
|
1098
|
+
},
|
|
1099
|
+
"entitlements": {
|
|
1100
|
+
"description": "Entitlement is derivable for access gating.",
|
|
1101
|
+
"$ref": "#/components/schemas/CapabilitiesSupport"
|
|
1102
|
+
},
|
|
1103
|
+
"revenueAmount": {
|
|
1104
|
+
"description": "The store asserts an amount that can be attributed to revenue with `store` provenance.",
|
|
1105
|
+
"$ref": "#/components/schemas/CapabilitiesSupport"
|
|
1106
|
+
}
|
|
1107
|
+
}
|
|
1108
|
+
},
|
|
1109
|
+
"Identifier": {
|
|
1110
|
+
"description": "An opaque, implementation-assigned identifier. Consumers MUST treat it as an opaque string and MUST NOT parse structure out of it.",
|
|
1111
|
+
"type": "string",
|
|
1112
|
+
"minLength": 1,
|
|
1113
|
+
"maxLength": 256
|
|
1114
|
+
},
|
|
1115
|
+
"SubscriptionStatusSnapshot": {
|
|
1116
|
+
"description": "One subscription as the provider currently records it, shaped for a server-side read. It is tokenless by construction: this object is CLOSED, so the schema itself rejects any member beyond those listed — no purchase token, store transaction identity, signed receipt, or provider-internal record identifier can appear, and the response is safe to hold in a developer backend.",
|
|
1117
|
+
"type": "object",
|
|
1118
|
+
"required": [
|
|
1119
|
+
"productId",
|
|
1120
|
+
"state",
|
|
1121
|
+
"active"
|
|
1122
|
+
],
|
|
1123
|
+
"additionalProperties": false,
|
|
1124
|
+
"properties": {
|
|
1125
|
+
"productId": {
|
|
1126
|
+
"description": "Store product identifier of the subscription.",
|
|
1127
|
+
"type": "string",
|
|
1128
|
+
"minLength": 1
|
|
1129
|
+
},
|
|
1130
|
+
"state": {
|
|
1131
|
+
"$ref": "#/components/schemas/SubscriptionState"
|
|
1132
|
+
},
|
|
1133
|
+
"active": {
|
|
1134
|
+
"description": "The entitlement gate for this subscription, evaluated with the predicate in SPEC.md 2.3 at the provider's read time. A caller gates access on this member, never on `state`.",
|
|
1135
|
+
"type": "boolean"
|
|
1136
|
+
},
|
|
1137
|
+
"store": {
|
|
1138
|
+
"$ref": "#/components/schemas/Store"
|
|
1139
|
+
},
|
|
1140
|
+
"expiresAt": {
|
|
1141
|
+
"$ref": "#/components/schemas/Timestamp"
|
|
1142
|
+
},
|
|
1143
|
+
"renewsAt": {
|
|
1144
|
+
"$ref": "#/components/schemas/Timestamp"
|
|
1145
|
+
},
|
|
1146
|
+
"willRenew": {
|
|
1147
|
+
"description": "Whether the store will attempt another billing period, when the provider records it.",
|
|
1148
|
+
"type": "boolean"
|
|
1149
|
+
},
|
|
1150
|
+
"cancellationReason": {
|
|
1151
|
+
"description": "Why the subscription stopped renewing, as the same open normalized token space the event envelope uses. Advisory, never a billing fact.",
|
|
1152
|
+
"type": "string",
|
|
1153
|
+
"minLength": 1
|
|
1154
|
+
},
|
|
1155
|
+
"startedAt": {
|
|
1156
|
+
"$ref": "#/components/schemas/Timestamp"
|
|
1157
|
+
},
|
|
1158
|
+
"updatedAt": {
|
|
1159
|
+
"$ref": "#/components/schemas/Timestamp"
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
},
|
|
1163
|
+
"Store": {
|
|
1164
|
+
"description": "The commerce platform that is authoritative for the purchase. This is a store, not a device platform: one device platform can host several stores. The value space is OPEN. The listed values are the stores this version names, but an implementation that observes commerce on another platform MUST be able to emit it, and a consumer MUST accept and preserve an unrecognised store opaquely rather than reject the event. Use a lowercase, stable, unambiguous token.",
|
|
1165
|
+
"type": "string",
|
|
1166
|
+
"pattern": "^[a-z][a-z0-9_]*$",
|
|
1167
|
+
"examples": [
|
|
1168
|
+
"apple",
|
|
1169
|
+
"google",
|
|
1170
|
+
"horizon",
|
|
1171
|
+
"amazon"
|
|
1172
|
+
]
|
|
1173
|
+
},
|
|
1174
|
+
"AppleEvidence": {
|
|
1175
|
+
"description": "Store evidence for one Apple App Store purchase: the signed StoreKit 2 transaction JWS the app received from the store.",
|
|
1176
|
+
"type": "object",
|
|
1177
|
+
"required": [
|
|
1178
|
+
"jws"
|
|
1179
|
+
],
|
|
1180
|
+
"additionalProperties": true,
|
|
1181
|
+
"properties": {
|
|
1182
|
+
"jws": {
|
|
1183
|
+
"description": "A compact signed transaction JWS. Bounded so an oversized body cannot be forwarded to a store: an Apple transaction JWS is a few kilobytes.",
|
|
1184
|
+
"type": "string",
|
|
1185
|
+
"minLength": 1,
|
|
1186
|
+
"maxLength": 16384
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
},
|
|
1190
|
+
"GoogleEvidence": {
|
|
1191
|
+
"description": "Store evidence for one Google Play purchase: the opaque purchase token the store issued to the device.",
|
|
1192
|
+
"type": "object",
|
|
1193
|
+
"required": [
|
|
1194
|
+
"purchaseToken"
|
|
1195
|
+
],
|
|
1196
|
+
"additionalProperties": true,
|
|
1197
|
+
"properties": {
|
|
1198
|
+
"purchaseToken": {
|
|
1199
|
+
"description": "An opaque store purchase token. Bounded to keep an oversized body off the store API.",
|
|
1200
|
+
"type": "string",
|
|
1201
|
+
"minLength": 1,
|
|
1202
|
+
"maxLength": 4096
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
"HorizonEvidence": {
|
|
1207
|
+
"description": "Store evidence for one Meta Horizon (Quest) entitlement. Horizon issues no server-verifiable receipt, so verification identifies the entitlement by user and SKU; the provider holds the store credentials.",
|
|
1208
|
+
"type": "object",
|
|
1209
|
+
"required": [
|
|
1210
|
+
"userId",
|
|
1211
|
+
"sku"
|
|
1212
|
+
],
|
|
1213
|
+
"additionalProperties": true,
|
|
1214
|
+
"properties": {
|
|
1215
|
+
"userId": {
|
|
1216
|
+
"description": "A store-issued user identity, as the store's own API returns it. Distinct from the protocol's opaque `userId`.",
|
|
1217
|
+
"type": "string",
|
|
1218
|
+
"minLength": 1,
|
|
1219
|
+
"maxLength": 512
|
|
1220
|
+
},
|
|
1221
|
+
"sku": {
|
|
1222
|
+
"description": "A store add-on SKU. Bounded to a predictable identifier length.",
|
|
1223
|
+
"type": "string",
|
|
1224
|
+
"minLength": 1,
|
|
1225
|
+
"maxLength": 256
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1229
|
+
"AmazonEvidence": {
|
|
1230
|
+
"description": "Store evidence for one Amazon Appstore purchase, as returned by the Amazon SDK. `sandbox` selects the RVS sandbox for App Tester receipts where the provider permits it.",
|
|
1231
|
+
"type": "object",
|
|
1232
|
+
"required": [
|
|
1233
|
+
"userId",
|
|
1234
|
+
"receiptId"
|
|
1235
|
+
],
|
|
1236
|
+
"additionalProperties": true,
|
|
1237
|
+
"properties": {
|
|
1238
|
+
"userId": {
|
|
1239
|
+
"description": "A store-issued user identity, as the store's own API returns it. Distinct from the protocol's opaque `userId`.",
|
|
1240
|
+
"type": "string",
|
|
1241
|
+
"minLength": 1,
|
|
1242
|
+
"maxLength": 512
|
|
1243
|
+
},
|
|
1244
|
+
"receiptId": {
|
|
1245
|
+
"description": "A store receipt identifier. Bounded to keep an oversized body off the store API.",
|
|
1246
|
+
"type": "string",
|
|
1247
|
+
"minLength": 1,
|
|
1248
|
+
"maxLength": 4096
|
|
1249
|
+
},
|
|
1250
|
+
"sandbox": {
|
|
1251
|
+
"description": "Verify against the store's sandbox where the provider permits it. Omitted means production.",
|
|
1252
|
+
"type": "boolean"
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
},
|
|
1256
|
+
"Environment": {
|
|
1257
|
+
"description": "The store environment the purchase belongs to. The value space is open: receivers MUST accept and preserve an unrecognised value opaquely and MUST NOT reject an event because of it.",
|
|
1258
|
+
"type": "string",
|
|
1259
|
+
"minLength": 1,
|
|
1260
|
+
"examples": [
|
|
1261
|
+
"production",
|
|
1262
|
+
"sandbox",
|
|
1263
|
+
"xcode"
|
|
1264
|
+
]
|
|
1265
|
+
},
|
|
1266
|
+
"ProtocolError": {
|
|
1267
|
+
"description": "One protocol operation failure. Both bindings carry the same code space: REST wraps it in ProtocolErrorResponse, GraphQL carries `code` in `errors[].extensions`. A message is human-readable and MUST NOT contain credentials, store evidence, stack traces, or implementation source paths.",
|
|
1268
|
+
"type": "object",
|
|
1269
|
+
"required": [
|
|
1270
|
+
"code",
|
|
1271
|
+
"message"
|
|
1272
|
+
],
|
|
1273
|
+
"additionalProperties": false,
|
|
1274
|
+
"properties": {
|
|
1275
|
+
"code": {
|
|
1276
|
+
"description": "A portable protocol error code. The value space is OPEN: a caller MUST tolerate a code it does not recognise and treat it as a failure of the operation, and a MINOR version can add a code. The listed values are the ones this version names; SPEC.md 8 defines each one and its HTTP status.",
|
|
1277
|
+
"type": "string",
|
|
1278
|
+
"pattern": "^[A-Z][A-Z0-9_]*$",
|
|
1279
|
+
"examples": [
|
|
1280
|
+
"INVALID_REQUEST",
|
|
1281
|
+
"UNAUTHORIZED",
|
|
1282
|
+
"FORBIDDEN",
|
|
1283
|
+
"NOT_FOUND",
|
|
1284
|
+
"PURCHASE_NOT_FOUND",
|
|
1285
|
+
"VERIFICATION_FAILED",
|
|
1286
|
+
"CONFLICT",
|
|
1287
|
+
"RATE_LIMITED",
|
|
1288
|
+
"UNSUPPORTED_PROFILE",
|
|
1289
|
+
"UNSUPPORTED_STORE",
|
|
1290
|
+
"INTERNAL_ERROR"
|
|
1291
|
+
]
|
|
1292
|
+
},
|
|
1293
|
+
"message": {
|
|
1294
|
+
"description": "Human-readable failure summary. Never carries credentials, store evidence, stack traces, or source paths.",
|
|
1295
|
+
"type": "string",
|
|
1296
|
+
"minLength": 1
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1299
|
+
},
|
|
1300
|
+
"CapabilitiesSupport": {
|
|
1301
|
+
"description": "Two axes, deliberately separate. `provider` is what the store's own API offers; `implementation` is what this backend actually consumes. They differ in practice — a store can publish a notification channel that a given backend has not integrated — and collapsing them into one boolean produces a dishonest matrix.",
|
|
1302
|
+
"type": "object",
|
|
1303
|
+
"required": [
|
|
1304
|
+
"provider",
|
|
1305
|
+
"implementation"
|
|
1306
|
+
],
|
|
1307
|
+
"additionalProperties": false,
|
|
1308
|
+
"properties": {
|
|
1309
|
+
"provider": {
|
|
1310
|
+
"description": "Whether the store's own API offers this at all. A fact about the store, independent of any backend.",
|
|
1311
|
+
"type": "boolean"
|
|
1312
|
+
},
|
|
1313
|
+
"implementation": {
|
|
1314
|
+
"description": "Whether this backend consumes it. False against a true `provider` is an implementation gap, not a store limitation.",
|
|
1315
|
+
"type": "boolean"
|
|
1316
|
+
},
|
|
1317
|
+
"notes": {
|
|
1318
|
+
"description": "Required whenever `provider` and `implementation` disagree, or whenever either is false. States the concrete limitation in prose a support engineer can act on.",
|
|
1319
|
+
"type": "string",
|
|
1320
|
+
"minLength": 1
|
|
1321
|
+
}
|
|
1322
|
+
},
|
|
1323
|
+
"anyOf": [
|
|
1324
|
+
{
|
|
1325
|
+
"properties": {
|
|
1326
|
+
"provider": {
|
|
1327
|
+
"const": true
|
|
1328
|
+
},
|
|
1329
|
+
"implementation": {
|
|
1330
|
+
"const": true
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
},
|
|
1334
|
+
{
|
|
1335
|
+
"properties": {
|
|
1336
|
+
"notes": {
|
|
1337
|
+
"type": "string",
|
|
1338
|
+
"minLength": 1
|
|
1339
|
+
}
|
|
1340
|
+
},
|
|
1341
|
+
"required": [
|
|
1342
|
+
"notes"
|
|
1343
|
+
]
|
|
1344
|
+
}
|
|
1345
|
+
],
|
|
1346
|
+
"if": {
|
|
1347
|
+
"properties": {
|
|
1348
|
+
"implementation": {
|
|
1349
|
+
"const": true
|
|
1350
|
+
}
|
|
1351
|
+
},
|
|
1352
|
+
"required": [
|
|
1353
|
+
"implementation"
|
|
1354
|
+
]
|
|
1355
|
+
},
|
|
1356
|
+
"then": {
|
|
1357
|
+
"properties": {
|
|
1358
|
+
"provider": {
|
|
1359
|
+
"const": true
|
|
1360
|
+
}
|
|
1361
|
+
},
|
|
1362
|
+
"required": [
|
|
1363
|
+
"provider"
|
|
1364
|
+
]
|
|
1365
|
+
}
|
|
1366
|
+
},
|
|
1367
|
+
"SubscriptionState": {
|
|
1368
|
+
"description": "The lifecycle state of a subscription. This is a state, not an event, and it does not by itself decide entitlement — see Entitlement in SPEC.md. These members are PascalCase while event types are lowercase-dotted; the inconsistency is inherited from the deployed 1.0 wire format and is recorded in CONVENTION.md rather than silently corrected, because changing it would break receivers already decoding it.",
|
|
1369
|
+
"type": "string",
|
|
1370
|
+
"enum": [
|
|
1371
|
+
"Active",
|
|
1372
|
+
"InGracePeriod",
|
|
1373
|
+
"InBillingRetry",
|
|
1374
|
+
"Paused",
|
|
1375
|
+
"Expired",
|
|
1376
|
+
"Revoked",
|
|
1377
|
+
"Refunded",
|
|
1378
|
+
"Unknown"
|
|
1379
|
+
]
|
|
1380
|
+
},
|
|
1381
|
+
"Timestamp": {
|
|
1382
|
+
"description": "An instant, as integer milliseconds since the Unix epoch, UTC. Every timestamp in this specification uses this encoding. The one exception is the transport signature timestamp, which is in seconds; see the webhook section of SPEC.md.",
|
|
1383
|
+
"type": "integer",
|
|
1384
|
+
"minimum": 0
|
|
1385
|
+
}
|
|
1386
|
+
},
|
|
1387
|
+
"securitySchemes": {
|
|
1388
|
+
"verificationCredential": {
|
|
1389
|
+
"type": "http",
|
|
1390
|
+
"scheme": "bearer",
|
|
1391
|
+
"description": "Verification-role credential: limited to purchase-evidence verification, no account access."
|
|
1392
|
+
},
|
|
1393
|
+
"serverCredential": {
|
|
1394
|
+
"type": "http",
|
|
1395
|
+
"scheme": "bearer",
|
|
1396
|
+
"description": "Server-role credential for an authenticated developer backend. Never ship it in an app."
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
"x-error-status": {
|
|
1401
|
+
"INVALID_REQUEST": 400,
|
|
1402
|
+
"UNAUTHORIZED": 401,
|
|
1403
|
+
"FORBIDDEN": 403,
|
|
1404
|
+
"NOT_FOUND": 404,
|
|
1405
|
+
"PURCHASE_NOT_FOUND": 404,
|
|
1406
|
+
"CONFLICT": 409,
|
|
1407
|
+
"UNSUPPORTED_STORE": 422,
|
|
1408
|
+
"RATE_LIMITED": 429,
|
|
1409
|
+
"INTERNAL_ERROR": 500,
|
|
1410
|
+
"UNSUPPORTED_PROFILE": 501,
|
|
1411
|
+
"VERIFICATION_FAILED": 502
|
|
1412
|
+
}
|
|
1413
|
+
}
|