Quick start
Use the Checkout API to create a checkout session and retrieve session information.
For a quick and seamless integration of Checkout, explore our SDK.
Before you beginβ
The provided example values in this guide must be changed with the values for your sales unit and user. This applies for API keys, HTTP headers, reference, phone number, etc.
The minimum amount in NOK and DKK is 100 ΓΈre. The minimum amount in EUR is 1 cent.
A note on errors: An endpoint may return a non-successful response code for many reasons, including invalid API keys, missing fields in an input, etc. When errors occur, a response based on Problem Details for HTTP APIs will be returned. The message format may evolve, so avoid building strict logic around it.
Your first Checkoutβ
Step 1 - Setupβ
You must have already signed up as an organization with Vipps MobilePay and have your test credentials from the merchant portal. See Getting started guide for help.
Get these API key values for your sales unit (How to find the API keys):
client_id
- Client_id for a test sales unit.client_secret
- Client_id for a test sales unit.Ocp-Apim-Subscription-Key
- Subscription key for a test sales unit.Merchant-Serial-Number
- The unique ID for a test sales unit.
- curl
- Postman
π₯ Do not store production keys in the Postman cloud. π₯
To prevent your sensitive data and credentials from being synced to the Postman cloud, store them in the Current Value fields of your Postman environment.
Open Postman and do the following:
-
Import the following files:
-
Select to use the imported global environment.
-
In the global environment, update only the Current Value field with your own values for the following:
client_id
client_secret
Ocp-Apim-Subscription-Key
Merchant-Serial-Number
No additional setup needed :)
Step 2 - Create a checkout sessionβ
Create a checkout session with: POST:/checkout/v3/session
.
- curl
- Postman
Send request Create a Checkout Session
The reference
variable is automatically set in the environment
of this Postman example.
curl -X POST https://apitest.vipps.no/checkout/v3/session \
-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: YOUR-COMPANY-NAME" \
-H "Vipps-System-Version: 3.1.2" \
-H "Vipps-System-Plugin-Name: YOUR-PLUGIN-NAME" \
-H "Vipps-System-Plugin-Version: 4.5.6" \
-d '{
"merchantInfo": {
"callbackUrl": "https://example.com/vipps/callbacks-for-checkout",
"returnUrl": "https://example.com/vipps/fallback-result-page-for-both-success-and-failure/acme-shop-123-order123abc",
"callbackAuthorizationToken": "538dd1d0-9e7f-4732-8134-dfed7fd0b236"
},
"transaction": {
"amount": {
"value": 1000,
"currency": "NOK"
},
"reference": "UNIQUE-SESSION-REFERENCE",
"paymentDescription": "One pair of socks."
}
}'
Take note of the reference
value, as it can be used for subsequent calls relating to this session.
To display the session, you will need to load the Checkout SDK in your website, as described in API Guide: Displaying the session.
Step 3 - Retrieve the session informationβ
Retrieve the session information by using
GET:/checkout/v3/session/{reference}
with reference
from the previous step.
- curl
- Postman
Send request Get session info
You will see the details appear in the lower pane.
curl -X GET https://apitest.vipps.no/checkout/v3/session/UNIQUE-SESSION-REFERENCE \
-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" \