-
Notifications
You must be signed in to change notification settings - Fork 132
/
VTEX - Antifraud Provider API.json
1539 lines (1539 loc) · 71.3 KB
/
VTEX - Antifraud Provider API.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.0",
"info": {
"title": "Anti-fraud Provider API",
"description": ">ℹ️ Onboarding guide\r\n>\r\n> Check the new [Payments onboarding guide](https://developers.vtex.com/docs/guides/payments-overview). We created this guide to improve the onboarding experience for developers at VTEX. It assembles all documentation on our Developer Portal about Payments and is organized by focusing on the developer's journey.\r\n\r\nThe Anti-fraud Provider Protocol is a set of definitions to help you integrate your anti-fraud service API into VTEX platform.\r\n\r\nTo achieve this, you need to implement a web API (REST) following the specifications described in this documentation.\r\n\r\n>⚠️ You can also access our [template on GitHub](https://github.com/vtex-apps/antifraud-provider-example) to help you quickly develop your anti-fraud connector using the Anti-fraud Provider Protocol and VTEX IO.\r\n\r\nTo learn more about the Anti-fraud Provider Protocol, check our [developer guide](https://developers.vtex.com/docs/guides/how-the-integration-protocol-between-vtex-and-antifraud-companies-works).\r\n\r\n## Anti-fraud Provider API Index\r\n\r\n### Anti-fraud Flow\r\n\r\n- `POST` [Send anti-fraud pre-analysis data (optional)](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/pre-analysis)\r\n- `POST` [Send anti-fraud data](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/transactions)\r\n- `PUT` [Update anti-fraud transactions (optional)](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#put-/transactions/-transactionId-)\r\n- `GET` [List anti-fraud provider manifest](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/manifest)\r\n- `GET` [Get anti-fraud status](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/transactions/-transactions.id-)\r\n- `DELETE` [Stop anti-fraud analysis (optional)](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#delete-/transactions/-transactions.Id-)\r\n\r\n### OAuth Flow\r\n\r\n1. `POST` [Retrieve token](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/authorization/token)\r\n2. `GET` [Redirect](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/redirect)\r\n3. `GET` [Return to VTEX](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/authorizationCode)\r\n4. `GET` [Get credentials](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#get-/authorization/credentials)",
"version": "1.0"
},
"servers": [
{
"url": "https://{providerApiEndpoint}",
"description": "Anti-fraud provider endpoint URL.",
"variables": {
"providerApiEndpoint": {
"description": "Anti-fraud provider endpoint URL.",
"default": "{providerApiEndpoint}"
}
}
}
],
"paths": {
"/pre-analysis": {
"post": {
"tags": [
"Anti-fraud Flow"
],
"summary": "Send anti-fraud pre-analysis data (optional)",
"description": "Receives a new transaction anti-fraud data for (synchronous) pre-analysis. This step is performed before payments authorization.\r\n\r\n>⚠️ This endpoint can only be used if your anti-fraud provider already has the pre-analysis function configured within VTEX. To check if it is already configured, in the VTEX Admin, go to **Store Settings > Payment > Providers**, click the name of your anti-fraud provider, and verify if the **Enable Risk Pre-Analysis** field is available to be selected. If the **Enable Risk Pre-Analysis** field is not available, check with your anti-fraud provider if this feature is available in their integration and open a ticket in our [VTEX Support](https://help.vtex.com/en/support) to update the connector.\r\n\r\n>⚠️ The pre-analysis does not exclude the need for full analysis after payments authorization.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "SendAntifraudPreAnalysisData",
"parameters": [
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppKey"
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppToken"
},
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/Accept"
}
],
"security": [
{
"VtexIdclientAutCookie": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SendAntifraudDataRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SendAntifraudData"
},
"example": {
"id": "D3AA1FC8372E430E8236649DB5EBD08E",
"tid": "4692c1f54d514fe69da0b472a3b2a770",
"code": "customCode",
"message": "customMessage",
"status": "approved",
"score": 5.01,
"analysisType": "automatic",
"responses": {
"foo": "anyFoo",
"custom": "customAnyValue"
}
}
}
}
}
}
}
},
"/transactions": {
"post": {
"tags": [
"Anti-fraud Flow"
],
"summary": "Send anti-fraud data",
"description": "Receives a new transaction anti-fraud data. This step is performed only if all payments are authorized.\r\n\r\nVTEX expects that your anti-fraud provider process this request and retrieves the process result. After that, the VTEX order flow will check the response status to cancel or approve the transaction.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "SendAntifraudData",
"parameters": [
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppKey"
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppToken"
},
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/Accept"
}
],
"security": [
{
"VtexIdclientAutCookie": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SendAntifraudDataRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SendAntifraudData"
},
"example": {
"id": "D3AA1FC8372E430E8236649DB5EBD08E",
"tid": "4692c1f54d514fe69da0b472a3b2a770",
"code": "customCode",
"message": "customMessage",
"status": "approved",
"score": 5.01,
"analysisType": "automatic",
"responses": {
"foo": "anyFoo",
"custom": "customAnyValue"
}
}
}
}
}
}
}
},
"/transactions/{transactionId}": {
"put": {
"tags": [
"Anti-fraud Flow"
],
"summary": "Update anti-fraud transactions (optional)",
"description": "Receives a new transaction anti-fraud data. This step is performed only if all payments are authorized.\r\n\r\nVTEX expects that your anti-fraud provider process this request and retrieves the process result. After that, the VTEX order flow will check the response status to cancel or approve the transaction.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "UpdateAntifraudTransactions(optional)",
"parameters": [
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppKey"
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppToken"
},
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/Accept"
},
{
"$ref": "#/components/parameters/transactions.Id"
}
],
"security": [
{
"VtexIdclientAutCookie": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateAntifraudTransactionsoptionalRequest"
},
"example": {
"id": "D3AA1FC8372E430E8236649DB5EBD08E",
"reference": "v32478982vtx-01",
"value": 10,
"ip": "10.0.0.1",
"store": "serasa",
"deviceFingerprint": "Generated_using_GTM_Store_Is_Responsible_To_Configure",
"miniCart": {
"buyer": {
"id": "c1245228-1c68-11e6-94ac-0afa86a846a5",
"firstName": "John",
"lastName": "Doe",
"document": "012.345.678-90",
"documentType": "CPF",
"email": "[email protected]",
"phone": "+5521987654321",
"address": {
"country": "BRA",
"street": "Rua Praia de Botafogo",
"number": "518",
"complement": "2o. andar",
"neighborhood": "Botafogo",
"postalCode": "22250-040",
"city": "Rio de Janeiro",
"state": "RJ"
}
},
"shipping": {
"value": 8.41,
"estimatedDate": "2017-08-02T14:46:47",
"address": {
"country": "BRA",
"street": "Rua Praia de Botafogo",
"number": "518",
"complement": "2o. andar",
"neighborhood": "Botafogo",
"postalCode": "22250-040",
"city": "Rio de Janeiro",
"state": "RJ"
}
},
"items": [
{
"id": "132981",
"name": "Some useful product",
"price": 20.51,
"quantity": 2,
"deliveryType": "Normal",
"deliverySlaInMinutes": 4320,
"categoryId": "111",
"categoryName": "Electronica",
"discount": 1.99,
"sellerId": "vtexargentina"
},
{
"id": "123242",
"name": "Some useless product",
"price": 21.98,
"quantity": 1,
"deliveryType": "Normal",
"deliverySlaInMinutes": 4320,
"categoryId": "123",
"categoryName": "Lar",
"discount": 1.01,
"sellerId": "vtexargentina"
}
],
"taxValue": 5.58,
"listRegistry": {
"name": "Minha lista Presente",
"deliveryToOwner": false
}
},
"payments": [
{
"id": "2D00FE",
"method": "CreditCard",
"name": "Visa",
"value": 63.98,
"currencyIso4217": "BRL",
"installments": 3,
"details": {
"bin": "507860",
"lastDigits": "2798",
"holder": "John Doe",
"address": {
"country": "BRA",
"street": "Rua Praia de Botafogo",
"number": "518",
"complement": "2o. andar",
"neighborhood": "Botafogo",
"postalCode": "22250-040",
"city": "Rio de Janeiro",
"state": "RJ"
}
}
},
{
"id": "04D430E517B2494FBC3DF7721CCDACC7",
"method": "GiftCard",
"value": 10.01,
"currencyIso4217": "BRL",
"installments": 1
}
],
"hook": "https://hook.vtex.com/notifyIfChangeStatus"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApproveAntifraudAnalysisResponse"
},
"example": {
"id": "D3AA1FC8372E430E8236649DB5EBD08E",
"status": "approved",
"fraudRiskPercentage": 0.0,
"analysisType": "automatic",
"responses": null
}
}
}
}
}
}
},
"/manifest": {
"get": {
"tags": [
"Anti-fraud Flow"
],
"summary": "List anti-fraud provider manifest",
"description": "Returns the custom fields of the anti-fraud provider manifest.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [authentication](https:\/\/developers.vtex.com\/docs\/guides\/authentication) or [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "Manifest",
"security": [],
"parameters": [
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/Accept"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Success"
},
"example": {
"cardholderDocument": "required",
"allowAntifraudOnGiftCard": true,
"customFields": [
{
"name": "AnalysisMode",
"type": "text"
},
{
"name": "Client secret",
"type": "password"
},
{
"name": "AnalysisLocation",
"type": "select",
"options": [
{
"text": "MEX",
"value": "Latin America"
},
{
"text": "USA",
"value": "United States"
}
]
}
]
}
}
}
}
}
}
},
"/transactions/{transactions.id}": {
"get": {
"tags": [
"Anti-fraud Flow"
],
"summary": "Get anti-fraud status",
"description": "Retrieves the anti-fraud analysis status. This request is performed every two hours up to 5 days. After 5 days in `undefined` status, the order will expire and be cancelled.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "GetAntifraudStatus",
"parameters": [
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppKey"
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppToken"
},
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/Accept"
},
{
"$ref": "#/components/parameters/transactions.Id"
}
],
"security": [
{
"VtexIdclientAutCookie": []
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GetAntifraudStatus"
},
"example": {
"id": "BF900B7CB15147F98D91208989100A05",
"tid": "3146f46162f042f483cd3979ba4e8317",
"status": "approved",
"fraudRiskPercentage": 5.01,
"analysisType": "automatic",
"responses": {
"foo": "anyFoo",
"custom": "customAnyValue"
}
}
}
}
}
}
}
},
"/transactions/{transactions.Id}": {
"delete": {
"tags": [
"Anti-fraud Flow"
],
"summary": "Stop anti-fraud analysis (optional)",
"description": "Notifies whether the order has been canceled by the store or the buyer before completing the anti-fraud analysis status.\r\n\r\n This endpoint is not mandatory for the antifraud flow to work. Check this [developer guide](https://developers.vtex.com/docs/guides/how-the-integration-protocol-between-vtex-and-antifraud-companies-works) for more details.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "StopAntifraudAnalysis(optional)",
"parameters": [
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppKey"
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppToken"
},
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/Accept"
},
{
"$ref": "#/components/parameters/transactions.Id"
}
],
"security": [
{
"VtexIdclientAutCookie": []
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/GetPaymentMethodsSupported"
}
},
"example": [
{
"name": "CreditCard"
},
{
"name": "DebitCard"
},
{
"name": "GiftCard"
},
{
"name": "BankIssueInvoice"
},
{
"name": "Voucher"
},
{
"name": "Promissory"
}
]
}
}
}
}
}
},
"/authorization/token": {
"post": {
"tags": [
"OAuth Flow"
],
"summary": "1. Retrieve token",
"description": "This endpoint is used to retrieve a payment provider token.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "1.RetrieveToken",
"parameters": [
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppKey"
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppToken"
},
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/Accept"
}
],
"security": [
{
"VtexIdclientAutCookie": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/1.RetrieveTokenRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/1.RetrieveToken"
},
"example": {
"applicationId": "vtex",
"token": "358a5bea-07d0-4122-888a-54ab70b5f02f"
}
}
}
}
}
}
},
"/redirect": {
"get": {
"tags": [
"OAuth Flow"
],
"summary": "2. Redirect",
"description": "Through this endpoint, VTEX will redirect the store administrator to the Payment provider website using the `token` retrieved in the [previous request](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/authorization/token).\r\n\r\nAt this point in the flow, the provider shows the login site to the store admin and authorizes VTEX to use its integration as a valid Payment Provider Processor. After that, your server generates an `authorizationCode`.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "2.Redirect",
"parameters": [
{
"name": "token",
"in": "query",
"description": "Token information.",
"required": true,
"style": "form",
"schema": {
"type": "string",
"example": "{token}"
}
},
{
"name": "applicationId",
"in": "query",
"description": "VTEX application identifier.",
"required": true,
"style": "form",
"schema": {
"type": "string",
"example": "vtex"
}
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppKey"
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppToken"
},
{
"$ref": "#/components/parameters/Content-Type"
},
{
"$ref": "#/components/parameters/Accept"
}
],
"security": [
{
"VtexIdclientAutCookie": []
}
],
"responses": {
"200": {
"description": "OK. This endpoint does not return any data in the response body."
}
}
}
},
"/authorizationCode": {
"get": {
"tags": [
"OAuth Flow"
],
"summary": "3. Return to VTEX",
"description": "Through this endpoint, the provider will redirect the store administrator to the VTEX website using the `returnUrl` passed from VTEX to create token.\r\n\r\nThe `returnUrl` must be filled with your query string **authorizationCode**.\r\n\r\nExample:\r\n\r\nIf you receive the following URL:\r\n\r\n`https://store.vtex.com/return?authorizationCode=&otherparams...`\r\n\r\nand your **authorizationCode** is `pro2018`. Then, you redirect the store administrator to: `https://store.vtex.com/return?authorizationCode=pro2018&otherparams...`.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "3.ReturntoVTEX",
"parameters": [
{
"name": "providerAuthorizationCode",
"in": "query",
"description": "Provider authorization code information.",
"required": true,
"style": "form",
"explode": true,
"schema": {
"type": "string",
"example": "{providerAuthorizationCode}"
}
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppKey"
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppToken"
}
],
"security": [
{
"VtexIdclientAutCookie": []
}
],
"responses": {
"200": {
"description": "OK. This endpoint does not return any data in the response body."
}
}
}
},
"/authorization/credentials": {
"get": {
"tags": [
"OAuth Flow"
],
"summary": "4. Get credentials",
"description": "Retrieves merchant credentials.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [permissions](https:\/\/help.vtex.com\/en\/tutorial\/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).",
"operationId": "4.GetCredentials",
"parameters": [
{
"name": "authorizationCode",
"in": "query",
"description": "Code generate by affiliation that will be used to identify the merchant authorization.",
"required": true,
"style": "form",
"explode": true,
"schema": {
"type": "string",
"example": "{authorizationCode}"
}
},
{
"name": "applicationId",
"in": "query",
"description": "VTEX application identifier.",
"required": true,
"style": "form",
"explode": true,
"schema": {
"type": "string",
"example": "vtex"
}
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppKey"
},
{
"$ref": "#/components/parameters/X-PROVIDER-API-AppToken"
}
],
"security": [
{
"VtexIdclientAutCookie": []
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/3.GetCredentials"
},
"example": {
"applicationId": "vtex",
"appKey": "c5a5e3f1-4a77-4a00-8b53-0d1adb3e9628",
"appToken": "57ea254d-f3d3-488d-88d7-129766037ed1"
}
}
}
}
},
"deprecated": false
}
}
},
"components": {
"securitySchemes": {
"VtexIdclientAutCookie": {
"type": "apiKey",
"in": "header",
"name": "VtexIdclientAutCookie",
"description": "[User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours."
}
},
"parameters": {
"X-PROVIDER-API-AppKey": {
"name": "X-PROVIDER-API-AppKey",
"in": "header",
"description": "Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX).",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "{{X-PROVIDER-API-AppKey}}"
}
},
"X-PROVIDER-API-AppToken": {
"name": "X-PROVIDER-API-AppToken",
"in": "header",
"description": "Unique token created by the provider and configured on the provider configuration page (Admin VTEX).",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "{{X-PROVIDER-API-AppToken}}"
}
},
"Content-Type": {
"name": "Content-Type",
"in": "header",
"description": "Type of the content being sent.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
"Accept": {
"name": "Accept",
"in": "header",
"description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "application/json"
}
},
"transactions.Id": {
"name": "transactions.Id",
"in": "path",
"description": "VTEX transaction ID. This parameter is the same `id` sent in the request body of the [Send Anti-fraud Data endpoint](https://developers.vtex.com/docs/api-reference/antifraud-provider-protocol#post-/transactions).",
"required": true,
"style": "simple",
"schema": {
"type": "string",
"example": "D3AA1FC8372E430E8236649DB5EBD08E"
}
}
},
"schemas": {
"Success": {
"required": [
"customFields"
],
"type": "object",
"description": "Custom fields information.",
"properties": {
"cardholderDocument":{
"type": "string",
"description": "Indicates the requirement of cardholder document in card transactions. The field has three possible values: `required`, `optional`, or `unused`."
},
"allowAntifraudOnGiftCard":{
"type": "boolean",
"description": "Indicates whether the anti-fraud provider can process payment transactions made using [gift cards](https://developers.vtex.com/docs/guides/gift-card-integration-guide)."
},
"customFields": {
"type": "array",
"description": "Describes the customized fields supported by the connector.",
"items": {
"type": "object",
"description": "Custom fields information.",
"properties": {
"name": {
"type": "string",
"description": "Custom field name."
},
"type": {
"type": "string",
"description": "Custom field type. Sensitive or security data should be defined as `password`.",
"enum": ["text", "password", "select"]
},
"options": {
"type": "array",
"description": "In case of `select` type, the possible params are `text` and `value`.",
"items": {
"type": "object",
"description": "Custom field information.",
"properties": {
"text": {
"type": "string",
"description": "Custom field description."
},
"value": {
"type": "string",
"description": "Custom field value."
}
}
}
}
}
}
}
}
},
"SendAntifraudDataRequest": {
"required": [
"id",
"reference",
"value",
"ip",
"store",
"deviceFingerprint",
"miniCart",
"payments",
"sellerId",
"hook",
"transactionStartDate"
],
"type": "object",
"description": "Anti-fraud data information.",
"properties": {
"id": {
"type": "string",
"description": "VTEX transaction ID. The ID of the transaction related with this payment.",
"example": "D3AA1FC8372E430E8236649DB5EBD08E"
},
"reference": {
"type": "string",
"description": "VTEX order reference key. The key of the order (from VTEX Orders system) related with this payment.",
"example": "vtexargentina"
},
"value": {
"type": "integer",
"description": "VTEX transaction order value.",
"example": 10
},
"ip": {
"type": "string",
"description": "Original IP address from browser.",
"example": "10.0.0.1"
},
"store": {
"type": "string",
"description": "Store name. This is the same name used to access the store Admin via URL.",
"example": "serasa"
},
"deviceFingerprint": {
"type": "string",
"description": "Device fingerprint generated by the provider. This is generated by using Google Tag Manager that the provider implements. This field is optional, is sent only if received.",
"example": "Generated_using_GTM_Store_Is_Responsible_To_Configure"
},
"miniCart": {
"$ref": "#/components/schemas/MiniCart"
},
"payments": {
"$ref": "#/components/schemas/Payment"
},
"hook": {
"type": "string",
"description": "URL to be called when the payment status changes. For more information, see [Authorization and Callback URL](https://developers.vtex.com/docs/guides/payments-integration-purchase-flows#authorization).",
"example": "https://hook.vtex.com/notifyIfChangeStatus"
},
"transactionStartDate": {
"type": "string",
"description": "Date and time when the transaction started, in ISO 8601 format.",
"example": "2020-10-30T18:08:23Z"
},
"merchantSettings": {
"type": "array",
"description": "Custom fields (for the given Provider) which the Merchant must fill. Each element of this array is a key-value pair.",
"items": {
"type": "object",
"description": "Items information.",
"required": [
"name",
"value"
],
"properties": {
"name": {
"type": "string",
"description": "Custom field name.",
"example": "Country"
},
"value": {
"type": "string",
"description": "Custom field name.",
"example": "BRL"
}
}
}
}
}
},
"MiniCart": {
"description": "Minicart information.",
"required": [
"buyer",
"shipping",
"items",
"taxValue",
"listRegistry"
],
"type": "object",
"properties": {
"buyer": {
"$ref": "#/components/schemas/Buyer"
},
"shipping": {
"$ref": "#/components/schemas/Shipping"
},
"items": {
"type": "array",
"description": "Items information.",
"items": {
"$ref": "#/components/schemas/Item"
}
},
"taxValue": {
"type": "number",
"description": "Total tax value.",
"example": 5.58
},
"listRegistry": {
"$ref": "#/components/schemas/ListRegistry"
}
}
},
"Buyer": {
"description": "Buyer information.",
"required": [
"id",
"firstName",
"lastName",
"document",
"documentType",
"email",
"phone",
"address"
],
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "VTEX buyer ID. The unique identifier of the buyer.",
"example": "c1245228-1c68-11e6-94ac-0afa86a846a5"
},
"firstName": {
"type": "string",
"description": "First name of the buyer.",
"example": "John"
},
"lastName": {
"type": "string",
"description": "Last name of the buyer.",
"example": "Doe"
},
"document": {
"type": "string",
"description": "Document number of the buyer.",
"example": "012.345.678-90"
},
"documentType": {
"type": "string",
"description": "Type of document of the buyer, which depends on their country.",
"example": "CPF"
},
"email": {
"type": "string",
"description": "Email of the buyer.",