Quick start
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.
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 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.
You will use the production server: https://api.vipps.no.
- curl
- Postman
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
base_url_production
(set tohttps://api.vipps.no
)
🔥 Do not store API 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.
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.
No additional setup needed for curl. For Postman, click the Postman tab 👆.
Step 2 - Get an access token
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.
For more information, see Access token API.
Use the address to the production server (https://api.vipps.no) and your keys for a production sales unit.
- Merchants
- Management partners
For merchants using their API keys with curl
Merchants use the API keys for each of their sales units with the Access token API: Access token endpoint.
Example request to
POST:/accesstoken/get
:
curl -X POST 'https://api.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' \
--data ''
The property access_token
should be used as the Bearer token in the Authorization
header of all the following API requests.
For merchants using their API keys with postman
Send request "Get Access Token"
For partners using management keys
Partners use management keys with the Partner specialized authentication.
The value for authorization is a string representing your Base64-encoded accounting keys, client_id
and client_secret
.
Example of how to convert your client_id
and client_secret
to base64 with JavaScript:
const clientId = 'YOUR-CLIENT-ID';
const clientSecret = 'YOUR-CLIENT-SECRET';
const base64Credentials = btoa(`${clientId}:${clientSecret}`);
console.log(base64Credentials);
Provide the Base64-encoded value in the Authorization
heading in a request to
POST:/miami/v1/token
:
curl -X POST https://api.vipps.no/miami/v1/token \
-H 'Authorization: Basic <YOUR-BASE64-ENCODED-VALUE>' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
-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' \
--data-urlencode 'grant_type=client_credentials'
You must include the last line with 'grant_type=client_credentials'
, or
you'll get an invalid_client
error.
The Ocp-Apim-Subscription-Key
HTTP header should not be sent.
An access token will be returned. It is valid for 15 minutes.
Step 3 - Get a list of all your sales units
Get a list of the sales units a merchant or partner has access to. For partners using partner keys, you will get a long list of all sales units registered with you.
Request
GET:/management/v1/sales-units
returns an array where each element includes JSON data (i.e., name and merchant serial number) for a sales unit.
See API guide: Get all sales units for more information.
- curl
- Postman
Send request: "Sales Units > Get all sales units"
The first MSN is saved to the environment as mgmt_msn
, for use in the next step.
curl -X GET https://api.vipps.no/management/v1/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 details for a sales unit
Get the information about a sales unit by sending
GET:/management/v1/sales-units/{msn}
, where msn
is the Merchant Serial Number.
This returns a JSON structure with the details, including the business identifier ID and scheme. See API guide: Get information about a sales unit for more information.
- curl
- Postman
Send request: "Sales Units > Get sales unit details based on MSN"
The business_scheme
and business_id
are saved to the environment for use in the next step.
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'
Take note of the business_scheme
and business_id
for use in the next steps.
Step 5 - Get a specific merchant's sales units
Get a list of sales units (MSNs) for a merchant by sending
GET:/management/v1/merchants/{scheme}/{id}/sales-units
.
The 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.
When used by a partner, this only returns the sales units connected to the partner.
- curl
- Postman
Send request: "Merchants > Get sales units by business identifier"
The values for business_scheme
and business_id
were set in the environment in the previous steps.
curl -X GET https://api.vipps.no/management/v1/merchants/{scheme}/{id}/sales-units \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY'
Use one of the values for business_scheme
and business_id
that you received in a response
in the previous steps.
Step 6 - Get a merchant's details by business identifier
Get basic information about a merchant by sending
GET:/management/v1/merchants/{scheme}/{id}
.
The 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.
See API guide: Get one merchant by business identifier for details.
- curl
- Postman
Send request: "Merchants > Get a merchant by business identifier"
curl -X GET https://api.vipps.no/management/v1/merchants/{scheme}/{id} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY'
Use one of the values for business_scheme
and business_id
that you received in a response
in the previous steps.
There are strict rules for what information Vipps MobilePay is allowed to share with a partner, as this requires active consent from the merchant, and the merchant must also be able to withdraw the consent.
Step 7 - Get a list of product orders
Get a list of the product orders that are connected to you as a partner
Request
GET:/management/v2/product-orders
returns an array where each element includes JSON data (i.e., product order ID, status, business identifier) for a product order.
//todo
See API guide: Get a list of product orders for more information.
- curl
- Postman
Send request: "Product orders > Get a list of product orders"
curl -X GET https://api.vipps.no/management/v2/product-orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY'
Step 8 - Prefill a product order on behalf of a merchant
Submit data that prefills the order form on portal.vippsmobilepay.com, so the merchant doesn't have to do more than review the information and submit the product order.
Provide the data with request
POST:/management/v1/product-orders
.
See API guide: Prefill a product order for more information.
- curl
- Postman
Send request: "Product orders > Prefill a product order on behalf of a merchant"
The prefilledOrderId
is stored in the environment for use in the next steps.
curl -X POST https://api.vipps.no/management/v1/product-orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY' \
-H 'Idempotency-key: UNIQUE-IDEMPOTENCY-KEY' \
--data '{
"businessIdentifier": {
"scheme": "{business_scheme}",
"id": "{business_id}"
},
"productType": "CHECKOUT"
}'
Use one of the values for business_scheme
and business_id
that you received in
one of the above examples.
Supply an Idempotency_Key
in the header field to prevent duplicate requests.
When you get the successful response, take note of the prefilledOrderId
.
You will need it in the next steps.
Step 9 - Get information about a product order
Send request
GET:/management/v2/product-orders/{productOrderId}/details
,
where productOrderId
is the ID of the product order.
See API guide: Get information about a product order for more information.
- curl
- Postman
Send request: "Product orders > Get information about a product order"
The {productOrderId}
was saved in the Postman environment in the previous steps.
curl -X GET https://api.vipps.no/management/v2/product-orders/{productOrderId}/details \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY'
Use the value for productOrderId
that you received in response in the previous steps.
Step 10 - Delete a prefilled product order
Send request
DELETE:/management/v1/product-orders/{prefilledProductOrderId}
,
where prefilledProductOrderId
is the ID of the prefilled product order.
See API guide: Delete a product order for more information.
- curl
- Postman
Send request: "Product orders > Delete a prefilled product order"
The {prefilledProductOrderId}
was saved in the Postman environment in the previous step.
curl -X DELETE https://api.vipps.no/management/v1/product-orders/{prefilledProductOrderId} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY'
Use the value for prefilledProductOrderId
that you received in response in the previous step.
Step 11 - Get price packages
This endpoint enables partners to get an overview of their price packages.
Send request
GET:/management/v1/partners/price-packages
,
where prefilledProductOrderId
is the ID of the prefilled product order.
You must get the access token using partner keys.
- curl
- Postman
Send request: "Partners > Get price packages for a partner"
curl -X GET https://api.vipps.no/management/v1/partners/price-packages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H 'Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY'
Next steps
See the Management API guide for more details about the above endpoints.