This repository has been archived by the owner on Oct 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
swagger.yaml
1047 lines (1043 loc) · 37.9 KB
/
swagger.yaml
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: QR API
version: '1.0'
description: |-
The QR API enables you to generate Vipps and MobilePay QR codes and merchant redirects for a Vipps MobilePay payment.
See the [QR API Guide](https://developer.vippsmobilepay.com/docs/APIs/qr-api/qr-api-guide/) for more details.
contact:
name: Vipps MobilePay
url: 'https://developer.vippsmobilepay.com/docs/contact/'
servers:
- url: 'https://api.vipps.no/qr'
description: 'Production environment (uses the production API keys, the official app and live data)'
- url: 'https://apitest.vipps.no/qr'
description: 'Test environment (uses the test API keys, the test app and test data)'
paths:
/v1:
parameters: []
post:
summary: Create One Time Payment QR
operationId: generateOtpQr
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/OneTimePaymentQrResponse'
'400':
$ref: '#/components/responses/400BadRequest'
'401':
description: Unauthorized
'415':
$ref: '#/components/responses/415UnsupportedMediaType'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/OneTimePaymentQrRequest'
description: ''
description: 'Endpoint for generating a Vipps MobilePay QR for a merchant payment. Given a valid `vippsLandingPageUrl`, this endpoint will return a QR for that payment.'
parameters:
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/Size'
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
tags:
- One time payment QR
/v1/merchant-redirect:
post:
summary: Create merchant redirect QR
operationId: CreateMerchantRedirectQr
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/MerchantRedirectQrResponse'
'400':
$ref: '#/components/responses/400BadRequest'
'401':
description: Unauthorized
'409':
$ref: '#/components/responses/409Conflict'
'415':
$ref: '#/components/responses/415UnsupportedMediaType'
description: Generate a QR that works as a redirect back to the merchant
parameters:
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
- $ref: '#/components/parameters/Size'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MerchantRedirectQrRequest'
description: ''
tags:
- Merchant redirect QR
parameters: []
get:
summary: Get all merchant redirect QRs
operationId: GetAllMerchantRedirectQrs
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/MerchantRedirectQrResponseGetAll'
'401':
description: Unauthorized
description: Get all merchant redirect QRs for this saleunit
tags:
- Merchant redirect QR
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/Size'
'/v1/merchant-redirect/{id}':
put:
summary: Update redirectUrl for merchant redirect QR
operationId: UpdateMerchantRedirectUrl
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/MerchantRedirectQrResponse'
'400':
$ref: '#/components/responses/400BadRequest'
'401':
description: Unauthorized
'404':
$ref: '#/components/responses/404NotFound'
'415':
$ref: '#/components/responses/415UnsupportedMediaType'
description: Update the redirect url (target destination) of the QR
tags:
- Merchant redirect QR
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MerchantRedirectQrUpdateRequest'
parameters:
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
- $ref: '#/components/parameters/Size'
delete:
summary: Delete merchant redirect QR
operationId: DeleteMerchantRedirectQr
responses:
'200':
description: OK
'401':
description: Unauthorized
'404':
$ref: '#/components/responses/404NotFound'
description: Delete merchant redirect QR
tags:
- Merchant redirect QR
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
- $ref: '#/components/parameters/Size'
parameters:
- schema:
type: string
name: id
in: path
required: true
description: The unique ID for QR
get:
summary: Get merchant redirect QR by ID
operationId: GetMerchantRedirectQrById
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/MerchantRedirectQrResponse'
'401':
description: Unauthorized
'404':
$ref: '#/components/responses/404NotFound'
description: Get merchant redirect QR by ID
tags:
- Merchant redirect QR
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
- $ref: '#/components/parameters/Accept'
- $ref: '#/components/parameters/Size'
/v1/merchant-callback:
get:
summary: Get all merchant callback QRs
operationId: GetMerchantCallbackQrs
responses:
'200':
description: OK
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/MerchantCallbackQr'
examples:
Example 1:
value:
- merchantSerialNumber: '12345'
merchantQrId: 27072f82-c4b6-49cd-9838-10f21d87496e
locationDescription: Kasse 1
qrImageUrl: 'https://qr.vipps.no/generate/qr.png?...'
qrContent: 'https://qr.vipps.no/...'
'400':
$ref: '#/components/responses/400BadRequest'
'401':
description: Unauthorized
'403':
$ref: '#/components/responses/403Forbidden'
'500':
description: Internal Server Error
description: Returns all QR codes that matches the provided Merchant-Serial-Number.
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number-Required'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
- $ref: '#/components/parameters/QrImageFormat'
- $ref: '#/components/parameters/QrImageSize'
tags:
- Merchant callback QR
parameters: []
'/v1/merchant-callback/{merchantQrId}':
get:
summary: Get callback QR by ID
operationId: GetMerchantCallbackById
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/MerchantCallbackQr'
examples:
Example 1:
value:
merchantSerialNumber: '12345'
merchantQrId: 27072f82-c4b6-49cd-9838-10f21d87496e
locationDescription: Kasse 1
qrImageUrl: 'https://qr.vipps.no/generate/qr.png?...'
qrContent: 'https://qr.vipps.no/...'
'400':
$ref: '#/components/responses/400BadRequest'
'401':
description: Unauthorized
'403':
$ref: '#/components/responses/403Forbidden'
'404':
description: Not Found
'500':
description: Internal Server Error
description: Returns the QR code represented by the merchantQrId and Merchant-Serial-Number provided in the path and header respectively. The image format and size of the QR code is defined by the Accept and Size headers respectively.
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number-Required'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
- $ref: '#/components/parameters/QrImageFormat'
- $ref: '#/components/parameters/QrImageSize'
tags:
- Merchant callback QR
put:
summary: Create or update callback QR
operationId: PutMerchantCallbackQr
description: |-
Note: MobilePay integrators that needs to migrate existing QRs cannot use this endpoint. They must use the dedicated endpoint: [PUT /v1/merchant-callback/mobilepay/{beaconId}](https://developer.vippsmobilepay.com/api/qr/#tag/Merchant-callback-QR/operation/PutMerchantCallbackMobilePayQr)
Creates or updates the QR code that encapsulates the provided `merchantSerialNumber` and `merchantQrId`.
See [Webhooks API](https://developer.vippsmobilepay.com/docs/APIs/webhooks-api) to create a webhook that will send callbacks when this QR code is scanned by a Vipps or MobilePay user.
If the endpoint is called with the same `merchantQrId` twice or more, it is the last call that defines the location property.
The actual QR code image will not be updated on consecutive calls.
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number-Required'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
responses:
'200':
description: OK
'400':
$ref: '#/components/responses/400BadRequest'
'401':
description: Unauthorized
'403':
$ref: '#/components/responses/403Forbidden'
'500':
description: Internal Server Error
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MerchantCallbackPutRequest'
examples:
Example 1:
value:
locationDescription: Kasse 1
description: ''
tags:
- Merchant callback QR
parameters:
- schema:
type: string
name: merchantQrId
in: path
required: true
description: The merchant defined identifier for a QR code.
delete:
summary: Delete callback QR
operationId: DeleteMerchantCallbackQr
responses:
'200':
description: OK
'400':
$ref: '#/components/responses/400BadRequest'
'401':
description: Unauthorized
'403':
$ref: '#/components/responses/403Forbidden'
'404':
$ref: '#/components/responses/404NotFound'
'500':
description: Internal Server Error
description: Deletes the QR code that matches the provided merchantQrId and merchantSerialNumber.
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number-Required'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
tags:
- Merchant callback QR
'/v1/merchant-callback/mobilepay/{beaconId}':
put:
summary: Create or update MobilePay QR code
operationId: PutMerchantCallbackMobilePayQr
description: |-
This endpoint is for migrating existing MobilePay PoS QR codes from the current solution that will end its lifetime.
It is meant for merchants that have printed QR codes and want them to stay functional for the new product offering
that will replace the now deprecated solution.
This endpoint will not create a new QR code but rather map the provided `beaconId` with the Merchant-Serial-Number,
to make sure the already printed QR code can be re-used.
When the QR code is scanned by MobilePay users, it will result in a callback being sent to the merchant
if the merchant has registered a [webhook](/docs/APIs/webhooks-api)
for the `user.checked-in.v1` event.
The callback will include a `MerchantQrId` which in this scenario will equal the beaconId.
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number-Required'
- $ref: '#/components/parameters/Vipps-System-Name'
- $ref: '#/components/parameters/Vipps-System-Version'
- $ref: '#/components/parameters/Vipps-System-Plugin-Name'
- $ref: '#/components/parameters/Vipps-System-Plugin-Version'
responses:
'200':
description: OK
'400':
$ref: '#/components/responses/400BadRequest'
'401':
description: Unauthorized
'403':
$ref: '#/components/responses/403Forbidden'
'409':
$ref: '#/components/responses/409Conflict'
'500':
description: Internal Server Error
tags:
- Merchant callback QR
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/MerchantCallbackMobilePayPutRequest'
examples:
Example 1:
value:
locationDescription: Kasse 1
description: ''
parameters:
- schema:
type: string
name: beaconId
in: path
required: true
description: The MobilePay PoS BeaconId
/v1/exchange:
post:
summary: Exchange user presented QR code for data
operationId: exchangeQr
tags:
- QR Exchange
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/QrExchangeRequest'
examples:
Example 1:
value:
qrCode: 'https://qr.vipps.no/p/qwjhewqhueheuqwhuqwhe'
Example 2:
value:
qrCode: 'https://qr.vipps.no/p/qwjhewqhueheuqwhuqwhe'
requestedData:
- MSISDN
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/QrExchangeResponse'
examples:
Version 2.0 example:
value:
msisdn: '4798765432'
timestamp: 1634025600
version: '2.0'
Version 1.0 example:
value:
msisdn: '4798765432'
version: '1.0'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/QrExchangeErrorResponse'
examples:
Example 1:
value:
title: Bad request
status: 400
detail: The request body contains one or more invalid parameters.
extraDetails:
- name: qrCode
reason: The complete data contained in the QR code is required.
'401':
description: Unauthorized
'500':
description: Internal Server Error
/v1/exchange/customer:
post:
summary: Exchange customer for data, for example customerToken received on webhook.
operationId: exchangeCustomer
tags:
- Customer Exchange
parameters:
- $ref: '#/components/parameters/Authorization'
- $ref: '#/components/parameters/Ocp-Apim-Subscription-Key'
- $ref: '#/components/parameters/Merchant-Serial-Number'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CustomerExchangeRequest'
examples:
Simple example:
value:
customer:
customerToken: 'eyJra'
requestedData:
- MSISDN
responses:
'200':
description: Successful operation
content:
application/json:
schema:
$ref: '#/components/schemas/CustomerExchangeResponse'
examples:
Example for requested data MSISDN:
value:
msisdn: '4798765432'
timestamp: 1634025600
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/CustomerExchangeErrorResponse'
examples:
Example missing customer object:
value:
title: Bad request
status: 400
detail: The request body contains one or more invalid parameters.
extraDetails:
- name: customer
reason: Customer object is required.
'401':
description: Unauthorized
'500':
description: Internal Server Error
components:
schemas:
OneTimePaymentQrRequest:
title: OneTimePaymentQrRequest
type: object
description: ''
x-examples:
example-1:
url: 'https://api.vipps.no/dwo-api-application/v1/deeplink/vippsgateway?v=2&token=eyJraWQiO....'
properties:
url:
type: string
description: 'Url to the Vipps landing page, obtained from ecom/recurring apis'
example: ' https://api.vipps.no/dwo-api-application/v1/deeplink/vippsgateway?v=2&token=eyJraWQiO....'
required:
- url
OneTimePaymentQrResponse:
title: OneTimePaymentQrResponse
type: object
x-examples: {}
description: ''
properties:
url:
type: string
description: Link to QR image
example: 'https://qr.vipps.no/generate/qr.png?...'
expiresIn:
type: integer
description: How many seconds more this QR will be active
example: 544
required:
- url
- expiresIn
QrErrorResponse:
title: QrErrorResponse
type: object
x-examples:
example-1:
title: Order timeout
detail: Payment has already timed out
instance: 3cff3564-4a14-4481-8dbb-431087753eed
example-2:
title: Validation error
detail: Supplied landing page token is not valid
instance: 3cff3564-4a14-4481-8dbb-431087753eed
Validation error:
type: 'https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1'
title: One or more validation errors occurred.
detail: BadRequest
instance: 00-616e415f5af7584eb4d9369d0fe8d7cc-48b90041faff204c-00
invalidParams:
- name: RedirectUrl
reason: 'The field RedirectUrl must match the regular expression ''^https://[\w\.]+([\w#!:.?+=&%@\-/]+)?$''.'
properties:
type:
type: string
minLength: 1
title:
type: string
minLength: 1
detail:
type: string
minLength: 1
instance:
type: string
minLength: 1
invalidParams:
type: array
items:
type: object
properties:
name:
type: string
minLength: 1
reason:
type: string
minLength: 1
required:
- name
- reason
required:
- title
- detail
- instance
MerchantRedirectQrRequest:
title: MerchantRedirectQrRequest
type: object
x-examples: {}
properties:
id:
type: string
description: Merchant supplied Id for QR
example: billboard_1
pattern: '^[-_+%æøåÆØÅ\w\s]*$'
maxLength: 128
minLength: 1
nullable: true
redirectUrl:
type: string
format: uri
description: The target url of the QR (redirect destination)
pattern: '^https:\/\/[\w\.]+([\w#!:.?+=&%@\-\/]+)?$'
example: 'https://example.com/myProduct'
nullable: true
ttl:
type: integer
description: 'Optional time-to-live field, given in seconds'
example: 600
minimum: 300
maximum: 2147483647
nullable: true
required:
- id
- redirectUrl
MerchantRedirectQrResponse:
title: MerchantRedirectQrResponse
type: object
x-examples: {}
properties:
id:
type: string
description: Merchant supplied Id for QR
example: billboard_1
pattern: '^[-_+%æøåÆØÅ\w\s]*$'
url:
type: string
format: uri
description: Link to QR image
example: 'https://qr.vipps.no/generate/qr.png?...'
redirectUrl:
type: string
format: uri
description: The target url of the QR (redirect destination)
pattern: '^https:\/\/[\w\.]+([\w#!:.?+=&%@\-\/]+)?$'
example: 'https://example.com/myProduct'
expiresIn:
type: integer
description: Time in seconds until expiration. -1 means no expiration (infinite QR code)
example: 598
required:
- id
- url
- redirectUrl
MerchantRedirectQrResponseGetAll:
title: MerchantRedirectQrResponseGetAll
x-examples: {}
type: array
items:
$ref: '#/components/schemas/MerchantRedirectQrResponse'
MerchantRedirectQrUpdateRequest:
title: MerchantRedirectQrUpdateRequest
type: object
description: Model for put-requests
properties:
redirectUrl:
type: string
format: uri
pattern: '^https:\/\/[\w\.]+([\w#!:.?+=&%@\-\/]+)?$'
example: 'https://example.com/myProduct'
required:
- redirectUrl
MerchantCallbackPutRequest:
title: MerchantCallbackPutRequest
type: object
x-examples:
Example 1:
locationDescription: Kasse 1
properties:
locationDescription:
type: string
description: 'A description of where the QR code will be located. It will be shown in the app when a user scans the QR code. Examples could be ‘Kasse 1’ , ‘Kiosk’ or ‘Platform 3’.'
maxLength: 36
required:
- locationDescription
MerchantCallbackMobilePayPutRequest:
title: MerchantCallbackMobilePayPutRequest
type: object
x-examples:
Example 1:
locationDescription: Kasse 1
properties:
locationDescription:
type: string
description: 'A description of where the QR code will be located. This corresponds to the PoS name field from the old MobilePay V10 API. It will be shown in the app when a user scans the QR code. Examples could be ‘Kasse 1’ , ‘Kiosk’ or ‘Platform 3’.'
maxLength: 36
required:
- locationDescription
MerchantCallbackQr:
title: MerchantCallbackQr
type: object
description: 'A representation of a QR code. It contains all the three properties that was provided when creating the QR code, in addition to a link pointing to the actual QR code itself.'
x-examples:
Example 1:
merchantSerialNumber: '12345'
merchantQrId: 27072f82-c4b6-49cd-9838-10f21d87496e
locationDescription: Kasse 1
qrImageUrl: 'https://qr.vipps.no/generate/qr.png?...'
qrContent: 'https://qr.vipps.no/...'
properties:
merchantSerialNumber:
type: string
description: The merchant serial number (MSN) for the sale unit
merchantQrId:
type: string
description: The merchant defined identifier for a QR code. It will be provided in the callback to the merchant when the QR code has been scanned.
locationDescription:
type: string
description: 'A description of where the QR code will be located. It will be shown in the app when a user scans the QR code. Examples could be ‘Kasse 1’ , ‘Kiosk’ or ‘Platform 3’.'
qrImageUrl:
type: string
description: The link to the actual QR code.
format: uri
example: 'https://qr.vipps.no/generate/qr.png?...'
qrContent:
type: string
description: The text that is being encoded by the QR code. This is the actual content of the QR code.
QrExchangeRequest:
type: object
description: The request body for the QR exchange endpoint. This endpoint is used to exchange information about a QR code that has been scanned by a Vipps user.
required:
- qrCode
properties:
qrCode:
type: string
description: The complete content of the QR code.
requestedData:
type: array
items:
$ref: '#/components/schemas/RequestedData'
default:
- MSISDN
QrExchangeResponse:
type: object
properties:
msisdn:
type: string
description: The MSISDN of the user presenting the QR code.
timestamp:
type: integer
description: The UTC timestamp in seconds when the QR code was generated. Only available for version 2.0 QR codes.
version:
type: string
description: 'Version of the QR code format. There are two versions: 1.0 and 2.0. Version 1.0 is the old format, and version 2.0 is the new format.'
required:
- msisdn
- version
CustomerExchangeRequest:
type: object
description: The request body for the QR exchange endpoint. This endpoint is used to exchange information about a QR code that has been scanned by a Vipps user.
required:
- customer
- requestedData
properties:
customer:
type: object
properties:
customerToken:
type: string
description: The customer identifier.
requestedData:
type: array
items:
$ref: '#/components/schemas/RequestedData'
default:
- MSISDN
CustomerExchangeResponse:
type: object
properties:
msisdn:
type: string
description: The MSISDN of the user presenting the QR code.
timestamp:
type: integer
description: The UTC timestamp in seconds when the QR code was generated. Only available for version 2.0 QR codes.
required:
- msisdn
RequestedData:
type: string
description: Which data fields the merchant wants to receive from the QR exchange. Currently only MSISDN is supported.
enum:
- MSISDN
QrExchangeErrorResponse:
type: object
required:
- title
- status
- detail
properties:
title:
type: string
description: 'A short, human-readable summary of the problem type.'
status:
type: integer
format: int32
description: The HTTP status code associated with the error.
detail:
type: string
description: A human-readable explanation of the specific problem.
extraDetails:
type: array
items:
type: object
required:
- name
- reason
properties:
name:
type: string
description: The name of the invalid parameter.
reason:
type: string
description: The reason why the parameter is invalid.
CustomerExchangeErrorResponse:
type: object
required:
- title
- status
- detail
properties:
title:
type: string
description: 'A short, human-readable summary of the problem type.'
status:
type: integer
format: int32
description: The HTTP status code associated with the error.
detail:
type: string
description: A human-readable explanation of the specific problem.
extraDetails:
type: array
items:
type: object
required:
- name
- reason
properties:
name:
type: string
description: The name of the invalid parameter.
reason:
type: string
description: The reason why the parameter is invalid.
x-examples:
example-1:
title: Bad request
status: 400
detail: The request body contains one or more invalid parameters.
extraDetails:
- name: qrCode
reason: The complete data contained in the QR code is required.
securitySchemes:
BearerToken:
type: http
scheme: bearer
parameters:
Merchant-Serial-Number:
name: Merchant-Serial-Number
in: header
required: false
schema:
type: string
description: 'The merchant serial number (MSN) for the sales unit. Partners and PSP merchants must always send the Merchant-Serial-Number header, and we recommend that everyone sends it, also when using the merchant''s own API keys. The Merchant-Serial-Number header can be used with all API keys, and can speed up any trouble-shooting of API problems quite a bit.'
Merchant-Serial-Number-Required:
name: Merchant-Serial-Number
in: header
required: true
schema:
type: string
description: 'The merchant serial number (MSN) for the sales unit. See [API keys](https://developer.vippsmobilepay.com/docs/knowledge-base/api-keys/).'
Ocp-Apim-Subscription-Key:
name: Ocp-Apim-Subscription-Key
in: header
required: true
schema:
type: string
description: 'The subscription key for a sales unit. See [API keys](https://developer.vippsmobilepay.com/docs/knowledge-base/api-keys/).'
Authorization:
name: Authorization
in: header
required: true
schema:
type: string
description: 'The access token is a base64-encoded string that is required for all API calls. It is a JWT (JSON Web Token). The access token is fetched from the [`POST:/accesstoken/get`](https://developer.vippsmobilepay.com/api/access-token#tag/Authorization-Service/operation/fetchAuthorizationTokenUsingPost) endpoint. It is valid for 1 hour in the test environment and 24 hours in the production environment.'
Accept:
name: Accept
in: header
required: true
schema:
type: string
enum:
- image/*
- image/png
- image/svg+xml
- text/targetUrl
description: 'Requested image format. Supported values: {image/*,image/png, image/svg+xml, text/targetUrl}'
QrImageFormat:
name: QrImageFormat
in: query
required: false
schema:
type: string
enum:
- PNG
- SVG
description: 'Requested image format. Supported values: {PNG, SVG}. If not provided, SVG is chosen.'
QrImageSize:
name: QrImageSize
in: query
required: false
schema:
type: integer
minimum: 100
maximum: 2000
description: 'Eks: 200. Then 200x200 px is set at dimension for the QR. Only relevant if PNG is chosen as image format.'
Size:
name: Size
in: header
required: false
schema:
type: integer
minimum: 100
maximum: 2000
description: 'Eks: 200. Then 200x200 px is set at dimension for the QR'
Vipps-System-Name:
name: Vipps-System-Name
in: header
description: |-
The name of the ecommerce solution.
One word in lowercase letters is good.
See [http-headers](https://developer.vippsmobilepay.com/docs/knowledge-base/http-headers).
schema:
type: string
maxLength: 30
example: WooCommerce
Vipps-System-Version:
name: Vipps-System-Version
in: header
description: |-
The version number of the ecommerce solution.
See [http-headers](https://developer.vippsmobilepay.com/docs/knowledge-base/http-headers).
schema:
type: string
maxLength: 30
example: 5.4.0
Vipps-System-Plugin-Name:
name: Vipps-System-Plugin-Name
in: header
description: |-
The name of the ecommerce plugin (if applicable).
One word in lowercase letters is good.
See [http-headers](https://developer.vippsmobilepay.com/docs/knowledge-base/http-headers).
schema:
type: string
maxLength: 30
example: woocommerce-payment
Vipps-System-Plugin-Version:
name: Vipps-System-Plugin-Version