Quick start
Before you begin
The provided example values in this guide must be changed with the values for your sales unit and user. This applies for API keys, HTTP headers, reference, phone number, etc.
Your first check-in notification
Be aware that these are running on the production server, https://api.vipps.no.
Step 1 - Setup
You must have already signed up as an organization with Vipps MobilePay and have your test credentials from the merchant portal. See Getting started guide for help.
Get these API key values for your sales unit:
client_id
- Client_id for a test sales unit.client_secret
- Client_id for a test sales unit.Ocp-Apim-Subscription-Key
- The subscription key for a test sales unit.Merchant-Serial-Number
- The unique ID for a test sales unit.
You will also need:
internationalMobileNumber
- The MSISDN for your test user.
Step 2 - Authentication
For all the following, you will need an access_token
from the
Access token API:
POST:/accesstoken/get
.
This provides you with access to the API.
curl -X POST 'https://apitest.vipps.no/accesstoken/get' \
-H "Content-Type: application/json" \
-H 'client_id: YOUR-CLIENT-ID' \
-H 'client_secret: YOUR-CLIENT-SECRET' \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY' \
-H 'Merchant-Serial-Number: YOUR-MSN' \
-H 'Vipps-System-Name: YOUR-SYSTEM-NAME' \
-H 'Vipps-System-Version: YOUR-SYSTEM-VERSION' \
-H 'Vipps-System-Plugin-Name: YOUR-PLUGIN-NAME' \
-H 'Vipps-System-Plugin-Version: YOUR-PLUGIN-VERSION' \
--data ''
For an explanation of the headers, see HTTP headers.
The property access_token
should be used for all other API requests in the Authorization
header as the Bearer token.
Step 3 - Open your Vipps app
Open your Vipps app to be able to see the notification.
Step 4 - Your Check-in notification
Initiate a notification with: POST:/point-of-sale/v1/loyalty-check-in
.
When your mobile number
is provided in phoneNumber
, it will be prefilled in the form.
curl -X POST 'https://apitest.vipps.no/point-of-sale/v1/loyalty-check-in' \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H "Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY" \
-H "Merchant-Serial-Number: YOUR-MSN" \
-H "Vipps-System-Name: acme" \
-H "Vipps-System-Version: 3.1.2" \
-H "Vipps-System-Plugin-Name: acme-webshop" \
-H "Vipps-System-Plugin-Version: 4.5.6" \
-d '{
"phoneNumber": 4712345678,
"isMember": true
}'
The check-in screen should show.
Please note: If you use "isMember": false
, nothing will happen. This is the expected behavior.
Next Steps
See Check-in API guide to read about the concepts and details.