How the merchant callback QR works
In this flow, a user pays by scanning a QR with their Vipps or MobilePay app. The merchant gets their ID and sends a payment request to them through the app. Optionally, the merchant can also get the phone number of the user and enroll them in their loyalty program.

Prerequisites​
Merchant callback QR: Generate a merchant callback QR code, as described in the QR API: Merchant callback QR codes.
Webhooks: Set up webhooks to receive event notifications when the QR is scanned and when the payment is approved.
Details​
Step 1: Products are added for payment​
Step 2: The customer scans the QR​
Step 3: The merchant's system sends the payment request​
Your system will receive a webhook notification that the customer has scanned the QR and is ready to pay with Vipps MobilePay. The notification will contain a token you can use to start a payment.
Use the token to send the customer a Create Payment request.
Step 4: The customer authorizes the payment​
The payment request will appear in the customer's Vipps or MobilePay app, where they can select to pay or cancel.
Step 5: The merchant's system updates the status​
Your system will receive a webhook notification regarding their choice. You can also poll for the status.
Once the payment is approved, update the status in your system. You may capture the payment immediately and provide a receipt.
Sequence diagram​
Integration sequence for payments.
Payment-only flow
- Merchant creates a callback QR code via the QR API.
- Customer scans the QR code.
- Webhooks API notifies the merchant of the scan.
- Merchant adds the product to the sale.
- Merchant initiates a payment request and adds order details via the ePayment API.
- ePayment API requests payment from the customer.
- Customer clicks pay.
- Webhooks API sends the merchant a webhook with the payment authorization status.
- Merchant captures the payment via the ePayment API.
- ePayment API returns the status of the capture.
- Merchant verifies that the POS status matches the capture.
See a more complex flow
A more complex flow could involve getting access to the customer's phone number when they scan the QR code. This uses the Customer token exchange endpoint.
Once you have the phone number, you could check if the customer is a member of your loyalty program. If not, you can ask them to enroll. This uses the Login flow to gather consent from the customer.
The steps needed to get consent from the user are explained in detail there. The merchant initiated login flow will send a push to the user, and once the user has finished the flow, they will be ready to pay.
Sequence diagram for complete flow including phone number lookup, customer enrollment and payment is as follows.
Flow with lookup, enrollment, and payment
- Merchant creates a callback QR code via the QR API.
- Customer scans the QR code, which triggers a webhook.
- Webhooks API notifies the merchant of the scan.
- Merchant retrieves the customer's phone number from the token via the QR API.
- Merchant initiates a login via the Login API.
- Login API requests login from the customer.
- Customer approves the login.
- Merchant polls the login token from the Login API.
- Merchant retrieves user info from the Login API.
- Merchant adds the product to the sale.
- Merchant initiates a payment request and adds order details via the ePayment API.
- ePayment API requests payment from the customer.
- Customer clicks pay.
- Webhooks API sends the merchant a webhook with the payment authorization status.
- Merchant captures the payment via the ePayment API.
- ePayment API returns the status of the capture.
- Merchant verifies that the POS status matches the capture.
Next steps​
See:
or MobilePay
app.
The merchant gets their ID and sends a payment request to them through the app.
Optionally, the merchant can also get the phone number of the user and enroll them in their loyalty program.