forked from vtex/openapi-schemas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VTEX - Payment Provider Protocol.json
3871 lines (3871 loc) · 232 KB
/
VTEX - Payment Provider Protocol.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": "Payment Provider Protocol API",
"description": ">ℹ️ The Payment Provider Protocol is a set of definitions to help you integrate your payment processing API into the VTEX platform, including sub-acquirers, acquirers, gateways, and custom payment services. \r\n\r\nTo achieve this, you must implement a web API (REST) following the specifications described in this documentation.\r\n\r\nTo learn more about the Payment Provider Protocol, check our [Help Center article](https://help.vtex.com/en/tutorial/payment-provider-protocol--RdsT2spdq80MMwwOeEq0m).\r\n\r\n## Endpoint requirements\r\n\r\n * Must use a standard subdomain/domain name, not an IP address.\r\n * Must be served over HTTPS on port 443 with TLS 1.2 support.\r\n * Must respond in less than 5 seconds when running the tests.\r\n * Must respond in less than 20 seconds when in production.\r\n * Must be [PCI-DSS compliant](https://developers.vtex.com/docs/guides/payments-integration-pci-dss-compliance) or use [Secure Proxy](https://developers.vtex.com/docs/guides/payments-integration-secure-proxy) to accept branded cards like Visa, Mastercard, Amex, etc.\r\n\r\n## Testing\r\n\r\nYou can perform tests on your payment provider using our [VTEX - Payment Provider Test Suite](https://apps.vtex.com/vtex-payment-provider-test-suite/p).\r\n\r\n>\u2139 An extra header `X-VTEX-API-Is-TestSuite` = `true` will be sent for every test suite request, to help you easily identify it and mock any required scenarios.\r\n\r\nFor more details about testing a Payment Provider, check our [Payment Provider Homologation](https://developers.vtex.com/docs/guides/payments-integration-payment-provider-homologation) article.\r\n\r\n## Common parameters in the documentation\r\n\r\n<table>\r\n <tr>\r\n <td><code>{{providerApiEndpoint}}</code></td>\r\n <td>Provider's endpoint for the implementation.</td>\r\n </tr>\r\n <tr>\r\n <td><code>{{X-PROVIDER-API-AppKey}}</code></td>\r\n <td>Unique identifier created by the provider and configured on the provider configuration page (Admin VTEX).</td>\r\n </tr>\r\n <tr>\r\n <td><code>{{X-PROVIDER-API-AppToken}}</code></td>\r\n <td>Unique token created by the provider and configured on the provider configuration page (Admin VTEX).</td>\r\n </tr>\r\n</table> \r\n\r\n## Payment Provider Protocol API Index\r\n\r\n### Payment Flow\r\n\r\n- `GET` [List Payment Provider Manifest](https:\/\/developers.vtex.com\/docs\/api-reference\/payment-provider-protocol#get-\/manifest)\r\n- `POST` [Create payment](https:\/\/developers.vtex.com\/docs\/api-reference\/payment-provider-protocol#post-\/payments)\r\n- `POST` [Cancel payment](https:\/\/developers.vtex.com\/docs\/api-reference\/payment-provider-protocol#post-\/payments\/-paymentId-\/cancellations)\r\n- `POST` [Settle payment](https:\/\/developers.vtex.com\/docs\/api-reference\/payment-provider-protocol#post-\/payments\/-paymentId-\/settlements)\r\n- `POST` [Refund payment](https:\/\/developers.vtex.com\/docs\/api-reference\/payment-provider-protocol#post-\/payments\/-paymentId-\/refunds)\r\n- `POST` [Inbound request (BETA)](https:\/\/developers.vtex.com\/docs\/api-reference\/payment-provider-protocol#post-\/payments\/-paymentId-\/inbound-request\/-action-)\r\n\r\n### Configuration Flow\r\n\r\n- `POST` [Create authorization token](https:\/\/developers.vtex.com\/docs\/api-reference\/payment-provider-protocol#post-\/authorization\/token)\r\n- `GET` [Provider authentication](https:\/\/developers.vtex.com\/docs\/api-reference\/payment-provider-protocol#get-\/authorization\/redirect)\r\n- `GET` [Get credentials](https:\/\/developers.vtex.com\/docs\/api-reference\/payment-provider-protocol#get-\/authorization\/credentials)",
"version": "1.0"
},
"servers": [
{
"url": "https://{providerApiEndpoint}",
"description": "Payment provider endpoint URL.",
"variables": {
"providerApiEndpoint": {
"description": "Payment provider endpoint URL.",
"default": "{providerApiEndpoint}"
}
}
}
],
"paths": {
"/manifest": {
"get": {
"tags": [
"Payment Flow"
],
"summary": "List Payment Provider Manifest",
"description": "Exposes the provider manifest, including metadata settings such as payment methods, split configuration, and custom fields.\r\n\r\n> ℹ️ This request is made from VTEX to the payment provider.\r\n\r\n## Available payment methods\r\n\r\n<table>\r\n <tr>\r\n <th>Payment Method<\/th>\r\n <th>Type<\/th>\r\n <th>Country<\/th>\r\n <\/tr>\r\n <tr>\r\n <td><code>Visa<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Mastercard<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>American Express<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Discover<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>JCB<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Diners<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Elo<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Brazil<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Hipercard<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Brazil<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Aura<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Brazil<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Banricompras<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Brazil<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Credz<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Brazil<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Cabal<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>Argentina, Brazil, Uruguay, Paraguay<\/td>\r\n <\/tr>\r\n <td><code>Cartes Bancaires (CB)<\/code><\/td>\r\n <td>Credit Card<\/td>\r\n <td>France<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>VirtualDebitElo<\/code><\/td>\r\n <td>Debit Card<\/td>\r\n <td>Brazil<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Visa Electron<\/code><\/td>\r\n <td>Debit Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Maestro<\/code><\/td>\r\n <td>Debit Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Mastercard Debit<\/code><\/td>\r\n <td>Debit Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>D\u00E9bito Online<\/code><\/td>\r\n <td>Debit Card<\/td>\r\n <td>Brazil<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Cobranded<\/code><\/td>\r\n <td>Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Privatelabels<\/code><\/td>\r\n <td>Card<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Promissories<\/code><\/td>\r\n <td>Generic<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Cash<\/code><\/td>\r\n <td>Generic<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Pix<\/code><\/td>\r\n <td>Online Transfer<\/td>\r\n <td>Brazil<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Safetypay<\/code><\/td>\r\n <td>Online Transfer<\/td>\r\n <td>Americas and Europe<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>BankInvoice<\/code><\/td>\r\n <td>Offline\/Voucher<\/td>\r\n <td>Brazil (Boleto Banc\u00E1rio)<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>FichaDeposito<\/code><\/td>\r\n <td>Offline\/Voucher<\/td>\r\n <td>Mexico<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Rapipago<\/code><\/td>\r\n <td>Offline\/Voucher<\/td>\r\n <td>Argentina<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>OXXO<\/code><\/td>\r\n <td>Offline\/Voucher<\/td>\r\n <td>Mexico<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Voucher<\/code><\/td>\r\n <td>Offline\/Voucher<\/td>\r\n <td>Mexico<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Bitcoin<\/code><\/td>\r\n <td>Cryptocurrency<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Venda Direta Credito<\/code><\/td>\r\n <td>Credit Card (Physical)<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n <tr>\r\n <td><code>Venda Direta Debito<\/code><\/td>\r\n <td>Debit Card (Physical)<\/td>\r\n <td>Global<\/td>\r\n <\/tr>\r\n<\/table> \r\n\r\n## Permissions\r\n\r\nCheck with your service provider to know what permissions are needed.",
"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-Manifest"
},
"example": {
"paymentMethods": [
{
"name": "Visa",
"allowsSplit": "onCapture"
},
{
"name": "Pix",
"allowsSplit": "disabled"
},
{
"name": "Mastercard",
"allowsSplit": "onCapture"
},
{
"name": "American Express",
"allowsSplit": "onCapture"
},
{
"name": "BankInvoice",
"allowsSplit": "onAuthorize"
},
{
"name": "Privatelabels",
"allowsSplit": "disabled"
},
{
"name": "Promissories",
"allowsSplit": "disabled"
}
],
"customFields": [
{
"name": "Merchant's custom field",
"type": "text"
},
{
"name": "Merchant's custom select field",
"type": "select",
"options": [
{
"text": "Field option 1",
"value": "1"
},
{
"text": "Field option 2",
"value": "2"
},
{
"text": "Field option 3",
"value": "3"
}
]
}
],
"autoSettleDelay": {
"minimum": "0",
"maximum": "720"
},
"metadataFields": [
"MetadataName1",
"MetadataName2"
]
}
}
}
}
},
"deprecated": false
}
},
"/payments": {
"post": {
"tags": [
"Payment Flow"
],
"summary": "Create payment",
"description": "Creates a new payment and initiates the payment flow.\r\n\r\n> ℹ️ This request is made from VTEX to the payment provider.\r\n\r\nPayment providers must:\r\n\r\n- Execute authorization on payments made through credit/debit card or any synchronized payments;\r\n\r\n- Return the required information to the customer on payments made through bank-issued invoice, redirect, or any async payments.\r\n\r\n >ℹ️ This endpoint has to meet the principle of [idempotence](https://en.wikipedia.org/wiki/Idempotence). When calling this endpoint for the first time of a payment, without a `paymentId`, it should create a new payment. When calling this endpoint for an existing `paymentId`, it should not create another payment, but return the updated status of the existing payment instead.\r\n\r\n## Callbacks (asynchronous flow)\r\n\r\nCallbacks are used for asynchronous payments, which do not receive the final status immediately. At first, an `undefined` status is returned, and the final status will be received from a callback request in the future as `authorized` or `denied`. There are two types of callbacks:\r\n\r\n- **Notification:** If a payment returns with `undefined` status, you are expected to send us a callback/notification to update it later, sending a POST with an updated version of your response (same structure as above) to the `callbackUrl` we have provided.\r\n\r\n- **Retry:** If a payment returns with `undefined` status, you are expected to call the retry endpoint provided by the `callbackUrl` when the processing of the payment is completed, so we make another Create Payment request to update the status with the new value (`authorized` or `denied`).\r\n\r\nCallback requests should be authenticated using a Key and Token which you can [generate from your VTEX partner account License Manager](https://help.vtex.com/en/tutorial/application-keys--2iffYzlvvz4BDMr6WGUtet#generating-app-keys-in-your-account). To do so, `POST` your request passing the `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken` headers with your credentials. **Note:** do not mix up these credentials with the ones we send on behalf of the merchant when sending our requests.\r\n\r\n>\u26A0 For integrations not using VTEX IO, use the **Notification** callback. For integrations developed using VTEX IO infrastructure, use the **Retry** callback.\r\n\r\n### Callback URL\r\n\r\nThe `callbackUrl` field contains an URL that the payment provider uses to make a callback and inform our gateway of the final payment status: `approved` or `denied`. \r\n\r\nThis URL has some query parameters, including the `X-VTEX-signature`. This parameter is mandatory and contains a signature token to identify that the request has been generated from VTEX as a security measure. The signature token has at most 32 characters. You can check an example of callback URL with the signature token below:\r\n\r\n```\r\nhttps://gatewayqa.vtexpayments.com.br/api/pvt/payment-provider/transactions/8FB0F111111122222333344449984ACB/payments/A2A9A25B11111111222222333327883C/callback?accountName=teampaymentsintegrations&X-VTEX-signature=R******tk\r\n```\r\n\r\nIn the [Transactions page of the Admin](https://help.vtex.com/en/tutorial/how-to-view-the-orders-details--tutorials_452), the signature token appears masked for security reasons, as in this example: `X-VTEX-signature=Rj******tk`.\r\n\r\nWhen making the callback request, we recommend that payment providers use the callback URL exactly as received, which guarantees that all the parameters are included.\r\n\r\nSee below an example of a payload forwarded along with the callback URL:\r\n\r\n```json\r\n{\r\n \"paymentId\": \"8B3BA2F4352545A8B1C5A215F356A01C\",\r\n \"status\": \"approved\",\r\n \"authorizationId\": \"184520\",\r\n \"nsu\": \"21705348\",\r\n \"tid\": \"21705348\",\r\n \"acquirer\": \"pagmm\",\r\n \"code\": \"0000\",\r\n \"message\": \"Successfully approved transaction\",\r\n \"delayToAutoSettle\": 1200,\r\n \"delayToAutoSettleAfterAntifraud\": 1200,\r\n \"delayToCancel\": 86400,\r\n \"cardBrand\": \"Mastercard\",\r\n \"firstDigits\": \"534696\",\r\n \"lastDigits\": \"6921\",\r\n \"maxValue\": 16.6\r\n}\r\n```\r\n\r\n>ℹ️ The parameter values sent in the callback payload replace the original values informed in the **Create Payment** request.\r\n\r\n>⚠️ If the waiting parameters (`delayToAutoSettle` and `delayToAutoSettleAfterAntifraud`) are not sent with the callback URL, the values for these parameters will be automatically set to 24 hours.\r\n\r\n## Beta features\r\n\r\nThe beta features available for payment providers are:\r\n\r\n- `inboundRequestsUrl`: Allows to forward external requests back to your payment provider implementation, including the configured credentials (`X-VTEX-API-*` headers), and settings.\r\n\r\n>\u2139 You can reach out to our team by [opening a ticket](https://help.vtex.com/en/tutorial/opening-tickets-to-vtex-support--16yOEqpO32UQYygSmMSSAM) to know more about any beta features.\r\n\r\n## Permissions\r\n\r\nCheck with your service provider to know what permissions are needed." ,
"operationId": "CreatePayment",
"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": [
{
"appKey": [],
"appToken": []
},
{
"VtexIdclientAutCookie": []
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"reference",
"orderId",
"shopperInteraction",
"transactionId",
"paymentId",
"paymentMethod",
"paymentMethodCustomCode",
"merchantName",
"value",
"currency",
"installments",
"deviceFingerprint",
"miniCart",
"url",
"callbackUrl",
"returnUrl"
],
"properties": {
"reference": {
"type": "string",
"description": "Merchant's order reference provided by VTEX Checkout.",
"example": "618272"
},
"orderId": {
"type": "string",
"description": "Merchant's order identifier provided by VTEX Checkout (also called order group).",
"example": "1072430428324"
},
"shopperInteraction": {
"type": "string",
"description": "Indicates which system the buyer interacted with (examples: ecommerce, instore, subscription).",
"example": "ecommerce"
},
"verificationOnly": {
"type": "boolean",
"description": "Indicates whether this payment is just to validate the buyer's payment method information (for instance, validate the credit card information).",
"example": false
},
"transactionId": {
"type": "string",
"description": "VTEX transaction ID related to this payment.",
"example": "2F023FD5A72A49D48A8633252B7CCBD6"
},
"paymentId": {
"type": "string",
"description": "VTEX payment ID that can be used as unique identifier.",
"example": "01693EB95BE443AC85874E395CD91565"
},
"paymentMethod": {
"type": "string",
"description": "The payment method chosen for this payment. It must be one of the available payment methods offered by the provider, which can be obtained from the [List Payment Provider Manifest endpoint](https://developers.vtex.com/docs/api-reference/payment-provider-protocol#get-/manifest).",
"example": "Diners"
},
"paymentMethodCustomCode": {
"type": "string",
"description": "Configurable for Cobranded and Privatelabels payment methods.",
"nullable": true,
"example": null
},
"merchantName": {
"type": "string",
"description": "VTEX merchant name that will receive the payment.",
"example": "mystore"
},
"value": {
"type": "number",
"description": "Value amount of the payment.",
"example": 31.90
},
"referenceValue": {
"type": "number",
"description": "Value amount of the payment without interest applied. This value is the same as the \"value\" field when \"installmentsInterestRate\" is 0.0.",
"example": 31.90
},
"currency": {
"type": "string",
"description": "Currency code (ISO 4217 alpha-3).",
"example": "BRL"
},
"installments": {
"type": "number",
"description": "Number of installments.",
"example": 1
},
"installmentsInterestRate": {
"type": "number",
"description": "The interest rate.",
"example": 0
},
"installmentsValue": {
"type": "number",
"description": "The value of each installment.",
"example": 31.90
},
"deviceFingerprint": {
"type": "string",
"description": "A hash that represents the device used to initiate the payment.",
"example": "75076388"
},
"ipAddress": {
"type": "string",
"description": "The IP Address of the buyer.",
"example": "187.105.111.65"
},
"card": {
"type": "object",
"description": "Card information used for payment. This parameter is required only with card payment methods (credit, debit or co-branded).",
"required": [
"holder",
"number",
"csc",
"expiration"
],
"properties": {
"holder": {
"type": "string",
"description": "Card holder name.",
"example": "John Doe",
"nullable": true
},
"holderToken": {
"type": "string",
"description": "A token representing the card holder (this field is absent in case the provider does not use the [Secure Proxy](https://developers.vtex.com/docs/guides/payments-integration-secure-proxy)).",
"example": "#vtex#token#d799bae#csc#"
},
"number": {
"type": "string",
"description": "Card number.",
"example": "364901****2661",
"nullable": true
},
"csc": {
"type": "string",
"description": "Card security code.",
"example": "***",
"nullable": true
},
"bin": {
"type": "string",
"description": "First six digits of the card number (this field is absent in case the provider does not use the [Secure Proxy](https://developers.vtex.com/docs/guides/payments-integration-secure-proxy)).",
"example": "364901"
},
"numberToken": {
"type": "string",
"description": "A token representing the card number (this field is absent in case the provider does not use the [Secure Proxy](https://developers.vtex.com/docs/guides/payments-integration-secure-proxy)).",
"example": "#vtex#token#d799bae#number#"
},
"numberLength": {
"type": "number",
"description": "The number of characters in the card number (this field is absent in case the provider does not use the [Secure Proxy](https://developers.vtex.com/docs/guides/payments-integration-secure-proxy)).",
"example": 16
},
"cscToken": {
"type": "string",
"description": "A token representing the card security code (this field is absent in case the provider does not use the [Secure Proxy](https://developers.vtex.com/docs/guides/payments-integration-secure-proxy)).",
"example": "#vtex#token#d799bae#csc#"
},
"cscLength": {
"type": "number",
"description": "The number of characters in the Card Security Code (this field is absent in case the provider does not use the [Secure Proxy](https://developers.vtex.com/docs/guides/payments-integration-secure-proxy)).",
"example": 3
},
"expiration": {
"type": "object",
"description": "Information about card expiration.",
"required": [
"month",
"year"
],
"properties": {
"month": {
"type": "string",
"description": "Card expiration month (2-digits).",
"example": "12",
"nullable": true
},
"year": {
"type": "string",
"description": "Card expiration year (4-digits).",
"example": "2020",
"nullable": true
}
}
},
"document": {
"type": "string",
"description": "Card holder's document.",
"example": "39295416023"
},
"paymentOrigin": {
"type": "string",
"description": "Identifies the type of wallet used in the payment. Please contact our [VTEX Support](https://help.vtex.com/support) to enable this field in your account.",
"example": "Google Pay"
},
"cryptogram": {
"type": "string",
"description": "3DS cryptogram information (available only for payments transactions with DPAN cards). Please contact our [VTEX Support](https://help.vtex.com/support) to enable this field in your account.",
"example": "/gAAAAAAAbQHWutaqaYsQLsAAAA="
},
"eci": {
"type": "string",
"description": "[Electronic Commerce Indicator](https://support.midtrans.com/hc/en-us/articles/204161150-What-is-ECI-on-3DS-protocol-). This value indicates the result of the authentication attempt on transactions enforced by the 3DS (available only for payments transactions with DPAN cards). Please contact our [VTEX Support](https://help.vtex.com/support) to enable this field in your account.",
"example": "05"
}
}
},
"miniCart": {
"type": "object",
"description": "Minicart information.",
"required": [
"shippingValue",
"taxValue",
"buyer",
"shippingAddress",
"billingAddress",
"items"
],
"properties": {
"shippingValue": {
"type": "number",
"description": "Total shipping value.",
"example": 2.0
},
"taxValue": {
"type": "number",
"description": "Total tax value.",
"example": 1.0
},
"buyer": {
"type": "object",
"description": "Buyer information.",
"required": [
"firstName",
"lastName",
"document",
"documentType",
"email",
"phone"
],
"properties": {
"id": {
"type": "string",
"description": "Buyer's unique identifier.",
"example": "c1245228-1c68-11e6-94ac-0afa86a846a5"
},
"firstName": {
"type": "string",
"description": "Buyer's first name.",
"example": "John"
},
"lastName": {
"type": "string",
"description": "Buyer's last name.",
"example": "Doe"
},
"document": {
"type": "string",
"description": "Buyer's document number (individual). For B2B transaction scenarios, this field is not mandatory and can be `null`. In these situations, the `isCorporate` field must be indicated as `true`, and the `corporateName`, `tradeName` and `corporateDocument` fields filled in.",
"nullable": true,
"example": "01234567890"
},
"documentType": {
"type": "string",
"description": "Buyer's document type (individual). For B2B transaction scenarios, this field is not mandatory and can be `null` or `cpf`. In these situations, the `isCorporate` field must be indicated as `true`, and the `corporateName`, `tradeName` and `corporateDocument` fields filled in.",
"nullable": true,
"example": "cpf"
},
"email": {
"type": "string",
"description": "Buyer's email.",
"example": "[email protected]"
},
"phone": {
"type": "string",
"description": "Buyer's phone number.",
"example": "+5521999999999"
},
"isCorporate": {
"type": "boolean",
"description": "Indicates whether or not the buyer is corporate. If `true`, the fields `corporateName`, `tradeName` and `corporateDocument` are required.",
"example": false
},
"corporateName": {
"type": "string",
"description": "Buyer's corporate name. This field is required if `isCorporate` is `true`.",
"example": "VTEX",
"nullable": true
},
"tradeName": {
"type": "string",
"description": "Buyer's trade name. This field is required if `isCorporate` is `true`.",
"example": "VTEX",
"nullable": true
},
"corporateDocument": {
"type": "string",
"description": "Buyer's corporate document number. This field is required if `isCorporate` is `true`.",
"example": "123456789",
"nullable": true
},
"createdDate": {
"type": "string",
"description": "Date when the buyer's profile was created in yyyy-MM-ddTHH:mm:ss format.",
"example": "2020-02-18T18:17:45"
}
}
},
"shippingAddress": {
"type": "object",
"description": "Information about the address where the purchase will be delivered.",
"required": [
"country",
"street",
"number",
"neighborhood",
"postalCode",
"city",
"state"
],
"properties": {
"country": {
"type": "string",
"description": "Shipping address country code (ISO 3166 alpha-3).",
"example": "BRA"
},
"street": {
"type": "string",
"description": "Shipping address street.",
"example": "Praia de Botafogo St."
},
"number": {
"type": "string",
"description": "Shipping address number.",
"example": "300"
},
"complement": {
"type": "string",
"description": "Shipping address complement.",
"example": "3rd Floor"
},
"neighborhood": {
"type": "string",
"description": "Shipping address neighborhood.",
"example": "Botafogo"
},
"postalCode": {
"type": "string",
"description": "Shipping address postal code.",
"example": "22250040"
},
"city": {
"type": "string",
"description": "Shipping address city.",
"example": "Rio de Janeiro"
},
"state": {
"type": "string",
"description": "Shipping address state/province.",
"example": "RJ"
}
}
},
"billingAddress": {
"type": "object",
"description": "Buyer's billing address information.",
"required": [
"country",
"street",
"number",
"neighborhood",
"postalCode",
"city",
"state"
],
"properties": {
"country": {
"type": "string",
"description": "Billing address country code (ISO 3166 alpha-3).",
"example": "BRA"
},
"street": {
"type": "string",
"description": "Billing address street.",
"example": "Brigadeiro Faria Lima Avenue"
},
"number": {
"type": "string",
"description": "Billing address number.",
"example": "4440"
},
"complement": {
"type": "string",
"description": "Billing address complement.",
"example": "10th Floor"
},
"neighborhood": {
"type": "string",
"description": "Billing address neighborhood.",
"example": "Itaim Bibi"
},
"postalCode": {
"type": "string",
"description": "Billing address postal code.",
"example": "04538132"
},
"city": {
"type": "string",
"description": "Billing address city.",
"example": "São Paulo"
},
"state": {
"type": "string",
"description": "Billing address state/province.",
"example": "SP"
}
}
},
"items": {
"type": "array",
"description": "Items of the cart of the purchase.",
"items": {
"type": "object",
"description": "Cart items information.",
"required": [
"id",
"name",
"price",
"quantity",
"discount"
],
"properties": {
"id": {
"type": "string",
"description": "Item identifier.",
"example": "8"
},
"name": {
"type": "string",
"description": "Item name.",
"example": "Tenis Preto I"
},
"price": {
"type": "number",
"description": "Item price per unity.",
"example": 30.9
},
"quantity": {
"type": "integer",
"description": "Item quantity.",
"example": 1
},
"discount": {
"type": "integer",
"description": "Discount received for the item.",
"example": 0.0
},
"deliveryType": {
"type": "string",
"description": "The delivery SLA selected for this item. Possible values in Brazil, for instance, are PAC, SEDEX.",
"example": "Normal"
},
"categoryId": {
"type": "string",
"description": "The item category Id.",
"example": "5"
},
"sellerId": {
"type": "string",
"description": "In case of a marketplace transaction, this is the Id of the seller for this specific item. Otherwise, this is filled with a '1'.",
"example": "1"
},
"taxRate": {
"type": "number",
"description": "Value of the sum of all Taxes applied to each item. Rates are in percentage, so 5% is represented as 0.05.",
"example": 0.05
},
"taxValue": {
"type": "number",
"description": "Total Tax value of the item (taxRate times value).",
"example": 1.54
}
}
}
}
}
},
"recipients": {
"type": "array",
"description": "Array containing the information for the recipients of this payment in case the Payment Provider is configured to allow the split of payments.",
"items": {
"type": "object",
"description": "Recipients information.",
"required": [
"id",
"name",
"documentType",
"document",
"role",
"amount"
],
"properties": {
"id": {
"type": "string",
"description": "Recipient identifier.",
"example": "mystore"
},
"name": {
"type": "string",
"description": "Recipient name.",
"example": "Company ABC"
},
"documentType": {
"type": "string",
"description": "Recipient document type.",
"example": "CNPJ"
},
"document": {
"type": "string",
"description": "Recipient document number.",
"example": "24830098000172"
},
"role": {
"type": "string",
"description": "Indicates if the recipient is the seller or the marketplace.",
"example": "seller"
},
"chargeProcessingFee": {
"type": "boolean",
"description": "Indicates whether or not this recipient is charged for processing fees.",
"example": true
},
"chargebackLiable": {
"type": "boolean",
"description": "Indicates whether or not this recipient is liable to chargebacks.",
"example": true
},
"amount": {
"type": "number",
"description": "Amount due to this recipient.",
"example": 13.8
},
"comissionAmount": {
"type": "number",
"description": "Amount received by the Marketplace.",
"example": 3.0
}
}
}
},
"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": "Merchant settings information.",
"required": [
"name",
"value"
],
"properties": {
"name": {
"type": "string",
"description": "Custom field name.",
"example": "Public Merchant ID Test."
},
"value": {
"type": "string",
"description": "Custom field value.",
"example": "1"
}
}
}
},
"url": {
"type": "string",
"description": "The order URL from merchant's backoffice.",
"example": "https://admin.mystore.example.com/orders?q=1072430428324"
},
"inboundRequestUrl": {
"type": "string",
"description": "The URL to call for the Inbound Request (BETA).",
"example": "https://api.mystore.example.com/checkout/order/1072430428324/inbound-request/:action"
},
"secureProxyUrl": {
"type": "string",
"description": "The URL for the [Secure Proxy](https://developers.vtex.com/docs/guides/payments-integration-secure-proxy) to authorize the Payment (this field is absent in case the provider does not use the Secure Proxy).",
"example": "https://account.vtexpayments.com.br/.../proxy"
},
"sandBoxMode": {
"type": "boolean",
"description": "Indicates whether or not this request is being sent from a sandbox environment.",
"example": false
},
"totalCartValue": {
"type": "number",
"description": "Total amount of the shopping cart that this payment is part of. It can be used together with the value to calculate the percentage that this payment represents of the total.",
"example": 31.90
},
"callbackUrl": {
"type": "string",
"description": "The URL you need to call to send the callbacks (notification or retry) of payment status changes.",
"example": "https://coinshop.vtexpayments.com.br/payment-provider/transactions/900BA26FEAC84332A53AE1007E740DE3/payments/E713830E32764BF99028A0A275841BFC/notification"
},
"returnUrl": {
"type": "string",
"description": "The URL you need to redirect the end user back to merchant's store when using the redirect flow.",
"example": "https://mystore.example.com/checkout/order/1072430428324"
},
"connectorMetadata": {
"type": "array",
"description": "Array containing metadata fields sent from the provider to the payment gateway.",
"items": {
"type": "object",
"description": "Metadata field information.",
"required": [
"name",
"value"
],
"properties": {
"name": {
"type": "string",
"description": "The name of the metadata to be stored in the gateway (limited to 20 characters).",
"example": "MetadataName"
},
"value": {
"type": "string",
"description": "The value of the metadata stored (limited to 200 characters).",
"example": "MetadataValue"
}
}
}
}
}
},
"examples": {
"Credit Card Success Approved": {
"value": {
"reference": "618272",
"orderId": "1072430428324",
"shopperInteraction": "ecommerce",
"transactionId": "2F023FD5A72A49D48A8633252B7CCBD6",
"paymentId": "01693EB95BE443AC85874E395CD91565",
"paymentMethod": "Diners",
"paymentMethodCustomCode": null,
"merchantName": "mystore",
"card": {
"holder": "John Doe",
"number": "364901****2661",
"csc": "***",
"expiration": {
"month": "12",
"year": "2020"
},
"document": "39295416023",
"token": null
},
"value": 31.90,
"referenceValue": 31.90,
"currency": "BRL",
"installments": 1,
"installmentsInterestRate": 0.00,
"installmentsValue": 31.90,
"deviceFingerprint": "75076388",
"ipAddress": "187.105.111.65",
"miniCart": {
"buyer": {
"id": "c1245228-1c68-11e6-94ac-0afa86a846a5",
"firstName": "John",
"lastName": "Doe",
"document": "01234567890",
"documentType": "cpf",
"corporateName": null,
"tradeName": null,
"corporateDocument": null,
"isCorporate": false,
"email": "[email protected]",
"phone": "+5521999999999",
"createdDate": "2020-02-18T18:17:45"
},
"shippingAddress": {
"country": "BRA",
"street": "Praia de Botafogo St.",
"number": "300",
"complement": "3rd Floor",
"neighborhood": "Botafogo",
"postalCode": "22250040",
"city": "Rio de Janeiro",
"state": "RJ"
},
"billingAddress": {
"country": "BRA",
"street": "Brigadeiro Faria Lima Avenue",
"number": "4440",
"complement": "10th Floor",
"neighborhood": "Itaim Bibi",
"postalCode": "04538132",
"city": "São Paulo",
"state": "SP"
},
"items": [
{
"id": "8",
"name": "Tenis Preto I",
"price": 30.9,
"quantity": 1,
"discount": 0.0,
"deliveryType": "Normal",
"categoryId": "5",
"sellerId": "1"
}
],
"shippingValue": 1.0,
"taxValue": 0.0
},
"url": "https://admin.mystore.example.com/orders?q=1072430428324",
"callbackUrl": "https://api.mystore.example.com/some-path/to-notify/status-changes?an=mystore",
"returnUrl": "https://mystore.example.com/checkout/order/1072430428324",
"inboundRequestsUrl": "https://api.mystore.example.com/checkout/order/1072430428324/inbound-request/:action",
"recipients": [
{
"id": "mymarketplace",
"name": "My Marketplace QA",
"documentType": "CNPJ",
"document": "99999999999999",
"role": "marketplace",
"chargeProcessingFee": true,
"chargebackLiable": true,
"amount": 31.90
}
],
"merchantSettings": [
{
"name": "field1",
"value": "value1"
},
{
"name": "field2",
"value": "value2"
}
],
"connectorMetadata": [
{
"name": "MetadataName",
"value": "MetadataValue"
}
]
}
},
"Pix Success Approved": {
"value": {
"reference": "32478982",
"orderId": "v967373115140abc",
"shopperInteraction": "ecommerce",
"transactionId": "D3AA1FC8372E430E8236649DB5EBD08E",
"paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91",
"paymentMethod": "Pix",
"paymentMethodCustomCode": null,
"merchantName": "mystore",
"value": 4307.23,
"referenceValue": 4307.23,
"currency": "BRL",
"installments": 1,
"deviceFingerprint": "15ace369587ha",
"card": {
"holder": null,
"number": null,
"csc": null,
"expiration": {
"month": null,
"year": null
}
},
"miniCart": {
"shippingValue": 11.44,
"taxValue": 10.01,
"buyer": {
"id": "c1245228-1c68-11e6-94ac-0afa86a846a5",
"firstName": "John",
"lastName": "Doe",
"document": "01234567890",
"documentType": "cpf",
"email": "[email protected]",
"phone": "+5521999999999"
},
"shippingAddress": {
"country": "BRA",
"street": "Praia de Botafogo St.",
"number": "300",
"complement": "3rd Floor",
"neighborhood": "Botafogo",
"postalCode": "22250040",
"city": "Rio de Janeiro",
"state": "RJ"
},
"billingAddress": {
"country": "BRA",
"street": "Brigadeiro Faria Lima Avenue",
"number": "4440",
"complement": "10th Floor",
"neighborhood": "Itaim Bibi",
"postalCode": "04538132",
"city": "São Paulo",
"state": "SP"
},
"items": [
{
"id": "132981",
"name": "My First Product",
"price": 2134.90,
"quantity": 2,
"discount": 5.00
},
{
"id": "123242",
"name": "My Second Product",
"price": 21.98,
"quantity": 1,
"discount": 1.00
}
]
},
"url": "https://admin.mystore.example.com/orders/v32478982",
"callbackUrl": "https://api.example.com/some-path/to-notify/status-changes?an=mystore",
"returnUrl": "https://mystore.example.com/checkout/order/v32478982"
}
},
"Success Undefined": {
"value": {
"reference": "32478982",
"orderId": "v967373115140abc",
"shopperInteraction": "ecommerce",
"transactionId": "D3AA1FC8372E430E8236649DB5EBD08E",
"paymentId": "F5C1A4E20D3B4E07B7E871F5B5BC9F91",
"paymentMethod": "Visa",
"paymentMethodCustomCode": null,
"merchantName": "mystore",
"value": 4307.23,
"referenceValue": 4000.00,
"currency": "BRL",
"installments": 3,
"deviceFingerprint": "12ade389087fe",
"card": {
"holder": "John Doe",
"number": "4682185088924788",
"csc": "021",
"expiration": {
"month": "06",