-
Notifications
You must be signed in to change notification settings - Fork 3
/
sbp_subscriptions_en.yml
1630 lines (1561 loc) · 58.3 KB
/
sbp_subscriptions_en.yml
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: Fast Payment System Integration API (SBP)
version: '1.0'
contact:
email: ecom@raiffeisen.ru
name: Support e-mail
x-logo:
url: images/raifflogo.png
backgroundColor: '#FFFFFF'
altText: Raiff logo
description: |-
You can give your comments about current documentation in repository: https://github.com/Raiffeisen-DGTL/ecom-API/blob/master/sbp_en.yml
# Connect to SBP
To receive SBP payments, submit appliacation on [site.](https://www.raiffeisen.ru/corporate/management/sbp/)
Raiffeisenbank will complete the registration.
After the process is completed, you will be notified by email.
## SBP participants
### Buyer
* selects the services / goods in the partner software and the item “Payment via SBP” (optional)
* scans the QR code provided by the partner and confirms the payment in the application of his bank
* receives the result of payment and paid services / goods
### Partner
* requests the formation of a QR code for the selected goods / services (basket)
* displays a QR code to the client for scanning and making payment
* processes notifications of the results of SBP operations
* requests payment data (optional)
* ensures the delivery of goods / services to the buyer upon payment
### Raiffeisenbank
* provides an interface for requesting a QR code from a partner
* provides money transfer to the partner's account upon settlements in SBP
* defines the format of the notification of the fact of the SBP payment
* provides an interface for receiving payment data
## Support 54-FZ
In accordance with the Federal Law NO. 54-FZ of May 22, 2003 "On the use of cash registers in implementation of settlements in the Russian Federation",
for taxation purposes a fiscal receipt is required for making settlements for goods sold, work performed or services rendered, as well as transfer of the receipts to tax authorities.
Raiffeisenbank provides generation of fiscal receipts and their transfer to tax authorities by integration via [API](https://e-commerce.raiffeisen.ru/api/doc/fiscal.html).
# General scheme of work
## Working with a form:
To accept payments online on the website or in the mobile application, you can use [QR-code opening protocol in the form.](https://e-commerce.raiffeisen.ru/api/doc/ecom_en.html)
<a href='images/E-commerce Raiffeisenbank scheme_en.png' target='_blank'><img src='images/E-commerce Raiffeisenbank scheme_en.png'></a>
## White labele SBP API
The figure below shows the scheme of information exchange with a partner when making a payment using a QR-code.
<a href='images/SBP API Raiffeisenbank scheme_en.png' target='_blank'><img src='images/SBP API Raiffeisenbank scheme_en.png'></a>
## Subscription scheme
You can offer the client to link the SBP payment to the loyalty program or to an account in your service. To do this, you can generate a QR code and display it to the client or redirect it via a special link that is located in the response to the request to create a QR code for a subscription.
After that, using the unique subscription identifier, you can apply for debiting funds from the client for your goods and services without the client's acceptance.
<a href='images/subscriptions.png' target='_blank'><img src='images/subscriptions.png'></a>
## Payment and subscription scheme
There is also a scheme in which one request receives a QR code to receive payment and subscription.
In this case, the client makes a payment, after which a window is displayed with a proposal to activate the subscription.
The customer can pay but unsubscribe. Also, the client can make a payment from a bank application that does not support subscriptions.
<a href='images/subscriptionsandpayment.png' target='_blank'><img src='images/subscriptionsandpayment.png'></a>
# Ready solutions
You can use our SDK for faster integration:
* [Java](https://github.com/Raiffeisen-DGTL/sbp-sdk-java)
[Our other solutions.](https://e-commerce.raiffeisen.ru/api/doc/solutions.html)
# API description
The interaction is carried out using the HTTP protocol using the GET / POST methods (the description of each request clearly indicates the required method and address).
POST requests use JSON arguments, GET requests work with query strings.
The API always returns a response in JSON format, regardless of the type of request.
The response of any method contains a message code (code). If a logical error occurs during the processing of any request, the API will additionally return a description of the error (message).
## Authorization
Requests like:
* receiving information on a QR code
* receipt of payment information
* processing a return on payment
* receiving information on return
are authorized using the API secret key (secretKey). The authorization parameter is specified in the Authorization header, the value of which is formed as "Bearer secretKey".
You can view your sbpMerchantId and generate keys in your [personal account](https://www.rbo.raiffeisen.ru/acquiring/mcp#/) in the "Accept payments" tab
<div align=center><a href='images/createKey.png' target='_blank'><img src='images/createKey.png'></a></div>
To generate a test data, please contact: ecom@raiffeisen.ru
# Mobile version and application
You need to redirect your users on url from payload parameter if you have mobile version of the site or app.
Banking app or bank selection list will open.
# Testing
For a full payment testing cycle, Raiffeisenbank provides the opportunity to use a demo application for scanning QRC on behalf of the buyer at:
https://pay.raif.ru/pay/rfuture/
The specified address can be opened in the browser of any device with a camera. No additional software / plugins need to be installed. Then click on the SBP icon (if necessary, allow the browser access to the camera) and bring the QR code image to it.
If the camera doesn't open, check the url, it has to have https.
### Example Demo Screen
<div align=center><a href='images/example-sbp-1.png' target='_blank'><img src='images/example-sbp-1.png'></a></div>
servers:
- url: 'https://e-commerce.raiffeisen.ru/api'
description: Production
- url: 'https://test.ecom.raiffeisen.ru/api'
description: Sandbox
tags:
- name: qr-controller
x-displayName: Work with a QR code
description: |
To implement interaction with a partner, Raiffeisenbank provides an API of the following requests:
* QR code registration,
* receiving data on a previously registered QR code,
* receipt of payment data,
* money back - can be made both for the full amount of the payment, and for a partial one. However, the amount of partial refund requests should not exceed the total amount of the order,
* receiving information on return.
- name: qr-subscription
x-displayName: Subscription
description: |
To enable the subscription, additional configuration is required from the bank.
There are two possible scenarios for implementation:
* subscription
[Scheme.](#section/General-scheme-of-work/Subscription-scheme)
* Payment and subscription
[Scheme.](#section/General-scheme-of-work/Payment-and-subscription-scheme)
- name: Callback
x-displayName: Notification
description: |
To inform the merchant about the payments made, HTTP notifications to the address specified in its settings can be used.
The prod url can be specified in the [personal account](https://www.rbo.raiffeisen.ru/acquiring/mcp#/) in the "Accept payments" tab.
<div align=center><a href='images/callback.png' target='_blank'><img src='images/callback.png'></a></div>
And prod or test url can be specified with [API.](#operation/post-settings-v1-callback)
For a partner, a notification is an incoming POST request that uses a JSON structure.
A notification is considered accepted if the recipient responded to the request with HTTP 200.
Responses with any other HTTP codes will be considered invalid.
Repeated attempts to send will be carried out during the day with increasing intervals.
To verify the authenticity of the notification, a signature is added to the data in the X-Api-Signature-SHA256 header, obtained on the basis of a common secret key and a control string (amount | sbpMerchantId | order | paymentStatus | transactionDate) using HMAC-SHA-256.
Notifications are sent from an IP 193.28.44.23
- name: Registry
x-displayName: Registry
description: |
To subscribe to the report, send an email to ecom@raiffeisen.ru
Reports are sent every day.
If there was no transaction on that day, the report is not sent.
Report format:
Column name | Value
--------|------------------
Мерчант | Store id
Дата операции МСК | Date and time of payment
Тип | Type transaction
id заказа | Order id
id возврата | Refund id
Комментарий | Comment
Способ оплаты | Instant Payment QR
Данные оплаты | QR id
id клиента | Masked payer code
Сумма | Amount
Комиссия | Transaction fee
Дополнительные поля | Additional Information (Not used yet)
<a download='' target='_blank' href='images/SBPreport.csv'>Exampl of report</a>
- name: Statement
x-displayName: Statement
description: |
You can download the statement in your client bank in format:
* <a download='' target='_blank' href='images/test_statement.pdf'>PDF</a>
* <a download='' target='_blank' href='images/test_statement_1C.txt'>1C txt</a>
* <a download='' target='_blank' href='images/test_statement.xml'>XML</a>
Payment details have sysytem prefix: operation number , operation type , sbp merchant id.
The standart payment purpose is specified in the example. You can change it, for this you can send paymentDetails in the registration and refund requests.
- name: Errors
x-displayName: List of errors
description: |
The response of any method contains a message code (code). If a logical error occurs during the processing of any request, the API will additionally return a description of the error (message).
Examples of basic errors:
code | message
------------|------
ERROR.ACCOUNT_IS_NOT_REGISTERED | Указан неверный счет. Проверьте его или удалите. Параметр является необязательным
ERROR.INVALID_REQUEST | Не передан обязательный параметр
ERROR.QR_EXPIRATION_DATE_NOT_VALID | Неверная дата истечения QR-кода
ERROR.MERCHANT_NOT_REGISTERED | Партнер с ID MA0000000552 не зарегистрирован
ERROR.ORDER_NUMBER_ALREADY_REGISTERED | QR-код с номером заказа ***, партнера MA0000000552 и успешными платежами уже зарегистрирован
ERROR.INVALID_REQUEST | Передана некорректная сумма платежа
ERROR.SBP_MERCHANT_ID_IS_MISSING | SbpMerchantId партнера не указан
ERROR.DYNAMIC_QR_WITHOUT_AMOUNT | Не передана сумма для динамического QR-кода
ERROR.INVALID_ORDER | В номере заказа поддерживаются A-z09_-.
ERROR.NOT_FOUND | QR-код не найден у данного партнера
ERROR.REFUND_INSUFFICIENT_FUNDS | Сумма возврата больше суммы остатка по платежу
ERROR.INVALID_REQUEST | Сумма возврата не может быть меньше 1 копейки
ERROR.REFUND_NOT_FOUND | Возврат с refundId *** не найден
- name: 02.06.2021
x-displayName: 02.06.2021
description: |
* Add [new method for cancel the QR-code](#operation/delete-sbp-v2-qrs-qrId)
* Updated [version of the mehod: "Receiving data on a previously registered QR code"](#operation/get-sbp-v2-qrs-qrId)
- name: 06.07.2021
x-displayName: 06.07.2021
description: |
* Add [subscriptions service](#tag/qr-subscription)
- name: 09.09.2021
x-displayName: 09.09.2021
description: |
* Correct maxLength paymentDetails in refund method
x-tagGroups:
- name: API
tags:
- qr-controller
- qr-subscription
- Callback
- name: Comparison
tags:
- Registry
- Statement
- name: Reference information
tags:
- Errors
- name: Change history
tags:
- 02.06.2021
- 06.07.2021
- 09.09.2021
paths:
/settings/v1/callback:
post:
summary: Setting url for callback
operationId: post-settings-v1-callback
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/callbackSettings'
examples:
'200':
value:
callbackUrl: 'https://yoururl.ru'
tags:
- Callback
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/callbackSettings'
examples:
Payload:
value:
callbackUrl: 'https://yoururl.ru'
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
name: 'Authorization:'
description: '[secretKey](#section/API-description/Authorization)'
required: true
description: The key from the authorization header will be used to sign notifications.
/sbp/v1/qr/register:
post:
summary: QR code registration
operationId: post-sbp-v1-qr-register
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/qrStatus'
examples:
QRDynamic subscription:
value:
code: SUCCESS
qrId: AD1F2CD7212E48FA919AB52EF0AEFB33
payload: 'https://qr.nspk.ru/AD1F2CD7212E48FA919AB52EF0AEFB33?type=02&bank=10000001&sum=111000&cur=RUB&crc=C08B'
qrUrl: 'https://test.ecom.raiffeisen.ru/api/sbp/v1/qr/AD1F2CD7212E48FA919AB52EF0AEFB33/image'
subscriptionId: '120059'
QRDynamic/QRStatic:
value:
code: SUCCESS
qrId: AD100004BAL7227F9BNP6KNE007J9B3K
payload: 'https://qr.nspk.ru/AD100004BAL7227F9BNP6KNE007J9B3K?type=02&bank=100000000007&sum=1&cur=RUB&crc=AB75'
qrUrl: 'https://e-commerce.raiffeisen.ru/api/sbp/v1/qr/AD100004BAL7227F9BNP6KNE007J9B3K/image'
description: |-
Registration of the QR code is performed without authorization, which allows you to generate it on the website or application. This method allows you to generate both static QR codes and dynamic QR codes. You can also use this method to generate a QR code for pay and subscription at one the moment.
Test QR codes can only be paid for by our [test application.](#section/Testing)
requestBody:
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/reqPayQR'
examples:
QRDynamic:
value:
account: 40700000000000000000
additionalInfo: Доп информация
amount: 1110
currency: RUB
order: 1-22-333
paymentDetails: Назначение платежа
qrType: QRDynamic
qrExpirationDate: '2023-07-22T09:14:38+03:00'
sbpMerchantId: MA0000000552
QRDynamic subscription:
value:
account: 40700000000000000000
additionalInfo: Доп информация
amount: 1110
currency: RUB
order: 1-22-333
paymentDetails: Назначение платежа
qrType: QRDynamic
qrExpirationDate: '2023-07-22T09:14:38+03:00'
sbpMerchantId: MA0000000552
subscription:
id: '120059'
subscriptionPurpose: Подписка на услуги
QRStatic:
value:
order: 1-22-333
qrType: QRStatic
sbpMerchantId: MA0000000552
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
tags:
- qr-controller
x-codeSamples:
- lang: cURL
source: |
curl --location --request POST 'https://test.ecom.raiffeisen.ru/api/sbp/v1/qr/register' \
--header 'Content-Type: application/json' \
--data-raw '{
"account": 40700000000000000000,
"additionalInfo": "Доп информация",
"amount": 1110,
"currency": "RUB",
"order": "1-22-333",
"paymentDetails": "Назначение платежа",
"qrType": "QRDynamic",
"qrExpirationDate": "2023-07-22T09:14:38+03:00",
"sbpMerchantId": "MA0000000552"
}'
- lang: Java
source: |
String order = QRUtils.generateOrderNumber();
QRDynamic qrCode = new QRDynamic(order, new BigDecimal(100));
qrCode.setAccount("40700000000000000000");
qrCode.setAdditionalInfo("Доп информация");
qrCode.setPaymentDetails("Назначение платежа");
qrCode.setQrExpirationDate("2023-07-22T09:14:38.107227+03:00");
QRUrl response = client.registerQR(qrCode);
'/sbp/v2/qrs/{qrId}':
parameters:
- schema:
type: string
name: qrId
in: path
required: true
description: ID of registered QRS in SBP
delete:
summary: Сancel the QR-code
operationId: delete-sbp-v2-qrs-qrId
responses:
'200':
description: OK
tags:
- qr-controller
description: This method allows you to cancel a previously created QR code before paying for it
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
name: 'Authorization:'
description: '[secretKey](#section/API-description/Authorization)'
required: true
x-codeSamples:
- lang: cURL
source: |
curl --location --request DELETE 'https://test.ecom.raiffeisen.ru/api/sbp/v2/qrs/ADAC306DDBF443CA94EBE3FA85CA4872' \
--header 'Authorization: Bearer eyJ0eXA***'
get:
summary: Get the data using a previously registered QR code
operationId: get-sbp-v2-qrs-qrId
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/qrInfov2'
examples:
'200':
value:
qrId: AD100004BAL7227F9BNP6KNE007J9B3K
qrStatus: NEW
qrExpirationDate: '2023-07-22T09:14:38+03:00'
payload: 'https://qr.nspk.ru/AD100004BAL7227F9BNP6KNE007J9B3K?type=02&bank=100000000007&sum=1&cur=RUB&crc=AB75'
qrUrl: 'https://e-commerce.raiffeisen.ru/api/sbp/v1/qr/AD100004BAL7227F9BNP6KNE007J9B3K/image'
description: This method allows you to get data from a previously created QR code
tags:
- qr-controller
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
name: 'Authorization:'
description: '[secretKey](#section/API-description/Authorization)'
required: true
x-codeSamples:
- lang: cURL
source: |
curl --location --request GET 'https://test.ecom.raiffeisen.ru/api/sbp/v2/qrs/ADAC306DDBF443CA94EBE3FA85CA4872' \
--header 'Authorization: Bearer eyJ0eXA***'
'/sbp/v1/qr/{qrId}/info':
parameters:
- schema:
type: string
name: qrId
in: path
required: true
description: ID of registered QRS in SBP
get:
summary: Get the data using a previously registered QR code
tags:
- qr-controller
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/qrStatus'
examples:
'200':
value:
code: SUCCESS
qrId: AD100004BAL7227F9BNP6KNE007J9B3K
payload: 'https://qr.nspk.ru/AD100004BAL7227F9BNP6KNE007J9B3K?type=02&bank=100000000007&sum=1&cur=RUB&crc=AB75'
qrUrl: 'https://e-commerce.raiffeisen.ru/api/sbp/v1/qr/AD100004BAL7227F9BNP6KNE007J9B3K/image'
operationId: get-sbp-v1-qr-qrId-info
deprecated: true
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
name: 'Authorization:'
description: '[secretKey](#section/API-description/Authorization)'
required: true
x-codeSamples:
- lang: cURL
source: |
curl --location --request GET 'https://test.ecom.raiffeisen.ru/api/sbp/v1/qr/AS6E5A7F9E3A4E648C536EC930AECDF6/info' \
--header 'Authorization: Bearer eyJ0eXA***'
- lang: Java
source: |
String qrIdString = "...";
QRId id = new QRId(qrIdString);
QRUrl response = client.getQRInfo(id);
description: The method allows you to get data on a previously registered QR code
'/sbp/v1/qr/{qrId}/payment-info':
parameters:
- schema:
type: string
name: qrId
in: path
required: true
description: ID of registered QRS in SBP
get:
summary: Get payment Information
tags:
- qr-controller
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/paymentInfo'
examples:
'200':
value:
additionalInfo: Доп информация
paymentPurpose: Назначение платежа
amount: 12399
code: SUCCESS
createDate: '2020-01-31T09:14:38.107227+03:00'
currency: RUB
merchantId: 123
order: 282a60f8-dd75-4286-bde0-af321dd081b3
paymentStatus: SUCCESS
qrId: AD100051KNSNR64I98CRUJUASC9M72QT
sbpMerchantId: MA0000000552
transactionDate: '2019-07-11T17:45:13.109227+03:00'
transactionId: 23
qrExpirationDate: '2020-01-15T13:00:40+03:00'
operationId: get-sbp-v1-qr-qrId-payment-info
description: The method allows you to get data on a previously registered QR code
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
description: '[secretKey](#section/API-description/Authorization)'
name: 'Authorization:'
required: true
x-codeSamples:
- lang: cURL
source: |
curl --location --request GET 'https://test.ecom.raiffeisen.ru/api/sbp/v1/qr/AS6E5A7F9E3A4E648C536EC930AECDF6/payment-info' \
--header 'Authorization: Bearer eyJ0eXA***'
- lang: Java
source: |
String qrIdString = "...";
QRId id = new QRId(qrIdString);
PaymentInfo response = client.getPaymentInfo(id);
/sbp/v1/refund:
post:
summary: Refund
operationId: post-sbp-v1-refund
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/responeRefund'
examples:
'200':
value:
code: SUCCESS
amount: 150
refundStatus: IN_PROGRESS
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/refundQR'
examples:
QRDynamic:
value:
amount: 150
order: test_order_007
paymentDetails: Test
refundId: test_refundId_007
QRStatic:
value:
amount: 150
order: test_order_007
paymentDetails: Test
refundId: test_refundId_007
transactionId: 41
tags:
- qr-controller
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
name: 'Authorization:'
description: '[secretKey](#section/API-description/Authorization)'
required: true
x-codeSamples:
- lang: cURL
source: |
curl --location --request POST 'https://test.ecom.raiffeisen.ru/api/sbp/v1/refund' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXA***' \
--data-raw '{
"amount": 150,
"order": "test_order_007",
"paymentDetails": "Test",
"refundId": "test_refundId_007",
"transactionId": 41
}'
- lang: Java
source: |
BigDecimal moneyAmount = new BigDecimal(150);
String orderInfo = "...";
String refundId = "...";
long transactionId = ...;
RefundInfo refundInfo = new RefundInfo(moneyAmount, orderInfo, refundId);
RefundStatus response = client.refundPayment(refundInfo);
description: The method allows you to make a full and partial refund by QR
'/sbp/v1/refund/{refundId}':
parameters:
- schema:
type: string
name: refundId
in: path
required: true
description: Unique Refund Request ID
get:
summary: Get information about a refund
tags:
- qr-controller
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/responeRefund'
examples:
'200':
value:
code: SUCCESS
amount: 150
refundStatus: COMPLETED
operationId: get-sbp-v1-refund-refundId
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
name: 'Authorization:'
description: '[secretKey](#section/API-description/Authorization)'
required: true
x-codeSamples:
- lang: cURL
source: |
curl --location --request GET 'https://test.ecom.raiffeisen.ru/api/sbp/v1/refund/111112222200046' \
--header 'Authorization: Bearer eyJ0eXA***'
- lang: Java
source: |
String refundIdString = "...";
RefundId refundId = new RefundId(refundIdString);
RefundStatus response = client.getRefundInfo(refundId);
description: Getting information about the refund
/sbp/v1/subscriptions:
post:
summary: Create QR for subscription
operationId: post-sbp-v1-subscriptions
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/subscriptionRespones'
examples:
'200':
value:
id: '120059'
createDate: '2020-01-31T09:14:38.107227+03:00'
status: INACTIVE
qr:
id: AD100004BAL7227F9BNP6KNE007J9B3K
payload: 'https://sub.nspk.ru/AS3D33FC7B034DEEA8A365142E1DE737?type=03&bank=10000001&crc=C08B'
url: 'https://test.ecom.raiffeisen.ru/api/sbp/v1/qr/AS3D33FC7B034DEEA8A365142E1DE737/image'
description: Method for create subscription QR-code. Use qr.payload for mobile version site or app.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/createSubscription'
examples:
Payload:
value:
id: '120059'
subscriptionPurpose: Подписка на услуги
sbpMerchantId: MA0000000552
tags:
- qr-subscription
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
'/sbp/v1/subscriptions/{subscriptionId}':
parameters:
- schema:
type: string
name: subscriptionId
in: path
required: true
description: Id subscription
get:
summary: Get information of subscription
tags:
- qr-subscription
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/subscriptionStatus'
examples:
'200':
value:
id: '120059'
bank: someBank
createDate: '2020-01-31T09:14:38.107227+03:00'
status: INACTIVE
qr:
id: AD100004BAL7227F9BNP6KNE007J9B3K
payload: 'https://sub.nspk.ru/AS3D33FC7B034DEEA8A365142E1DE737?type=03&bank=10000001&crc=C08B'
url: 'https://test.ecom.raiffeisen.ru/api/sbp/v1/qr/AS3D33FC7B034DEEA8A365142E1DE737/image'
operationId: get-sbp-v1-subscriptions-subscriptionId
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
name: 'Authorization:'
description: '[secretKey](#section/API-description/Authorization)'
required: true
description: This method allows you to get data for a previously created subscription
'/sbp/v1/subscriptions/{subscriptionId}/orders':
parameters:
- schema:
type: string
name: subscriptionId
in: path
required: true
description: Id subscription
post:
summary: Request for payment about subscription
operationId: post-sbp-v1-subscriptions-subscriptionId-orders
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/paymentStatus'
examples:
'200':
value:
additionalInfo: Доп информация
paymentDetails: Назначение платежа
amount: 12399
currency: RUB
order: 282a60f8-dd75-4286-bde0-af321dd081b3
paymentStatus: SUCCESS
qrId: AD100051KNSNR64I98CRUJUASC9M72QT
sbpMerchantId: MA0000000552
description: Method for create payment about subscription
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/createPayment'
examples:
Payload:
value:
account: 40700000000000000000
additionalInfo: Доп информация
amount: 1110
currency: RUB
order: 1-22-333
paymentDetails: Назначение платежа
tags:
- qr-subscription
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
name: 'Authorization:'
description: '[secretKey](#section/API-description/Authorization)'
required: true
'/sbp/v1/subscriptions/{subscriptionId}/orders/{order}':
parameters:
- schema:
type: string
name: subscriptionId
in: path
required: true
description: Id subscription
- schema:
type: string
name: order
in: path
required: true
description: Unique identifier of the order in the partner system.
get:
summary: Check payment status with subscription
tags:
- qr-subscription
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/paymentStatus'
examples:
'200':
value:
additionalInfo: Доп информация
paymentDetails: Назначение платежа
amount: 12399
currency: RUB
order: 282a60f8-dd75-4286-bde0-af321dd081b3
paymentStatus: SUCCESS
qrId: AD100051KNSNR64I98CRUJUASC9M72QT
sbpMerchantId: MA0000000552
operationId: get-sbp-v1-subscriptions-subscriptionId-orders-id
description: The method allows you to get data on the payment made by subscription
parameters:
- schema:
type: string
in: header
name: 'Content-type:'
description: application/json
required: true
- schema:
type: string
in: header
name: 'Authorization:'
description: '[secretKey](#section/API-description/Authorization)'
required: true
components:
schemas:
paymentInfo:
description: ''
type: object
x-examples:
example-1:
additionalInfo: Доп информация
paymentPurpose: Назначение платежа
amount: 12399
code: SUCCESS
createDate: '2020-01-31T09:14:38.107227+03:00'
currency: RUB
merchantId: 123
order: 282a60f8-dd75-4286-bde0-af321dd081b3
paymentStatus: SUCCESS
qrId: AD100051KNSNR64I98CRUJUASC9M72QT
sbpMerchantId: MA0000000552
transactionDate: '2019-07-11T17:45:13.109227+03:00'
transactionId: 23
qrExpirationDate: '2020-01-15T13:00:40+03:00'
title: paymentRespone
properties:
additionalInfo:
type: string
minLength: 1
description: Additional information to be filled out at the request of the partner when generating the QR code
paymentPurpose:
type: string
minLength: 1
description: Purpose of payment. Optional to fill out.
amount:
type: number
description: Amount in rubles.
code:
type: string
minLength: 1
description: Message code
createDate:
type: string
minLength: 1
description: Application Formation Time
currency:
type: string
minLength: 1
enum:
- RUB
description: Payment currency
merchantId:
type: number
description: Unique partner identifier issued by the bank
order:
type: string
minLength: 1
description: Unique identifier of the order in the partner system
paymentStatus:
type: string
minLength: 1
enum:
- SUCCESS
- DECLINED
- NO_INFO
- IN_PROGRESS
description: Payment status
qrId:
type: string
minLength: 1
description: Unique QR ID issued by SBP when requesting QR generation
sbpMerchantId:
type: string
minLength: 1
description: Unique partner identifier issued by SBP
transactionDate:
type: string
minLength: 1
description: Date and time of payment
transactionId:
type: integer
description: Raiffeisenbank payment transaction identifier
qrExpirationDate:
type: string
minLength: 1
description: Expiration date QR