generated from saleor/saleor-app-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
hyperswitch-payments.json
18377 lines (18377 loc) · 562 KB
/
hyperswitch-payments.json
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.0.3",
"info": {
"title": "Hyperswitch - API Documentation",
"description": "\n## Get started\n\nHyperswitch provides a collection of APIs that enable you to process and manage payments.\nOur APIs accept and return JSON in the HTTP body, and return standard HTTP response codes.\n\nYou can consume the APIs directly using your favorite HTTP/REST library.\n\nWe have a testing environment referred to \"sandbox\", which you can setup to test API calls without\naffecting production data.\nCurrently, our sandbox environment is live while our production environment is under development\nand will be available soon.\nYou can sign up on our Dashboard to get API keys to access Hyperswitch API.\n\n### Environment\n\nUse the following base URLs when making requests to the APIs:\n\n| Environment | Base URL |\n|---------------|------------------------------------|\n| Sandbox | <https://sandbox.hyperswitch.io> |\n| Production | <https://api.hyperswitch.io> |\n\n## Authentication\n\nWhen you sign up on our [dashboard](https://app.hyperswitch.io) and create a merchant\naccount, you are given a secret key (also referred as api-key) and a publishable key.\nYou may authenticate all API requests with Hyperswitch server by providing the appropriate key in\nthe request Authorization header.\n\n| Key | Description |\n|-----------------|-----------------------------------------------------------------------------------------------|\n| api-key | Private key. Used to authenticate all API requests from your merchant server |\n| publishable key | Unique identifier for your account. Used to authenticate API requests from your app's client |\n\nNever share your secret api keys. Keep them guarded and secure.\n",
"contact": {
"name": "Hyperswitch Support",
"url": "https://hyperswitch.io",
"email": "[email protected]"
},
"license": {
"name": "Apache-2.0"
},
"version": "0.1.0"
},
"servers": [
{
"url": "https://sandbox.hyperswitch.io",
"description": "Sandbox Environment"
}
],
"paths": {
"/payments": {
"post": {
"tags": ["Payments"],
"summary": "Payments - Create",
"description": "Payments - Create\n\n**Creates a payment object when amount and currency are passed.** This API is also used to create a mandate by passing the `mandate_object`.\n\nTo completely process a payment you will have to create a payment, attach a payment method, confirm and capture funds.\n\nDepending on the user journey you wish to achieve, you may opt to complete all the steps in a single request by attaching a payment method, setting `confirm=true` and `capture_method = automatic` in the *Payments/Create API* request or you could use the following sequence of API requests to achieve the same:\n\n1. Payments - Create\n\n2. Payments - Update\n\n3. Payments - Confirm\n\n4. Payments - Capture.\n\nUse the client secret returned in this API along with your publishable key to make subsequent API calls from your client",
"operationId": "Create a Payment",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsCreateRequest"
},
"examples": {
"Create a 3DS payment": {
"value": {
"amount": 6540,
"authentication_type": "three_ds",
"currency": "USD"
}
},
"Create a manual capture payment": {
"value": {
"amount": 6540,
"billing": {
"address": {
"city": "San Fransico",
"country": "US",
"first_name": "joseph",
"last_name": "Doe",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"state": "California",
"zip": "94122"
},
"phone": {
"country_code": "+91",
"number": "8056594427"
}
},
"currency": "USD",
"customer": {
"id": "cus_abcdefgh"
}
}
},
"Create a payment and save the card": {
"value": {
"amount": 6540,
"authentication_type": "no_three_ds",
"confirm": true,
"currency": "USD",
"customer_id": "StripeCustomer123",
"payment_method": "card",
"payment_method_data": {
"card": {
"card_cvc": "123",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_number": "4242424242424242"
}
},
"setup_future_usage": "off_session"
}
},
"Create a payment using an already saved card's token": {
"value": {
"amount": 6540,
"card_cvc": "123",
"client_secret": "{{client_secret}}",
"confirm": true,
"currency": "USD",
"payment_method": "card",
"payment_token": "{{payment_token}}"
}
},
"Create a payment with customer details and metadata": {
"value": {
"amount": 6540,
"currency": "USD",
"customer": {
"email": "[email protected]",
"id": "cus_abcdefgh",
"name": "John Dough",
"phone": "9999999999"
},
"description": "Its my first payment request",
"metadata": {
"udf1": "some-value",
"udf2": "some-value"
},
"payment_id": "abcdefghijklmnopqrstuvwxyz",
"statement_descriptor_name": "joseph",
"statement_descriptor_suffix": "JS"
}
},
"Create a payment with minimal fields": {
"value": {
"amount": 6540,
"currency": "USD"
}
},
"Create a recurring payment with mandate_id": {
"value": {
"amount": 6540,
"authentication_type": "no_three_ds",
"confirm": true,
"currency": "USD",
"customer_id": "StripeCustomer",
"mandate_id": "{{mandate_id}}",
"off_session": true
}
},
"Create a setup mandate payment": {
"value": {
"amount": 6540,
"authentication_type": "no_three_ds",
"confirm": true,
"currency": "USD",
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"customer_id": "StripeCustomer123",
"mandate_data": {
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"mandate_type": {
"single_use": {
"amount": 6540,
"currency": "USD"
}
}
},
"payment_method": "card",
"payment_method_data": {
"card": {
"card_cvc": "123",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_number": "4242424242424242"
}
},
"setup_future_usage": "off_session"
}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payment created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsResponse"
}
}
}
},
"400": {
"description": "Missing Mandatory fields"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/payments/{payment_id}": {
"post": {
"tags": ["Payments"],
"summary": "Payments - Update",
"description": "Payments - Update\n\nTo update the properties of a *PaymentIntent* object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created",
"operationId": "Update a Payment",
"parameters": [
{
"name": "payment_id",
"in": "path",
"description": "The identifier for payment",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsUpdateRequest"
},
"examples": {
"Update the payment amount": {
"value": {
"amount": 7654
}
},
"Update the shipping address": {
"value": {
"shipping": {
"address": {
"city": "San Fransico",
"country": "US",
"first_name": "joseph",
"last_name": "Doe",
"line1": "1467",
"line2": "Harrison Street",
"line3": "Harrison Street",
"state": "California",
"zip": "94122"
},
"phone": {
"country_code": "+91",
"number": "8056594427"
}
}
}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payment updated",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsResponse"
}
}
}
},
"400": {
"description": "Missing mandatory fields"
}
},
"security": [
{
"api_key": []
},
{
"publishable_key": []
}
]
},
"get": {
"tags": ["Payments"],
"summary": "Payments - Retrieve",
"description": "Payments - Retrieve\n\nRetrieves a Payment. This API can also be used to get the status of a previously initiated payment or next action for an ongoing payment",
"operationId": "Retrieve a Payment",
"parameters": [
{
"name": "payment_id",
"in": "path",
"description": "The identifier for payment",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentRetrieveBody"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Gets the payment with final status",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsResponse"
}
}
}
},
"404": {
"description": "No payment found"
}
},
"security": [
{
"api_key": []
},
{
"publishable_key": []
}
]
}
},
"/payments/{payment_id}/confirm": {
"post": {
"tags": ["Payments"],
"summary": "Payments - Confirm",
"description": "Payments - Confirm\n\n**Use this API to confirm the payment and forward the payment to the payment processor.**\n\nAlternatively you can confirm the payment within the *Payments/Create* API by setting `confirm=true`. After confirmation, the payment could either:\n\n1. fail with `failed` status or\n\n2. transition to a `requires_customer_action` status with a `next_action` block or\n\n3. succeed with either `succeeded` in case of automatic capture or `requires_capture` in case of manual capture",
"operationId": "Confirm a Payment",
"parameters": [
{
"name": "payment_id",
"in": "path",
"description": "The identifier for payment",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsConfirmRequest"
},
"examples": {
"Confirm a payment with payment method data": {
"value": {
"customer_acceptance": {
"acceptance_type": "offline",
"accepted_at": "1963-05-03T04:07:52.723Z",
"online": {
"ip_address": "127.0.0.1",
"user_agent": "amet irure esse"
}
},
"payment_method": "card",
"payment_method_data": {
"card": {
"card_cvc": "123",
"card_exp_month": "10",
"card_exp_year": "25",
"card_holder_name": "joseph Doe",
"card_number": "4242424242424242"
}
},
"payment_method_type": "credit"
}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payment confirmed",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsResponse"
}
}
}
},
"400": {
"description": "Missing mandatory fields"
}
},
"security": [
{
"api_key": []
},
{
"publishable_key": []
}
]
}
},
"/payments/{payment_id}/capture": {
"post": {
"tags": ["Payments"],
"summary": "Payments - Capture",
"description": "Payments - Capture\n\nTo capture the funds for an uncaptured payment",
"operationId": "Capture a Payment",
"parameters": [
{
"name": "payment_id",
"in": "path",
"description": "The identifier for payment",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsCaptureRequest"
},
"examples": {
"Capture partial amount": {
"value": {
"amount_to_capture": 654
}
},
"Capture the full amount": {
"value": {}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payment captured",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsResponse"
}
}
}
},
"400": {
"description": "Missing mandatory fields"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/payments/session_tokens": {
"post": {
"tags": ["Payments"],
"summary": "Payments - Session token",
"description": "Payments - Session token\n\nCreates a session object or a session token for wallets like Apple Pay, Google Pay, etc. These tokens are used by Hyperswitch's SDK to initiate these wallets' SDK.",
"operationId": "Create Session tokens for a Payment",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsSessionRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payment session object created or session token was retrieved from wallets",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsSessionResponse"
}
}
}
},
"400": {
"description": "Missing mandatory fields"
}
},
"security": [
{
"publishable_key": []
}
]
}
},
"/payments/{payment_id}/cancel": {
"post": {
"tags": ["Payments"],
"summary": "Payments - Cancel",
"description": "Payments - Cancel\n\nA Payment could can be cancelled when it is in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_customer_action`.",
"operationId": "Cancel a Payment",
"parameters": [
{
"name": "payment_id",
"in": "path",
"description": "The identifier for payment",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsCancelRequest"
},
"examples": {
"Cancel the payment with cancellation reason": {
"value": {
"cancellation_reason": "requested_by_customer"
}
},
"Cancel the payment with minimal fields": {
"value": {}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payment canceled"
},
"400": {
"description": "Missing mandatory fields"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/payments/list": {
"get": {
"tags": ["Payments"],
"summary": "Payments - List",
"description": "Payments - List\n\nTo list the *payments*",
"operationId": "List all Payments",
"parameters": [
{
"name": "customer_id",
"in": "query",
"description": "The identifier for the customer",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "starting_after",
"in": "query",
"description": "A cursor for use in pagination, fetch the next list after some object",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "ending_before",
"in": "query",
"description": "A cursor for use in pagination, fetch the previous list before some object",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "limit",
"in": "query",
"description": "Limit on the number of objects to return",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
},
{
"name": "created",
"in": "query",
"description": "The time at which payment is created",
"required": true,
"schema": {
"type": "string",
"format": "date-time"
}
},
{
"name": "created_lt",
"in": "query",
"description": "Time less than the payment created time",
"required": true,
"schema": {
"type": "string",
"format": "date-time"
}
},
{
"name": "created_gt",
"in": "query",
"description": "Time greater than the payment created time",
"required": true,
"schema": {
"type": "string",
"format": "date-time"
}
},
{
"name": "created_lte",
"in": "query",
"description": "Time less than or equals to the payment created time",
"required": true,
"schema": {
"type": "string",
"format": "date-time"
}
},
{
"name": "created_gte",
"in": "query",
"description": "Time greater than or equals to the payment created time",
"required": true,
"schema": {
"type": "string",
"format": "date-time"
}
}
],
"responses": {
"200": {
"description": "Successfully retrieved a payment list",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/PaymentListResponse"
}
}
}
}
},
"404": {
"description": "No payments found"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/payments/{payment_id}/incremental_authorization": {
"post": {
"tags": ["Payments"],
"summary": "Payments - Incremental Authorization",
"description": "Payments - Incremental Authorization\n\nAuthorized amount for a payment can be incremented if it is in status: requires_capture",
"operationId": "Increment authorized amount for a Payment",
"parameters": [
{
"name": "payment_id",
"in": "path",
"description": "The identifier for payment",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsIncrementalAuthorizationRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payment authorized amount incremented",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsResponse"
}
}
}
},
"400": {
"description": "Missing mandatory fields"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/payment_link/{payment_link_id}": {
"get": {
"tags": ["Payments"],
"summary": "Payments Link - Retrieve",
"description": "Payments Link - Retrieve\n\nTo retrieve the properties of a Payment Link. This may be used to get the status of a previously initiated payment or next action for an ongoing payment",
"operationId": "Retrieve a Payment Link",
"parameters": [
{
"name": "payment_link_id",
"in": "path",
"description": "The identifier for payment link",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RetrievePaymentLinkRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Gets details regarding payment link",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RetrievePaymentLinkResponse"
}
}
}
},
"404": {
"description": "No payment link found"
}
},
"security": [
{
"api_key": []
},
{
"publishable_key": []
}
]
}
},
"/payments/{payment_id}/3ds/authentication": {
"post": {
"tags": ["Payments"],
"summary": "Payments - External 3DS Authentication",
"description": "Payments - External 3DS Authentication\n\nExternal 3DS Authentication is performed and returns the AuthenticationResponse",
"operationId": "Initiate external authentication for a Payment",
"parameters": [
{
"name": "payment_id",
"in": "path",
"description": "The identifier for payment",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsExternalAuthenticationRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Authentication created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsExternalAuthenticationResponse"
}
}
}
},
"400": {
"description": "Missing mandatory fields"
}
},
"security": [
{
"publishable_key": []
}
]
}
},
"/{payment_id}/complete_authorize": {
"post": {
"tags": ["Payments"],
"summary": "Payments - Complete Authorize",
"description": "Payments - Complete Authorize\n\n",
"operationId": "Complete Authorize a Payment",
"parameters": [
{
"name": "payment_id",
"in": "path",
"description": "The identifier for payment",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsCompleteAuthorizeRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Payments Complete Authorize Success",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PaymentsResponse"
}
}
}
},
"400": {
"description": "Missing mandatory fields"
}
},
"security": [
{
"publishable_key": []
}
]
}
},
"/refunds": {
"post": {
"tags": ["Refunds"],
"summary": "Refunds - Create",
"description": "Refunds - Create\n\nCreates a refund against an already processed payment. In case of some processors, you can even opt to refund only a partial amount multiple times until the original charge amount has been refunded",
"operationId": "Create a Refund",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RefundRequest"
},
"examples": {
"Create an instant refund to refund partial amount": {
"value": {
"amount": 654,
"payment_id": "{{payment_id}}",
"refund_type": "instant"
}
},
"Create an instant refund to refund the whole amount": {
"value": {
"payment_id": "{{payment_id}}",
"refund_type": "instant"
}
},
"Create an instant refund with reason": {
"value": {
"amount": 6540,
"payment_id": "{{payment_id}}",
"reason": "Customer returned product",
"refund_type": "instant"
}
}
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Refund created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RefundResponse"
}
}
}
},
"400": {
"description": "Missing Mandatory fields"
}
},
"security": [
{
"api_key": []
}
]
}
},
"/refunds/{refund_id}": {
"get": {
"tags": ["Refunds"],
"summary": "Refunds - Retrieve",
"description": "Refunds - Retrieve\n\nRetrieves a Refund. This may be used to get the status of a previously initiated refund",
"operationId": "Retrieve a Refund",
"parameters": [
{
"name": "refund_id",
"in": "path",
"description": "The identifier for refund",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Refund retrieved",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RefundResponse"
}
}
}
},
"404": {
"description": "Refund does not exist in our records"
}
},
"security": [
{
"api_key": []
}
]
},
"post": {
"tags": ["Refunds"],
"summary": "Refunds - Update",
"description": "Refunds - Update\n\nUpdates the properties of a Refund object. This API can be used to attach a reason for the refund or metadata fields",
"operationId": "Update a Refund",
"parameters": [
{
"name": "refund_id",
"in": "path",
"description": "The identifier for refund",
"required": true,
"schema": {
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {