Skip to main content

Long-living payment requests

Availability

Danish flag In Denmark, available to all merchants.

Finnish flag In Finland, available to merchants who previously had MobilePay Invoice.

Norwegian flag In Norway, currently in the piloting phase.

Sales units (i.e., Merchant Serial Numbers) must be especially approved to use this feature. The user experience, including the standard timeout, should be as consistent as possible, so this should only be used in special cases. To request this feature, please contact your key account manager, your partner manager, or customer service.

The ePayment API supports long-living payment requests where the merchant can specify the expiration time when initiating the payment with POST:/epayment/v1/payments.

This is done by specifying expiresAt in the payment initiation request. The expiresAt must be between 10 minutes and 60 days in the future.

Please note: This functionality is only available when using the WALLET payment method, since the app is required (it does not work with freestanding card payments).

When setting the expiresAt property it is a requirement to provide information about the products being sold. Often that would be in the form of an "invoice". This data can be used for Content monitoring

There are two ways of adding information or an invoice via the API. Either by providing order lines or a URL to a website or a PDF file located on a server. If you link to a website with a PDF - then the website must be able to render the PDF itself. Please note that is NOT possible to add both order lines and a URL at the same time. When doing so an error will be thrown when creating the payment.

Below are examples of adding order lines or a URL.

Example 1 - setting Order Lines

Request

{
"amount":{
"currency":"NOK",
"value":49900
},
"customer":{
"phoneNumber":4712345678
},
"paymentMethod":{
"type":"WALLET"
},
"reference":"acme-shop-123-order123abc",
"returnUrl":"https://example.com/redirect?reference=acme-shop-123-order123abc",
"userFlow":"PUSH_MESSAGE",
"expiresAt":"2023-02-15T00:00:00Z",
"receipt":{
"orderLines":[
{
"name":"Vipps socks",
"id":"line_item_1",
"totalAmount":1000,
"totalAmountExcludingTax":800,
"totalTaxAmount":200,
"taxRate": 2550,
"unitInfo":{
"unitPrice":400,
"quantity":"2",
"quantityUnit":"PCS"
},
"discount":0,
"productUrl":"https://example.com/store/socks",
"isReturn":false,
"isShipping":false
},
{
"name":"Home Delivery",
"id":"delivery",
"totalAmount":200,
"totalAmountExcludingTax":100,
"totalTaxAmount":100,
"taxRate": 5000,
"discount":0,
"isReturn":false,
"isShipping":true
}
],
"bottomLine":{
"currency":"NOK",
"tipAmount":0,
"barcode":{
"format":"EAN13",
"data":"696969"
},
"posId":"vipps_pos_122",
"paymentSources":{
"giftCard":2,
"voucher":0,
"cash":0
},
"receiptNumber":"0527013501"
}
}
}

Example 2 - setting URL

Request

{
"amount":{
"currency":"NOK",
"value":49900
},
"customer":{
"phoneNumber":4712345678
},
"paymentMethod":{
"type":"WALLET"
},
"reference":"acme-shop-123-order123abc",
"returnUrl":"https://example.com/redirect?reference=acme-shop-123-order123abc",
"userFlow":"PUSH_MESSAGE",
"expiresAt":"2023-02-15T00:00:00Z",
"receiptUrl": "https:example.com/link/to/my.pdf"
}

After creating a payment a push message will be sent to the customer's app (specified with phoneNumber), and the customer confirms the payment.

If the customer's phone number is unknown, the request can specify userFlow as QR. This will return the QR code for a payment, including the expiration time specified. The customer scans the QR code to complete the payment flow in the app.

If a payment is initiated with the expiresAt for a sales unit that is not allowed to use the feature, the response will be an error. If this issue arises please contact us

Response

The response is similar to a regular payment initiation.

Invoice scenarios

Use Vipps MobilePay to make long-living payment requests for your customers by using the "expiresAt" feature. This will create payment requests that can be seen and postponed by the user, up to 60 days.

The following sections will explain how to implement this feature for a couple scenarios:

Scenario 1. Payment request sent directly to app

If you have the customer's phone number and their consent to send payment requests through Vipps MobilePay, you can send payment requests directly to the customer.

