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.
This API can only be tested on the production server, https://api.vipps.no and not in the test environment.
Partner keys must be kept secret. They can be used to act on behalf of all the partner's merchants. It is your responsibility to manage the partner keys securely.
Get information about your merchant sales units
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.
You will use the production server: https://api.vipps.no.
Get keys for a production sales unit (How to find the API keys):
client-id
- Partner key is required for getting the access token.client-secret
- Partner key is required for getting the access token.Ocp-Apim-Subscription-Key
- Partner subscription key is required for all requests.merchantSerialNumber
- The unique ID for a test sales unit. Merchant ID is only required forGet sales unit details based on MSN
, but can be included in all headers.orgno
-The Organization number for the merchant.
- curl
- Postman
🔥 Do not store production keys in the Postman cloud. 🔥
To prevent your sensitive data and credentials from being synced to the Postman cloud, store them in the Current Value fields of your Postman environment.
Open Postman and do the following:
-
Import the following files:
-
Select to use the imported global environment.
-
In the global environment, update only the Current Value field with your own values for the following:
client-id
client-secret
Ocp-Apim-Subscription-Key
merchantSerialNumber
orgno
base_url_production
(set tohttps://api.vipps.no
)
No additional setup needed :)
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.
Use the address to the production server (https://api.vipps.no) and your keys for a production sales unit.
- curl
- Postman
Send request Get Access Token
curl -X POST 'https://api.vipps.no/accesstoken/get' \
-H "Content-Type: application/json" \
-H 'client_id: YOUR-PRODUCTION-CLIENT-ID' \
-H 'client_secret: YOUR-PRODUCTION-CLIENT-SECRET' \
-H 'Ocp-Apim-Subscription-Key: YOUR-PRODUCTION-SUBSCRIPTION-KEY' \
-H 'Merchant-Serial-Number: YOUR-PRODUCTION-MSN' \
--data ''
When a partner uses partner keys
for requests that are not for a specific merchant,
the Merchant-Serial-Number
can be omitted.
The property access_token
should be used for all other API requests in the Authorization
header as the Bearer token.
For more information, see Access token API.
Step 3 - Get merchant sales units by business identifier
Send request
GET:/management/v1/merchants/{scheme}/{id}/sales-units
,
where scheme
is the type of organization identifier (e.g., business:NO:ORG
, business:DK:CVR
, business:FI:Y-tunnus
).
The id
is used for identifying the merchant. For Norwegian companies, this is the organization number.
- curl
- Postman
Send request Get merchant by business identifier
curl -X GET https://api.vipps.no/management/v1/merchants/business:NO:ORG/{id}/sales-units \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY' \
Take note of the merchant serial numbers returned and use one of these in the next step.
Step 4 - Get sales unit by Merchant Serial Number
Send request
GET:/management/v1/sales-units/{msn}
, where msn
is the Merchant Serial Number.
This returns a JSON structure with the details, including the org number.
- curl
- Postman
Send request Get sales unit details based on MSN
If necessary, update msn
in the environment.
curl -X GET https://api.vipps.no/management/v1/sales-units/{msn} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY' \
See Get information about a sales unit for more information.
Next steps
See the Management API guide to read about the concepts and details.