Set minimum user age
For some purchases, it may be important to ensure that the buyer is over a legal age.
You can do this with the minimumUserAge
parameter.
If you only need the payer's exact age, use the User Info feature instead. The Vipps/MobilePay app will show a consent screen, letting the user know what information is being shared. If you need to document that an age check was performed, you can log the payment requests for your records.
Creating a payment with minimum user age
To set the minimum age required for the customer to make the purchase,
make a
POST:/epayment/v1/payments
request with "minimumUserAge": <age>
.
For example:
curl -X POST https://apitest.vipps.no/epayment/v1/payments \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-ACCESS-TOKEN" \
-H "Ocp-Apim-Subscription-Key: YOUR-SUBSCRIPTION-KEY" \
-H "Merchant-Serial-Number: YOUR-MSN" \
-H "Idempotency-Key: YOUR-IDEMPOTENCY-KEY" \
-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" \
-d '{
"amount":{
"currency":"DKK",
"value":16000
},
"customer":{
"phoneNumber":"4712345678"
},
"minimumUserAge": 25,
"paymentMethod":{
"type":"WALLET"
},
"reference":"acme-shop-123-order123abcd",
"paymentDescription": "Reference acme-shop-123-order123abcd. Thank you for shopping at our webshop!",
"returnUrl":"https://example.com/redirect?reference=12345989434343",
"userFlow":"WEB_REDIRECT"
}'
User flows
If the user owning the phone number is younger than the specified age (in years), an error message will be provided.
QR
and app switch
This applies in the following scenarios:
In these scenarios, the user's Vipps or MobilePay app will open with the payment request, but
if the user is less than the minimum age, they will the detailed message: "Unfortunately you need to be at least <age>
years old to pay to <merchant's name>
".
- Vipps
- MobilePay
The payment is in Created
state and eventually times out. So a relevant webhook might be epayments.payment.expired.v1
WEB_REDIRECT
flow
In the WEB_REDIRECT
flow (e.g., for apps and web shops),
the user will either get switched to the Vipps or MobilePay
app
or go to the landing page.
-
If the user is on a device where a Vipps or MobilePay app is installed, it will open automatically. If they don't meet the age requirements, they will see a detailed message, as shown for the
QR
and app switch flows. -
If the user is on a device without a Vipps or MobilePay app, they will be directed to the landing page. There, they can enter in their own phone number. If they don't meet the age requirements, the payment will not be sent to their app, and they will instead see a generic message (e.g., "You can't pay to this business"). This message is generic for privacy reasons: Another user could use the phone number to get the age of the user.
- Vipps
- MobilePay
PUSH_MESSAGE
flow
In the PUSH_MESSAGE
flow (e.g., for POS), a payment request is pushed directly to a user's Vipps or MobilePay app.
However, this message is not sent if the user doesn't meet the age requirements.
Then, you will get a generic error message in the response to your API request.
The generic message protects the privacy of the individual.
We don't provide the age of customers without consent.
API error message: The phone number does not belong to a <Vipps|MobilePay> user, or the user cannot pay businesses.