Quick start
Before you begin
Please note: The Report API is not available in the test environment. See Limitations of the test environment.
Be aware that the API requests mentioned here are running on the production server, https://api.vipps.no.
🔥 To reduce the risk of exposure, never store production API keys in Postman or any similar tools. 🔥
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.
Getting your ledgers
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 sales unit.client_secret
- client_id for a sales unit.Ocp-Apim-Subscription-Key
- Subscription key for a sales unit (not required for accounting partners)merchantSerialNumber
- The unique ID for a sales unit.
Step 2 - Authentication
All the API endpoints require that you first obtain an API token.
It's possible to authenticate both as a merchant and as an accounting partner. See: Authenticating to the Report API.
For accounting partners using accounting keys
Accounting partners use accounting keys. See:
Access token API: Token endpoint
and
POST:/miami/v1/token
.
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: acme' \
-H 'Vipps-System-Version: 3.1.2' \
-H 'Vipps-System-Plugin-Name: acme-webshop' \
-H 'Vipps-System-Plugin-Version: 4.5.6' \
--data ''
Replace the value of the Vipps-System
headers with your own values.
See HTTP headers for more details.
When a partner uses
partner keys
for requests that are not for a specific merchant,
the Merchant-Serial-Number
can be omitted.
The <base64_encoded_credentials>
is the string <client_id>:<client_secret>
encoded to Base64.
The Merchant-Serial-Number
header is not required for accounting partners.
For merchants using their own API keys
Merchants use the API keys for each of their sales units. See:
Access token API: Access token endpoint
and
POST:/accesstoken/get
.
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: acme' \
-H 'Vipps-System-Version: 3.1.2' \
-H 'Vipps-System-Plugin-Name: acme-webshop' \
-H 'Vipps-System-Plugin-Version: 4.5.6' \
--data ''
Replace the value of the Vipps-System
headers with your own values.
See HTTP headers for more details.
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
must be used for all other API requests in the Authorization
header as the Bearer token.
For merchants, you also need to send the Ocp-Apim-Subscription-Key
header along with the access_token
for every subsequent request.
Step 3 - Get all ledgers
Send
GET:/settlement/v1/ledgers
to get the ledgers you have access to.
curl -X GET https://api.vipps.no/settlement/v1/ledgers \
-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" \
Step 4 - Get a funds ledger
Send
GET:/report/v2/ledgers/{ledgerId}/{topic}/dates/{ledgerDate}
for a list of payments/transactions.
Set:
topic
tofunds
.ledgerId
to the 6-digit value that is the unique ledger ID for the ledger you want.ledgerDate
to a value in format YYYY-MM-DD (e.g.,2023-12-31
).
curl -X GET https://api.vipps.no/report/v2/ledgers/{ledgerId}/funds/dates/2023-12-31 \
-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" \
Step 5 - Get a fees ledger
Send
GET:/report/v2/ledgers/{ledgerId}/{topic}/dates/{ledgerDate}
for a list of payments/transactions.
Set:
topic
tofees
.ledgerId
to the 6-digit value that is the unique ledger ID for the ledger you want.ledgerDate
to a value in format YYYY-MM-DD (e.g.,2023-12-31
).
curl -X GET https://api.vipps.no/report/v2/ledgers/{ledgerId}/fees/dates/2023-12-31 \
-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" \
Step 6 - Get a continuous feed of data (optional)
If you want to continuously stream data as it becomes available, use the
GET:/report/v2/ledgers/{ledgerId}/{topic}/feed
endpoint without specifying a ledgerDate
.
Set the following:
- Set
topic
tofunds
orfees
, for the type of ledger you require. - Set
ledgerId
to the unique ledger ID for the ledger you want.
curl -X GET https://api.vipps.no/report/v2/ledgers/{ledgerId}/{topic}/feed \
-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" \
See: FAQ: Can I get real-time data?
Next Steps
See the Report API guide to read about the concepts and details.