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
- curl
- Postman
Please note: Postman is discontinuing their offline version. Use only your test keys and delete them after testing. Ensure that your company allows for cloud use before continuing.
If you wish to use Postman, import the following files:
Remember to replace the placeholder values with your own credentials and callback URL.
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
- Postman
Send request 'Get Access Token'
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
- Postman
Send request 'Register'
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
- Postman
Send request 'Get All'
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
- Postman
Variable webhook_id
is automatically set when running request Register
.
Send request 'Delete Last'
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 ''