> **Description:** Get started quickly with the Management API using this step-by-step guide for setting up and making your first API calls.

# Quick start

This guide walks you through the Management API requests.

**Production only**

The Management API can only be tested against the production server [`https://api.vipps.no`](https://api.vipps.no), not the test environment.

## Before you begin

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

Replace the example values in this guide with the actual values for your sales unit and user.
This includes API keys, HTTP headers, references, phone numbers, and similar values.

## Step 1 - Setup

You will need the following [sales unit API keys](https://developer.vippsmobilepay.com/docs/knowledge-base/api-keys.md) 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 [partner keys](https://developer.vippsmobilepay.com/docs/partner/partner-keys.md#partner-keys):

- `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).

If using Postman, download the following files and import them into Postman.
Select the global environment as your active environment and update with your own values for the API keys. *Don't store production keys in the cloud.*

- [Download Management API Postman collection](https://developer.vippsmobilepay.com/tools/management-api-postman-collection.json)
- [Download Global Postman environment](https://developer.vippsmobilepay.com/tools/global-postman-environment.json)

You will use the production server: [`https://api.vipps.no`](https://api.vipps.no). In Postman, set `base_url_production` to `https://api.vipps.no`.

## Step 2 - Get an access token

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

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.

## 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`](https://developer.vippsmobilepay.com/redocusaurus/management-swagger-id.yaml)
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](https://developer.vippsmobilepay.com/docs/APIs/management-api/management-api-guide.md#get-all-sales-units) for more information.

```text
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.

```bash
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}`](https://developer.vippsmobilepay.com/redocusaurus/management-swagger-id.yaml), 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](https://developer.vippsmobilepay.com/docs/APIs/management-api/management-api-guide.md#get-information-about-a-sales-unit) for more information.

```text
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.

```bash
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`](https://developer.vippsmobilepay.com/redocusaurus/management-swagger-id.yaml).

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.

```text
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.

```bash
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}`](https://developer.vippsmobilepay.com/redocusaurus/management-swagger-id.yaml).

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](https://developer.vippsmobilepay.com/docs/APIs/management-api/management-api-guide.md#get-a-merchants-details-by-business-identifier) for details.

```text
Send request: "Merchants > Get a merchant by business identifier"
```

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

**NOTE**

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`](https://developer.vippsmobilepay.com/redocusaurus/management-swagger-id.yaml)
returns an array where each element includes JSON data (i.e., product order ID, status, business identifier) for a product order.

See [API guide: Get a list of product orders](https://developer.vippsmobilepay.com/docs/APIs/management-api/management-api-guide.md#get-a-list-of-product-orders) for more information.

```text
Send request: "Product orders > Get a list of product orders"
```

```bash
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 the [business portal](https://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`](https://developer.vippsmobilepay.com/redocusaurus/management-swagger-id.yaml).
See [API guide: Prefill a product order](https://developer.vippsmobilepay.com/docs/APIs/management-api/management-api-guide.md#prefill-a-product-order) for more information.

```text
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.

```bash
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`](https://developer.vippsmobilepay.com/redocusaurus/management-swagger-id.yaml),
where `productOrderId` is the ID of the product order.
See [API guide: Get information about a product order](https://developer.vippsmobilepay.com/docs/APIs/management-api/management-api-guide.md#get-information-about-a-product-order) for more information.

```text
Send request: "Product orders > Get information about a product order"
```

The `{productOrderId}` was saved in the Postman environment in the previous steps.

```bash
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 the response in the previous steps.

## Step 10 - Delete a prefilled product order

Send request
[`DELETE:/management/v1/product-orders/{prefilledProductOrderId}`](https://developer.vippsmobilepay.com/redocusaurus/management-swagger-id.yaml),
where `prefilledProductOrderId` is the ID of the prefilled product order.
See [API guide: Delete a product order](https://developer.vippsmobilepay.com/docs/APIs/management-api/management-api-guide.md#delete-a-product-order) for more information.

```text
Send request: "Product orders > Delete a prefilled product order"
```

The `{prefilledProductOrderId}` was saved in the Postman environment in the previous step.

```bash
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 the 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`](https://developer.vippsmobilepay.com/redocusaurus/management-swagger-id.yaml).

**NOTE**

You must get the access token using partner keys.

```text
Send request: "Partners > Get price packages for a partner"
```

```bash
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](https://developer.vippsmobilepay.com/docs/APIs/management-api/management-api-guide.md) for more details about the above endpoints.

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