Quick start
Before you beginโ
Be aware that these are running on the production server, https://api.vipps.no.
๐ฅ To reduce risk of exposure, never store production 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.
You will need the following values, as described in the Getting started guide:
client_id
- Client_id for a test sales unit.client_secret
- Client_id for a test sales unit.Ocp-Apim-Subscription-Key
- Subscription key for a test sales unit.merchantSerialNumber
- The unique ID for a test sales unit.
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 https://api.vipps.no/accessToken/get \
-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" \
-X POST \
--data ''
The property access_token
should be used for all other API requests in the Authorization
header as the Bearer token.
Step 3 - Get all ledgersโ
Send
GET:/settlement/v1/ledgers
to get the ledgers you have access to.
curl https://api.vipps.no/settlement/v1/ledgers \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni <truncated>" \
-H "Ocp-Apim-Subscription-Key: 0f14ebcab0ec4b29ae0cb90d91b4a84a" \
-H "Vipps-System-Name: acme" \
-H "Vipps-System-Version: 3.1.2" \
-X GET
Step 4 - Get all ledgersโ
Send
GET:/report/v1/ledgertransactions
for a list of payments/transactions.
Set ledgerDate
to a value in format YYYY-MM-DD 2022-10-01
.
Set ledgerId
to a 6-digit value (e.g., 302321
).
curl https://api.vipps.no/report/v1/ledgertransactions?ledgerDate={ledgerDate}&ledgerId={ledgerId} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni <truncated>" \
-H "Ocp-Apim-Subscription-Key: 0f14ebcab0ec4b29ae0cb90d91b4a84a" \
-H "Vipps-System-Name: acme" \
-H "Vipps-System-Version: 3.1.2" \
-X GET
Next Stepsโ
See the Report API guide to read about the concepts and details.