The flow for the customer will look like this when setting order lines:

Example 1 - when setting Order Lines

Vipps payment request push flow

The flow for the customer will look like this when setting a URL:

Example 2 - when setting a URL

Vipps payment request push flow

  1. To create this payment, you first need to make a create payment request where customer.phoneNumber is set.

  2. The customer will receive a push notification in their Vipps or MobilePay app.

  3. When the customer selects Show details in the payment confirmation screen, they are presented with the order information provided by the merchant without leaving the Vipps or MobilePay app.

  4. The customer approves the payment.

    Users also have the option of soft-dismissing the payment and postponing it for later.

Even if you don't know your customer's phone number, you can start a payment request by sending them a link to your own landing page. This, in turn, can trigger a payment request through the API.

The flow for the customer will look like this:

Vipps payment request landing page flow

  1. In your website, mobile app, on paper document or email you send, provide your customers with an option for opting-in to receive payment request for payment requests in the Vipps or MobilePay app.

  2. Present them with the Pay with Vipps or Pay with MobilePay option.

  3. Send the create payment request.

  4. If the customer is on a desktop computer, the Landing page opens. If on a mobile device, the Vipps or MobilePay app opens automatically.

Scenario 3. Payment request with sharing of telephone number

The flow for the customer will look like this:

Vipps payment request landing page flow with userinfo

This is very similar as scenario 2. The difference is that you will also ask the user to share their telephone number. This is done by setting the scope parameter with a value of phoneNumber in the create payment request.

After the user have finished the payment, you will get the phone number of the customer. This means you can proceed with scenario 1 in the future and send the payment request directly to the customer. There is more info about fetching user data in the profile sharing section.

General create request example

Example body:

{
"amount":{
"currency":"NOK",
"value":6000
},
"customer":{
"phoneNumber":4712345678
},
"paymentMethod":{
"type":"WALLET"
},
"receipt":{
"orderLines": [
{
"name": "Socks",
"id": "line_item_1",
"totalAmount": 1000,
"totalAmountExcludingTax": 800,
"totalTaxAmount": 200,
"taxRate": 2550,
"unitInfo": {
"unitPrice": 400,
"quantity": "2.5",
"quantityUnit": "KG"
},
"discount": 0,
"productUrl": "https://example.com/store/socks",
"isReturn": false,
"isShipping": false
},
{
"name": "Flip-flops",
"id": "line_item_2",
"totalAmount": 5000,
"totalAmountExcludingTax": 4000,
"totalTaxAmount": 1000,
"taxRate": 2550,
"unitInfo": {
"unitPrice": 2500,
"quantity": "3",
"quantityUnit": "PCS"
},
"discount": 2500,
"productUrl": "https://example.com/store/flipflops",
"isReturn": false,
"isShipping": false
}
],
"bottomLine": {
"currency": "NOK",
"tipAmount": 0,
"posId": "pos_122",
"paymentSources": {
"giftCard": 0,
"card": 0,
"voucher": 0,
"cash": 0
},
"barcode": {
"format": "CODE 39",
"data": "SC0527013501 "
},
"receiptNumber": "0527013501"
}
},
"reference":"acme-shop-123-order123abc",
"paymentDescription": "Invoice# 424243, due date: 01 Jan 2025",
"returnUrl":"https://example.com/redirect?orderId=1512202",
"userFlow":"PUSH_MESSAGE",
"expiresAt":"2023-09-15T00:00:00Z"
}

To create a payment request, the following parameters can/must be used, depending on the scenario:

  • reference - The orderId of the payment request.
  • expiresAt - The expiration date for the payment. This is what separates the long-living payment request from a regular payment.
  • userFlow - Must be "PUSH_MESSAGE" or "QR".
  • paymentDescription - Short description with relevant information about the payment request.
  • receipt.orderLines Order lines for the payment. The orderlines are the same as referenced in the Order Management API. This must be present.
  • customer.phoneNumber - The customer's phone number. This is optional, and will be used if the users phone number is known in advance.
  • scope - This can be used to request the user to share their telephone number.

Help us improve our documentation

Did you find what you were looking for?