Quick start
Use the QR API to generate QR codes that redirect the user back to a URL. You can get a list of all QR codes or delete a QR. If needed, you can update the redirect URL at a later time.
Postman
Prerequisites
Review Vipps quick start guides for information about getting your test environment set up.
Step 1: Get the Postman collection and environment
Save the following files to your computer:
Step 2: Import the Postman files
- In Postman, click Import in the upper-left corner.
- In the dialog that opens, with File selected, click Upload Files.
- Select the two files you have just downloaded and click Import.
Step 3: Set up Postman environment
- Click the down arrow, next to the "eye" icon in the top-right corner, and select the environment you have imported.
- Click the "eye" icon and, in the dropdown window, click
Edit
in the top-right corner. - Fill in the
Current Value
for the following fields to get started. For the first three keys, go to Vipps Portal > Utvikler -> Test Keys.client_id
- Merchant key is required for getting the access token.client_secret
- Merchant key is required for getting the access token.Ocp-Apim-Subscription-Key
- Merchant subscription key.merchantSerialNumber
- Merchant id.mobileNumber
- The mobile number for the test app profile you have received or registered.
Make API calls
For all of the following, you will start by sending request Get Access Token
.
This provides you with access to the API.
The access token is valid for 1 hour in the test environment and 24 hours in the production environment. See the API reference for details about the calls.
A Merchant redirect QR
Under the Merchant Redirect QR folder:
Send request
Generate QR
.This creates a QR that works as a redirect back to the merchant. The website is specified as the
redirectUrl
in thePOST:/qr/v1/merchant-redirect
request.The
qr-id
variable is now set in the environment for use with subsequent calls.Ctrl+click the link to see the QR code. Scanning the QR should open the website on your phone.
Please note: The result from Generate QR provides a url with its own JWT token. This token will expire. If so, get a new token by calling
Get QR
.Send request
Get QR by id
.This gets the QR for the specified
qr-id
inGET:/qr/v1/merchant-redirect/{{qr-id}}
.Ctrl+click the link to see the QR code. When you scan it, it will take you to the specified URL.
Send request
Update redirectUrl by id
.This changes the URL for the QR code with the specified
qr-id
inPUT:/qr/v1/merchant-redirect/{{qr-id}}
.Send request
Delete QR by id
.This deletes the QR code with the specified
qr-id
inDEL:/qr/v1/merchant-redirect/{{qr-id}}
.Send request
Get all QRs
.This gets all the QRs by calling
GET:/qr/v1/merchant-redirect
request.
See the QR API Specifications for details about the calls.
One-Time Payments
Under the One-Time Payment QR folder:
Send request
Initiate Payment
.This uses
POST:/ecomm/v2/payments
orPOST:/v3/psppayments/init/
from the Vipps eComm API.The
orderId
andvippsLandingPageUrl
variables are now in the environment of this Postman exampleSend request
Generate OTP QR
. This suppliesvippsLandingPageUrl
toPOST:/qr/v1
to provide a url that can be used to show a QR code.Ctrl+click the link to see the QR code. Scanning the QR should open the test app on your phone and allow you to complete the one-time purchase.