-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-review-prop-spec.yaml
More file actions
1141 lines (1117 loc) · 31.2 KB
/
api-review-prop-spec.yaml
File metadata and controls
1141 lines (1117 loc) · 31.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: Acme Commerce API - API Review Probe Spec
version: 1.0.0
description: |
This is a synthetic OpenAPI specification designed to reverse engineer API review best-practice patterns.
It intentionally includes paired GOOD and BAD examples. Each operation contains a TEST_CASE id in the description.
Do not treat this as a production API. Use review findings to map reviewer feedback back to the test case ids.
servers:
- url: https://api.acme-example.com/v1
security:
- bearerAuth: []
tags:
- name: Customers
- name: Payments
- name: Refunds
- name: Orders
- name: Webhooks
- name: Reports
- name: Bad Patterns
paths:
/customers:
post:
tags: [Customers]
operationId: createCustomer
summary: Create a customer
description: |
TEST_CASE: NAMING_01_GOOD_RESOURCE_CREATE
Purpose: Tests whether resource-oriented endpoint design is favored.
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateCustomerRequest'
examples:
default:
value:
email: alex@example.com
name: Alex Chen
metadata:
plan: gold
responses:
'201':
description: Customer created
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'
default:
$ref: '#/components/responses/ErrorResponse'
get:
tags: [Customers]
operationId: listCustomers
summary: List customers
description: |
TEST_CASE: PAGINATION_01_GOOD_CURSOR
Purpose: Tests cursor-based pagination with stable ordering and has_more.
parameters:
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/StartingAfter'
- $ref: '#/components/parameters/CreatedGte'
responses:
'200':
description: A paginated list of customers
content:
application/json:
schema:
$ref: '#/components/schemas/CustomerList'
default:
$ref: '#/components/responses/ErrorResponse'
/customers/{customer_id}:
get:
tags: [Customers]
operationId: retrieveCustomer
summary: Retrieve a customer
description: |
TEST_CASE: NAMING_02_GOOD_PATH_PARAM
Purpose: Tests clear resource id naming and typed path parameters.
parameters:
- $ref: '#/components/parameters/CustomerId'
responses:
'200':
description: Customer retrieved
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'
default:
$ref: '#/components/responses/ErrorResponse'
patch:
tags: [Customers]
operationId: updateCustomer
summary: Update a customer
description: |
TEST_CASE: UPDATE_01_GOOD_PATCH_PARTIAL
Purpose: Tests use of PATCH for partial updates with optional fields.
parameters:
- $ref: '#/components/parameters/CustomerId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateCustomerRequest'
responses:
'200':
description: Customer updated
content:
application/json:
schema:
$ref: '#/components/schemas/Customer'
default:
$ref: '#/components/responses/ErrorResponse'
/createCustomer:
post:
tags: [Bad Patterns]
operationId: createCustomerActionStyle
summary: Create customer action endpoint
description: |
TEST_CASE: NAMING_03_BAD_VERB_ENDPOINT
Purpose: Tests whether action-style endpoint names are penalized.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
customerEmail:
type: string
customerName:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
success:
type: boolean
customerId:
type: integer
/customer/getById:
get:
tags: [Bad Patterns]
operationId: getCustomerByIdBad
summary: Get customer by id
description: |
TEST_CASE: NAMING_04_BAD_RPC_PATH
Purpose: Tests whether RPC-style paths and singular resource names are penalized.
parameters:
- name: id
in: query
required: true
schema:
type: integer
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
additionalProperties: true
/payment_intents:
post:
tags: [Payments]
operationId: createPaymentIntent
summary: Create a payment intent
description: |
TEST_CASE: IDEMPOTENCY_01_GOOD_MUTATING_PAYMENT
Purpose: Tests whether mutating payment operations are expected to support idempotency.
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePaymentIntentRequest'
responses:
'201':
description: Payment intent created
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentIntent'
default:
$ref: '#/components/responses/ErrorResponse'
/chargeCard:
post:
tags: [Bad Patterns]
operationId: chargeCardBad
summary: Charge a card
description: |
TEST_CASE: IDEMPOTENCY_02_BAD_PAYMENT_NO_IDEMPOTENCY
Purpose: Tests whether a payment-creating operation without idempotency is flagged.
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [cardNumber, amount]
properties:
cardNumber:
type: string
description: Raw card number intentionally modeled poorly.
amount:
type: number
responses:
'200':
description: Payment result
content:
text/plain:
schema:
type: string
/refunds:
post:
tags: [Refunds]
operationId: createRefund
summary: Create a refund
description: |
TEST_CASE: MONEY_01_GOOD_MINOR_UNITS
Purpose: Tests money fields in integer minor units with explicit currency.
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateRefundRequest'
responses:
'201':
description: Refund created
content:
application/json:
schema:
$ref: '#/components/schemas/Refund'
default:
$ref: '#/components/responses/ErrorResponse'
/refundPaymentNow:
post:
tags: [Bad Patterns]
operationId: refundPaymentNowBad
summary: Refund payment now
description: |
TEST_CASE: MONEY_02_BAD_FLOAT_AMOUNT
Purpose: Tests whether decimal float money amounts and unclear currency are flagged.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
payment:
type: string
refundAmount:
type: number
format: float
example: 10.99
responses:
'200':
description: OK
/orders:
get:
tags: [Orders]
operationId: listOrders
summary: List orders
description: |
TEST_CASE: FILTERING_01_GOOD_FILTER_SORT
Purpose: Tests explicit filtering, sorting, and pagination parameters.
parameters:
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/StartingAfter'
- name: status
in: query
description: Filter by order status.
schema:
type: string
enum: [open, paid, fulfilled, canceled]
- name: sort
in: query
description: Sort order. Prefix with '-' for descending order.
schema:
type: string
enum: [created, -created, total_amount, -total_amount]
responses:
'200':
description: A paginated list of orders
content:
application/json:
schema:
$ref: '#/components/schemas/OrderList'
default:
$ref: '#/components/responses/ErrorResponse'
/orders/listAll:
get:
tags: [Bad Patterns]
operationId: listAllOrdersBad
summary: List all orders
description: |
TEST_CASE: PAGINATION_02_BAD_UNBOUNDED_LIST
Purpose: Tests whether unbounded collection responses are flagged.
responses:
'200':
description: All orders without pagination
content:
application/json:
schema:
type: array
items:
type: object
additionalProperties: true
/orders/{order_id}/cancel:
post:
tags: [Orders]
operationId: cancelOrder
summary: Cancel an order
description: |
TEST_CASE: ACTION_01_GOOD_SUBRESOURCE_ACTION
Purpose: Tests acceptable action endpoint for state transition where DELETE would be ambiguous.
parameters:
- $ref: '#/components/parameters/OrderId'
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
reason:
type: string
maxLength: 500
responses:
'200':
description: Order canceled
content:
application/json:
schema:
$ref: '#/components/schemas/Order'
default:
$ref: '#/components/responses/ErrorResponse'
/deleteOrder:
post:
tags: [Bad Patterns]
operationId: deleteOrderBad
summary: Delete order
description: |
TEST_CASE: DELETE_01_BAD_POST_DELETE
Purpose: Tests whether POST-based delete operations are flagged.
parameters:
- name: orderId
in: query
schema:
type: string
responses:
'200':
description: OK
/reports/balance:
get:
tags: [Reports]
operationId: retrieveBalanceReport
summary: Retrieve a balance report
description: |
TEST_CASE: RESPONSE_01_GOOD_TYPED_RESPONSE
Purpose: Tests clear response schema, timestamps, money object, and examples.
parameters:
- name: as_of
in: query
description: ISO 8601 timestamp for the balance snapshot.
schema:
type: string
format: date-time
responses:
'200':
description: Balance report
content:
application/json:
schema:
$ref: '#/components/schemas/BalanceReport'
default:
$ref: '#/components/responses/ErrorResponse'
/reports/getBalance:
get:
tags: [Bad Patterns]
operationId: getBalanceBad
summary: Get balance
description: |
TEST_CASE: RESPONSE_02_BAD_UNTYPED_RESPONSE
Purpose: Tests whether free-form objects are penalized.
responses:
'200':
description: Balance
content:
application/json:
schema:
type: object
additionalProperties: true
/webhook_endpoints:
post:
tags: [Webhooks]
operationId: createWebhookEndpoint
summary: Create a webhook endpoint
description: |
TEST_CASE: WEBHOOK_01_GOOD_ENDPOINT_REGISTRATION
Purpose: Tests typed webhook registration and event type enum.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateWebhookEndpointRequest'
responses:
'201':
description: Webhook endpoint created
content:
application/json:
schema:
$ref: '#/components/schemas/WebhookEndpoint'
default:
$ref: '#/components/responses/ErrorResponse'
/webhooks/acme:
post:
tags: [Webhooks]
operationId: receiveWebhookExample
summary: Example webhook payload
description: |
TEST_CASE: WEBHOOK_02_GOOD_TYPED_EVENT
Purpose: Tests event envelope with id, type, created, and data.object.
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Event'
responses:
'200':
description: Acknowledge webhook
/callback:
post:
tags: [Bad Patterns]
operationId: callbackBad
summary: Callback
description: |
TEST_CASE: WEBHOOK_03_BAD_UNTYPED_CALLBACK
Purpose: Tests untyped callback payload with no event id, event type, or signature guidance.
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: true
responses:
'200':
description: OK
/v1/createNewPayment2:
post:
tags: [Bad Patterns]
operationId: createNewPayment2Bad
summary: Create new payment 2
description: |
TEST_CASE: VERSIONING_01_BAD_VERSION_IN_PATH_AND_NUMBERED_ACTION
Purpose: Tests whether numbered endpoints and path version duplication are flagged.
requestBody:
content:
application/json:
schema:
type: object
additionalProperties: true
responses:
'200':
description: OK
/payment_methods:
post:
tags: [Payments]
operationId: createPaymentMethod
summary: Create a payment method
description: |
TEST_CASE: SECURITY_01_GOOD_TOKENIZED_PAYMENT_METHOD
Purpose: Tests tokenized card input instead of raw sensitive payment data.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreatePaymentMethodRequest'
responses:
'201':
description: Payment method created
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentMethod'
default:
$ref: '#/components/responses/ErrorResponse'
/cards/save:
post:
tags: [Bad Patterns]
operationId: saveCardBad
summary: Save card
description: |
TEST_CASE: SECURITY_02_BAD_RAW_CARD_STORAGE
Purpose: Tests raw PAN/CVV modeling and unclear PCI boundaries.
requestBody:
content:
application/json:
schema:
type: object
required: [number, cvv, expiry]
properties:
number:
type: string
cvv:
type: string
expiry:
type: string
responses:
'200':
description: OK
/subscriptions:
post:
tags: [Orders]
operationId: createSubscription
summary: Create a subscription
description: |
TEST_CASE: ENUM_01_GOOD_ENUM_AND_LIFECYCLE
Purpose: Tests explicit enum values and lifecycle states.
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSubscriptionRequest'
responses:
'201':
description: Subscription created
content:
application/json:
schema:
$ref: '#/components/schemas/Subscription'
default:
$ref: '#/components/responses/ErrorResponse'
/makeSubscription:
post:
tags: [Bad Patterns]
operationId: makeSubscriptionBad
summary: Make subscription
description: |
TEST_CASE: ENUM_02_BAD_BOOLEAN_STATE_EXPLOSION
Purpose: Tests confusing booleans instead of lifecycle enum.
requestBody:
content:
application/json:
schema:
type: object
properties:
isActive:
type: boolean
isPaused:
type: boolean
isCanceled:
type: boolean
isTrial:
type: boolean
responses:
'200':
description: OK
/files:
post:
tags: [Reports]
operationId: uploadFile
summary: Upload a file
description: |
TEST_CASE: UPLOAD_01_GOOD_MULTIPART_LIMITS
Purpose: Tests documented content type and file size limits.
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
required: [purpose, file]
properties:
purpose:
type: string
enum: [dispute_evidence, identity_document]
file:
type: string
format: binary
description: Maximum size is 10 MB.
responses:
'201':
description: File uploaded
content:
application/json:
schema:
$ref: '#/components/schemas/FileObject'
default:
$ref: '#/components/responses/ErrorResponse'
/upload:
post:
tags: [Bad Patterns]
operationId: uploadBad
summary: Upload
description: |
TEST_CASE: UPLOAD_02_BAD_UNCLEAR_UPLOAD
Purpose: Tests unclear upload shape, no media type, no size limit, no purpose.
requestBody:
content:
application/octet-stream:
schema:
type: string
format: binary
responses:
'200':
description: OK
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: API key
description: Use a secret API key in the Authorization header.
parameters:
IdempotencyKey:
name: Idempotency-Key
in: header
required: false
description: Unique key used to safely retry mutating requests without creating duplicate objects.
schema:
type: string
maxLength: 255
Limit:
name: limit
in: query
required: false
description: Maximum number of objects to return. Default is 10. Maximum is 100.
schema:
type: integer
minimum: 1
maximum: 100
default: 10
StartingAfter:
name: starting_after
in: query
required: false
description: Cursor for pagination. Use the id of the last object from the previous page.
schema:
type: string
CreatedGte:
name: created[gte]
in: query
required: false
description: Return objects created at or after this Unix timestamp.
schema:
type: integer
format: int64
CustomerId:
name: customer_id
in: path
required: true
description: Unique identifier for the customer.
schema:
type: string
pattern: '^cus_[a-zA-Z0-9]+$'
example: cus_123
OrderId:
name: order_id
in: path
required: true
description: Unique identifier for the order.
schema:
type: string
pattern: '^ord_[a-zA-Z0-9]+$'
example: ord_123
responses:
ErrorResponse:
description: Error response
headers:
Request-Id:
description: Unique request id for support and debugging.
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorEnvelope'
examples:
invalidRequest:
value:
error:
type: invalid_request_error
code: missing_required_parameter
message: Missing required parameter: email.
param: email
request_id: req_123
schemas:
CreateCustomerRequest:
type: object
required: [email]
properties:
email:
type: string
format: email
description: Customer email address.
name:
type: string
maxLength: 200
metadata:
$ref: '#/components/schemas/Metadata'
UpdateCustomerRequest:
type: object
properties:
email:
type: string
format: email
name:
type: string
maxLength: 200
metadata:
$ref: '#/components/schemas/Metadata'
Customer:
type: object
required: [id, object, email, created, metadata]
properties:
id:
type: string
example: cus_123
object:
type: string
const: customer
email:
type: string
format: email
name:
type: string
nullable: true
created:
type: integer
format: int64
description: Unix timestamp when the object was created.
metadata:
$ref: '#/components/schemas/Metadata'
CustomerList:
allOf:
- $ref: '#/components/schemas/ListEnvelope'
- type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Customer'
CreatePaymentIntentRequest:
type: object
required: [amount, currency, customer_id]
properties:
amount:
type: integer
description: Amount in the smallest currency unit.
minimum: 1
currency:
type: string
minLength: 3
maxLength: 3
example: usd
customer_id:
type: string
example: cus_123
payment_method_id:
type: string
example: pm_123
capture_method:
type: string
enum: [automatic, manual]
default: automatic
metadata:
$ref: '#/components/schemas/Metadata'
PaymentIntent:
type: object
required: [id, object, amount, currency, status, created]
properties:
id:
type: string
example: pi_123
object:
type: string
const: payment_intent
amount:
type: integer
currency:
type: string
example: usd
status:
type: string
enum: [requires_payment_method, requires_confirmation, processing, succeeded, canceled]
created:
type: integer
format: int64
metadata:
$ref: '#/components/schemas/Metadata'
CreateRefundRequest:
type: object
required: [payment_intent_id, amount, currency]
properties:
payment_intent_id:
type: string
example: pi_123
amount:
type: integer
description: Refund amount in the smallest currency unit.
currency:
type: string
minLength: 3
maxLength: 3
example: usd
reason:
type: string
enum: [duplicate, fraudulent, requested_by_customer]
Refund:
type: object
required: [id, object, amount, currency, status, created]
properties:
id:
type: string
example: re_123
object:
type: string
const: refund
amount:
type: integer
currency:
type: string
status:
type: string
enum: [pending, succeeded, failed, canceled]
created:
type: integer
format: int64
Order:
type: object
required: [id, object, status, total_amount, currency, created]
properties:
id:
type: string
example: ord_123
object:
type: string
const: order
status:
type: string
enum: [open, paid, fulfilled, canceled]
total_amount:
type: integer
currency:
type: string
example: usd
customer_id:
type: string
created:
type: integer
format: int64
OrderList:
allOf:
- $ref: '#/components/schemas/ListEnvelope'
- type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Order'
BalanceReport:
type: object
required: [object, available, pending, as_of]
properties:
object:
type: string
const: balance_report
available:
$ref: '#/components/schemas/Money'
pending:
$ref: '#/components/schemas/Money'
as_of:
type: string
format: date-time
Money:
type: object
required: [amount, currency]
properties:
amount:
type: integer
description: Amount in the smallest currency unit.
currency:
type: string
minLength: 3
maxLength: 3
example: usd
CreateWebhookEndpointRequest:
type: object
required: [url, enabled_events]
properties:
url:
type: string
format: uri
enabled_events:
type: array
minItems: 1
items:
$ref: '#/components/schemas/EventType'
description:
type: string
WebhookEndpoint:
type: object
required: [id, object, url, enabled_events, status]
properties:
id:
type: string
example: wh_123
object:
type: string
const: webhook_endpoint
url:
type: string
format: uri
enabled_events:
type: array
items:
$ref: '#/components/schemas/EventType'
status:
type: string
enum: [enabled, disabled]
Event:
type: object
required: [id, object, type, created, data]
properties:
id:
type: string
example: evt_123
object:
type: string
const: event
type:
$ref: '#/components/schemas/EventType'
created:
type: integer
format: int64
data:
type: object
required: [object]
properties:
object:
oneOf:
- $ref: '#/components/schemas/PaymentIntent'
- $ref: '#/components/schemas/Refund'
- $ref: '#/components/schemas/Customer'
EventType:
type: string
enum:
- payment_intent.succeeded
- payment_intent.canceled
- refund.succeeded
- customer.created
- customer.updated
CreatePaymentMethodRequest:
type: object