> **Description:** Step-by-step guide to start fetching transaction reports, including authentication setup, basic API calls, and example code for common reporting tasks.

# Quick start

## Before you begin

**Production only**

The Report API is not available in the test environment. All requests in this guide use the production server, [`https://api.vipps.no`](https://api.vipps.no).

To reduce the risk of exposure, never store production API keys in Postman or similar tools.

## Getting your ledgers

### Step 1 - Setup

You must have already signed up as an organization with Vipps MobilePay.

You will need the following [API keys](https://developer.vippsmobilepay.com/docs/knowledge-base/portal.md#how-to-find-the-api-keys) for your *production* sales unit:

* `client_id` - Client ID for a sales unit.
* `client_secret` - Client secret for a sales unit.
* `Ocp-Apim-Subscription-Key` - Subscription key for a sales unit.
* `Merchant-Serial-Number` - The unique ID for a sales unit (optional but helpful for troubleshooting).

You will need the following values from your [accounting keys](https://developer.vippsmobilepay.com/docs/partner/partner-keys.md#accounting-keys):

* `client_id` - Client ID from your accounting keys.
* `client_secret` - Client secret from your accounting keys.

You will need the following values from your [merchant-level keys](https://developer.vippsmobilepay.com/docs/APIs/donations-api/api-guide.md#how-to-get-the-api-keys):

* `client_id` - Client ID from your merchant-level keys.
* `client_secret` - Client secret from your merchant-level keys.

The example values in this guide must be replaced with the values for your sales unit and user.
This applies to API keys, HTTP headers, references, phone numbers, and similar values.

### Step 2 - Get an access token

All the API endpoints require that you first obtain an API token.

#### For merchants using their API keys

Merchants use the API keys for each of their sales units
with the
[Access Token API: Access token endpoint](https://developer.vippsmobilepay.com/docs/APIs/access-token-api/standard-authentication.md#step-2-request-an-access-token).

Example request to
[`POST:/accesstoken/get`](https://developer.vippsmobilepay.com/redocusaurus/access-token-swagger-id.yaml):

```bash
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' \
-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](https://developer.vippsmobilepay.com/docs/knowledge-base/http-headers.md) for more details.

**NOTE**

When a partner uses
[partner keys](https://developer.vippsmobilepay.com/docs/partner/partner-keys.md)
for requests that are not for a specific merchant,
the `Merchant-Serial-Number` can be omitted.

#### For accounting partners using accounting keys

Accounting partners use accounting keys with the
[Specialized authentication](https://developer.vippsmobilepay.com/docs/APIs/access-token-api/specialized-authentication.md).

The value for authorization is a string representing your Base64-encoded API 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:

```javascript
const clientId = 'YOUR-CLIENT-ID';
const clientSecret = 'YOUR-CLIENT-SECRET';
const base64Credentials = btoa(`${clientId}:${clientSecret}`);
console.log(base64Credentials);
```

**Send the token request:**

To get the token, you will send the [`POST:/miami/v1/token`](https://developer.vippsmobilepay.com/redocusaurus/access-token-swagger-id.yaml) request.

Provide the Base64-encoded value in the `Authorization` heading in a request.
For example:

```bash
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'
```

**WARNING**

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](https://developer.vippsmobilepay.com/docs/knowledge-base/http-headers.md)
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:

```json
{
  "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.

#### For Donations

See [Donations API guide](https://developer.vippsmobilepay.com/docs/APIs/donations-api/api-guide.md) for step-by-step instructions on requesting an access token.

Then use your token in the `Authorization` headers for the endpoints in this file.

### Step 3 - Get all ledgers

Send
[`GET:/settlement/v1/ledgers`][get-ledgers-endpoint]
to get the ledgers you have access to.

```bash
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 funds ledger

Send
[`GET:/report/v2/ledgers/{ledgerId}/{topic}/dates/{ledgerDate}`][fetch-report-by-date-endpoint]
for a list of payments/transactions.

Set:

* `topic` to `funds`.
* `ledgerId` to the unique ledger ID
* `ledgerDate` to a value in format YYYY-MM-DD (e.g., `2026-01-31`).

```bash
curl -X GET https://api.vipps.no/report/v2/ledgers/{ledgerId}/funds/dates/{ledgerDate} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
```

### Step 5 - Get a fees ledger

Send
[`GET:/report/v2/ledgers/{ledgerId}/{topic}/dates/{ledgerDate}`][fetch-report-by-date-endpoint]
for a list of payments/transactions.

Set:

* `topic` to `fees`.
* `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., `2026-01-31`).

```bash
curl -X GET https://api.vipps.no/report/v2/ledgers/{ledgerId}/fees/dates/{ledgerDate} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
```

### 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`][fetch-report-by-feed-endpoint]
endpoint without specifying a `ledgerDate`.

Set the following:

* Set `topic` to `funds` or `fees`, for the type of ledger you require.
* Set `ledgerId` to the unique ledger ID for the ledger you want.

```bash
curl -X GET https://api.vipps.no/report/v2/ledgers/{ledgerId}/{topic}/feed \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
```

See:
[FAQ: Can I get real-time data?](https://developer.vippsmobilepay.com/docs/APIs/report-api/report-api-faq.md#can-i-get-real-time-data)

## Sample scripts

For simple Python examples of how to use the Report API, see
[Sample scripts](https://developer.vippsmobilepay.com/docs/APIs/report-api/api-guide/python-examples.md).

[get-ledgers-endpoint]: https://developer.vippsmobilepay.com/redocusaurus/report-swagger-id.yaml
[fetch-report-by-date-endpoint]: https://developer.vippsmobilepay.com/redocusaurus/report-swagger-id.yaml
[fetch-report-by-feed-endpoint]: https://developer.vippsmobilepay.com/redocusaurus/report-swagger-id.yaml

> **Full site overview:** For every page in this documentation, read [https://developer.vippsmobilepay.com/llms.txt](https://developer.vippsmobilepay.com/llms.txt).
