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 |
|---|---|
"orderid": "1234zx"
| An order identifier that identifies the order in your system. This is what will appear on the payer's bank statement. |
"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. This is purely metadata and has no fixed format. It is used opportunistically where applicable and is visible in our dashboard. |
"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
Note: in this example the total amount is 13497.9986 DKK. We do not support fractions of the minor currency unit (here øre, 0.01 DKK) and as such sending this would yield an error. |
"autocapture": true
| Automatically capture the payment. Default is false, which means that payments are authorized, 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. |
"successurl": "http://blixen.dk/success"
| The URL we redirect the payer to after a successful payment. |
"language": "da"
| The desired payment window language in ISO 639-1. Default is the browser language. |
"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 field | 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 you need when making API calls regarding the payment link. |
Link Parameters
By default, all payment methods are available from the payment window. You can, however, direct users towards specific methods by appending the appropriate parameter:
| Link parameter | Description |
|---|---|
?go=mobilepay | Directly redirect the customer to MobilePay Online. |
?go=applepay | Focus the Apple Pay button. |