Skip to main content

Quick start

Before you begin

This document covers the quick steps for getting started with the webhooks API. You must have already signed up as an organization with Vipps MobilePay and have your test credentials from the merchant portal, as described in the Getting Started Guide.

For this quick start, you'll need the following.

  • client_id - Merchant key required for getting the access token.
  • client_secret - Merchant key required for getting the access token.
  • Ocp-Apim-Subscription-Key - Merchant subscription key.
  • merchantSerialNumber - Merchant ID.
  • callbackUrl - Some HTTPS URL that can receive a POST request callback.

Step 1 - Setup

No setup needed.

Step 2 - Authentication

For the following, you will need an access_token from the Access token API: [POST:/accesstoken/get][access-token-endpoint]. This provides you with access to the API.

curl https://apitest.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: 123456" \
-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" \
-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 - Register a webhook on the ePayment API capture event

curl https://apitest.vipps.no//webhooks/v1/webhooks \
-H "client_id: YOUR-CLIENT-ID" \
-H "client_secret: YOUR-CLIENT-SECRET" \
-H "Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY" \
-H "Merchant-Serial-Number: 123456" \
-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" \
-X POST \
--data '{
"url": "<CALLBACK-URL>",
"events": ["epayments.payment.captured.v1"]
}'

Step 4 - Get all webhooks

curl https://apitest.vipps.no//webhooks/v1/webhooks \
-H "client_id: YOUR-CLIENT-ID" \
-H "client_secret: YOUR-CLIENT-SECRET" \
-H "Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY" \
-H "Merchant-Serial-Number: 123456" \
-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" \
-X GET \
--data ''

Step 5 - Delete webhook

curl https://apitest.vipps.no//webhooks/v1/webhooks/<WEBHOOK-ID> \
-H "client_id: YOUR-CLIENT-ID" \
-H "client_secret: YOUR-CLIENT-SECRET" \
-H "Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY" \
-H "Merchant-Serial-Number: 123456" \
-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" \
-X DELETE \
--data ''