Skip to main content

URL Validation

This is applicable to:

All URLs in the eCommerce API are validated with the Apache Commons URL Validator.

  • The callbackPrefix URL must use HTTPS.
  • The fallBack URL must use either HTTPS or a custom URL scheme (myapp://).
  • The endpoints required by Vipps MobilePay must be publicly available.
  • The hostnames must resolve with DNS.

URLs that start with http://localhost will be rejected. If you want to use localhost as fallback, please use It is, naturally, not possible to use http://localhost or for the callback, as the Vipps MobilePay backend would then call itself. Ngrok may also be an option.

If isApp is true, the fallBack URL is not validated with Apache Commons URL Validator, as the app-switch URL may be something like vipps://, which is not a valid URL.

Here is a simple Java class suitable for testing URLs, using the dummy URL

import org.apache.commons.validator.routines.UrlValidator;

public class UrlValidate {
public static void main(String[] args) {
UrlValidator urlValidator = new UrlValidator();

if (urlValidator.isValid("")) {
System.out.println("URL is valid");
} else {
System.out.println("URL is invalid");

Help us improve our documentation

Did you find what you were looking for?