Quick start
This guide is for accounting partners using accounting keys. Run the basic Sales API calls in curl to start retrieving sales data for your merchants.
Before you begin​
The Sales API is not available in the test environment.
Be aware that the API requests mentioned here are running on the production server, https://api.vipps.no.
Getting your sales information​
Step 1 - Setup​
You must have already signed up as an organization with Vipps MobilePay and obtained accounting keys.
Get these API key values:
client_id- Client ID from your accounting keys.client_secret- Client secret from your accounting keys.
See Accounting keys for details.
The example values in this guide must be replaced with the values from your accounting keys. This applies to API keys, HTTP headers, references, and similar values.
Step 2 - Get an access token​
All API endpoints require that you first obtain an API token.
Accounting partners use accounting keys with the Specialized authentication.
The value for authorization is a string representing your Base64-encoded accounting keys, client_id and client_secret.
How to convert your keys to Base64:
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);
Send the API request:
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.
It's a good idea to include the standard HTTP headers
in your requests (e.g., Vipps-System-Name, Vipps-System-Version),
because these will help us to debug the problem, if you have one.
An access token will be returned. For example:
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1Ni <truncated>",
"token_type": "Bearer",
"expires_in": 900
}
This is your identity in API requests. You can use this in API requests until it expires, in 15 minutes.
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" \
Step 4 - Get a continuous feed of sales events​
Use
GET:/sales/report/v1/ledgers/{ledgerId}
to get a continuous stream of sales data.
Query parameters:
cursor— if not provided, the response starts from the first sale on the givenledgerId. Each response includes acursorindicating where the stream stopped. Persist the cursor and include it in subsequent requests to continue from the last checkpoint.pageSize— limits the number of rows returned per request (default: 100, max: 1000).
curl -X GET "https://api.vipps.no/sales/report/v1/ledgers/{ledgerId}?pageSize=100" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
Step 5 - Get sales events for a specific date​
Use
GET:/sales/report/v1/ledgers/{ledgerId}/dates/{ledgerDate}
to return sales data for a specific date.
Set ledgerDate to a value in the format YYYY-MM-DD (e.g., 2026-05-01).
If the number of sales exceeds the response limit, the response includes a cursor and hasMore = true. Repeat the request for the same date including the cursor to retrieve the remaining records.
curl -X GET "https://api.vipps.no/sales/report/v1/ledgers/{ledgerId}/dates/2026-05-01" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
Step 6 - Get sales events by merchant reference​
Use
GET:/sales/report/v1/ledgers/{ledgerId}/references/{reference}
to return all captures and returns related to a specific reference.
curl -X GET "https://api.vipps.no/sales/report/v1/ledgers/{ledgerId}/references/{reference}" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
Step 7 - Get sales events by PSP reference​
Use
GET:/sales/report/v1/ledgers/{ledgerId}/psp-references/{pspReference}
to return a specific capture or return using the PSP reference.
curl -X GET "https://api.vipps.no/sales/report/v1/ledgers/{ledgerId}/psp-references/{pspReference}" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
Next steps​
- API guide: Authentication, all endpoints, field semantics, and the Report API mapping.
- API reference: Full endpoint specifications.
- VM Number: Reporting and APIs: Overview of how the Sales API and Report API fit together.