Edit

Create payment link

Request

POST
https://api.scanpay.dk/v2/{shopid}:pay/new

Headers

HTTP header Description
X-Cardholder-IP: 127.105.175.99 The IPv4 or IPv6 address of the customer making the payment. It's optional but highly recommended.

Fields

The only required field is "items". All other fields are optional.

JSON field Description
"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. Acquirers do not support fractions of the minor currency unit (here øre, 0.01 DKK) and as such this will yield an error when trying to pay.
"billing": {
    "name": "Øjvind Jakobsen",
    "company": "Karen Blixen Museet ApS",
    "vatin": "DK14915508",
    "gln": "5790002195341",
    "email": "øjvind@blixen.dk",
    "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": "thomas@dinesen.dk",
    "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": true Automatically capture the payment. Default is false, which means that payments are authorized (reserved), but not captured. If set to true then partial authorizations are rejected and should the capture attempt fail then the authorization will be automatically voided and not saved in the transaction database.
"lifetime": "7d" Payment link lifetime in days ("d"), hours ("h"), minutes ("m"), and seconds ("s"). The default is "1h" and max is "30d". Increasing the lifetime will also increase the length of the returned URL.

Response

JSON fields Description
"url": "https://betal.scanpay.dk/9qdvbx2r" The payment link. You can redirect the customer to this URL to complete the payment.
"id": "9qdvbx2r" The payment ID.

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

Link parameter Description
?go=mobilepay Redirect the customer to MobilePay Online.
?go=applepay Present the Apple Pay button.