Edit

Payment Link

With the Payment Link API, you can generate links to our hosted payment window, where customers can enter their payment details. Payment links are stateful and exist until expiration, defined by the lifetime field.

Here is a minimal example in pseudocode. You can find more examples in our client libraries.

POST https://api.scanpay.dk/v1/new
Authorization: Basic base64_encode("apikey")
{ "items": [ { "name": "Pink Floyd: The Dark Side Of The Moon", "total": "199.90 DKK" } ] }

Successful responses have a 200 status code and a JSON body containing the payment link:

{
    "url": "https://betal.scanpay.dk/9qdvbx2r"
}

Invalid responses will return a 4XX or 5XX error code and an error message. See error handling for more details.

Payment window Responsive payment window

The request endpoint is: https://api.scanpay.dk/v1/new.

HTTP headerDescription
Authorization: Basic base64_encode("apikey")HTTP basic authentication with your API key as credentials, which you will need to base64 encode.
X-Cardholder-IP: 47.105.175.99Customer IPv4 or IPv6 address. It is used for DoS protection, and it is optional but recommended.

Request Fields

The API is fault-tolerant and forgiving. Apart from items, all fields are optional, and we will ignore them if they are invalid. There is a maximum request size of 32 kB but no field size restrictions.

JSON fieldsDescription
"items": [
    {
        "name": "iPhone 8 64GB Grå",
        "quantity": 2,
        "total": "12998 DKK",
        "sku": "sjk23"
    },
    {
        "name": "Grønt iPhone cover",
        "quantity": 1,
        "total": "399.9986 DKK"
    },
    {
        "total": "100 DKK"
    }
]

An array with one or more items. Each item needs a total, but all other fields are optional.

  • name: the name of the item or service.
  • quantity: the number of items (integer).
  • total: line total, i.e. unit-price times quantity, with an ISO 4217 currency code.
  • sku: a SKU for this particular item.
In this example, the total amount is 13497.9986 DKK. Most acquires only support two or three digits after the decimal point. We will automatically truncate the value if needed.
"billing": {
    "name": "Øjvind Jakobsen",
    "company": "Karen Blixen Museet ApS",
    "vatin": "DK14915508",
    "gln": "5790002195341",
    "email": [email protected]",
    "phone": "+45 45571057",
    "address": ["Rungsted Strandvej 111"],
    "city": "Rungsted Kyst",
    "zip": "2960",
    "state": "Hovedstaden",
    "country": "DK"
},
"shipping": {
    "name": "Thomas Fasti Dinesen",
    "company": "Karen Blixen Museet ApS",
    "email": "[email protected]",
    "phone": "0045 45571057",
    "address": [
        "Att. Thomas Fasti Dinesen",
        "Rungsted Strandvej 111"
    ],
    "city": "Rungsted Kyst",
    "zip": "2960",
    "state": "",
    "country": "DK"
}

Customer billing and shipping address. We use it to protect your business against fraud, and we show the details in our dashboard.

  • company: Company legal name.
  • vatin: EU VAT identification number with country prefix.
  • gln: Global Location Number or European Article Numbering (EAN-number).
  • phone: Phone number with country prefix.
  • address: An address array where each element is a new line.
  • zip: Postal code.
  • country: Two-letter country code (ISO 3166-1).
"orderid": "1234zx"An order identifier that identifies the order in your system. We send the ID to your acquirer and display it in the payment window.
"successurl": "http://blixen.dk/success"The success URL is where we send the customer after successful payment.
"language": "da"The desired payment window language in ISO 639-1. Default is the browser language.
"autocapture": trueAutomatically capture the payment. Default is false, which means that payments are authorized (reserved), but not captured.
"lifetime": "7d"Payment link lifetime in days ("d"), hours ("h") or minutes ("m"). Default is "1h" and max is "30d". Increasing the lifetime will also increase the length of the returned URL.

Link Parameters

The following link parameters can be appended to the payment link:

Link parameterDescription
?go=mobilepayRedirect the customer to MobilePay Online. You need to enable MobilePay Online here.

Languages

When you create a payment link, you can select the desired language for the payment window. Our fallback is to choose the best available language, depending on the customers browser settings, i.e. the Accept-Language header. We currently support the following languages:

LanguageISO 639-1Git
Danishda
Swedishsv
Norwegianno
LanguageISO 639-1Git
Englishen
Germande
Frenchfr

Payment Window

The payment window is a secure, hosted payment page that lets you collect payments quickly without worrying about PCI compliance. The payment window is accessible through payment links.

User interaction

The payment window is optimized for computers and phones. We support autofill in accordance with the whatwg autofill standard.

Payment window Responsive payment window
ChromeSafariSafari on iOSFirefoxAndroid
browser
EdgeOpera
51
2016-05
10.1
2016-05
10.1
2016-05
10.1
2016-05
44
2016-05
14
2016-05
38
2016-05