Skip to main content

Invoice data

If you want to send your customer a receipt from kvittering.dk/no or Storebox.com or offer invoice payments, loyalty programs or benefits cards, you need to implement our invoice data.

Below we'll describe how you use the method. It's the same logic, no matter if you're setting up invoice payments, loyalty programs or benefit cards.

Please note that you must have an agreement with either Klarna or SveaWebPay to offer invoice payments. When it's been set up, you can send invoices to your customers that they can pay online through ePay.

You can use invoice payments as a supplement to regular card payments, and it requires an agreement with an acquirer.

You are responsible for implementing Klarna or SveaWebPay in your shop system. When you've created your account with either provider, you have to send the information to us and integrate the system with ePay by using the parameters below.

How to set it up

The following describes how to send your invoice data to the payment window v2.

The invoice parameter is required if you want to accept payments through Klarna or SveaWebPay.

The invoice data is governed by the parameter invoice along with the other parameters for the payment window v2. The data is defined in JSON.

Notice

The parameter amount must match the total of the invoice including VAT.

JSON example

{
"customer": {
"emailaddress": "test@epay.dk",
"firstname": "Jens",
"lastname": "Jensen",
"address": "Alfred Nobels Vej 21A",
"zip": 9220,
"city": "Aalborg Øst",
"country": "Denmark",
"state": "81",
"homephonenumber": "+45 98 13 90 40",
"workphonenumber": "+45 98 13 90 40"
},
"shippingaddress": {
"firstname": "Jens",
"lastname": "Jensen",
"address": "Testervej 1",
"zip": 9000,
"city": "Aalborg",
"country": "Denmark",
"state": "81"
},
"lines": [
{
"id": "6",
"description": "MacBook",
"quantity": 1,
"price": 117057,
"vat": 25
},
{
"id": "shipping",
"description": "Shipping",
"quantity": 1,
"price": 700,
"vat": 25
}
]
}

Payment window example

<script charset="UTF-8" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" type="text/javascript"></script>
<script type="text/javascript">
paymentwindow = new PaymentWindow(
'merchantnumber': "YOUR-MERCHANTNUMBER-HERE",
'windowstate': "1",
'amount': "147196",
'currency': "DKK",
'orderid': "23",
'invoice': '{"customer":{"emailaddress":"test@epay.dk","firstname":"Jens","lastname":"Jensen","address":"Testervej 1","zip":9000,"city":"Aalborg","country":"Denmark","state":"81","homephonenumber":"+45 98 13 90 40","workphonenumber":"+45 98 13 90 40" },"shippingaddress":{"firstname":"Jens","lastname":"Jensen","address":"Testervej 1","zip":9000,"city":"Aalborg","country":"Denmark", "state":"81"},"lines":[{"id":"6","description":"MacBook","quantity":1,"price":117057,"vat":25},{"id":"shipping","description":"Shipping","quantity":1,"price":700,"vat":25}]}'
);
</script>
<input onclick="javascript: paymentwindow.open()" type="button" value="Go to payment">

PHP example

<?php
$invoice["customer"]["emailaddress"] = "test@epay.dk";
$invoice["customer"]["firstname"] = "Jens";
$invoice["customer"]["lastname"] = "Jensen";
$invoice["customer"]["address"] = "Testervej 1";
$invoice["customer"]["zip"] = 9000;
$invoice["customer"]["city"] = "Aalborg";
$invoice["customer"]["country"] = "Denmark";
$invoice["customer"]["state"] = "81";
$invoice["customer"]["homephonenumber"] = "+45 98 13 90 40";
$invoice["customer"]["workphonenumber"] = "+45 98 13 90 40";


$invoice["shippingaddress"]["firstname"] = "Jens";
$invoice["shippingaddress"]["lastname"] = "Jensen";
$invoice["shippingaddress"]["address"] = "Testervej 1";
$invoice["shippingaddress"]["zip"] = 9000;
$invoice["shippingaddress"]["city"] = "Aalborg";
$invoice["shippingaddress"]["country"] = "Denmark";
$invoice["shippingaddress"]["state"] = "81";

$invoice["lines"] = array();

$invoice["lines"][] = array
(
"id" => "6",
"description" => "MacBook",
"quantity" => 1,
"price" => 117057,
"vat" => 25
);

$invoice["lines"][] = array
(
"id" => "shipping",
"description" => "Shipping",
"quantity" => 1,
"price" => 700,
"vat" => 25
);
?>>
<script charset="UTF-8" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" type="text/javascript"></script>

<script type="text/javascript">
paymentwindow = new PaymentWindow({
'merchantnumber': "YOUR-MERCHANTNUMBER-HERE",
'windowstate': "1",
'amount': "147196",
'currency': "DKK",
'orderid': "23",
'invoice': '<?php echo json_encode($invoice); ?>'
});
</script>

<input onclick="javascript: paymentwindow.open()" type="button" value="Go to payment">

Invoice parameters

NameValuesComment
customerType: customerSee customer parameters
shippingaddressType: shippingaddressSee customer shipping address parameters
lines[]Type: ArraySee invoice lines parameters

Invoice customer parameters

NameValuesComment
referenceType: string Max: 30 characters.Not used for Klarna.
emailaddressType: string Max: 50 characters.
firstnameType: string Max: 255 characters.Not used for Svea.
lastnameType: string Max: 255 characters.Not used for Svea.
attentionType: string Max: 255 characters.Not used for Svea.
addressType: string Max: 255 characters.Not used for Svea.
zipType: string Max: 255 characters.Not used for Svea.
cityType: string Max: 255 characters.Not used for Svea.
countryType: string Max: 255 characters.Not used for Svea.
phoneType: string Max: 255 characters.Not used for Svea.
stateType: string Pattern: ^[a-zA-Z0-9]3$The principal subdivision, e.g. province or state. Use the ISO 3166-2 subdivision code.
homephonenumberType: stringHome phone number, preferably following ITU-E.164 specification.
workphonenumberType: stringWork phone number, preferably following ITU-E.164 specification.

Invoice customer shipping address parameters

NameValuesComment
firstnameType: string Max: 255 characters.Not used for Svea.
lastnameType: string Max: 255 characters.Not used for Svea.
attentionType: string Max: 255 characters.Not used for Svea.
addressType: string Max: 255 characters.Not used for Svea.
zipType: string Max: 255 characters.Not used for Svea.
cityType: string Max: 255 characters.Not used for Svea.
countryType: string Max: 255 characters.Not used for Svea.
phoneType: string Max: 255 characters.Not used for Svea.
stateType: string Pattern: ^[a-zA-Z0-9]3$The principal subdivision, e.g. province or state. Use the ISO 3166-2 subdivision code.

Invoice lines parameters

NameValuesComment
idType: string Max: 10 charactersThe identifier of this line from your own system, e.g. your product ID.
descriptionType: String Max: 40 charactersDescription for this line, e.g. the product name.
textType: string Max: 64 charactersUsed for Kvittering.dk/Storebox.com. Text placed under description, e.g. product details.
priceType: integerPrice for 1 quantity without VAT. Any discounts are not to be deducted. The price must be defined in minor units.
discountType: doubleThe discount in per cent. For 15%, enter 15.00
quantityType: integerQuantity of this line.
vatType: doubleThe VAT in per cent. For 25%, enter 25.00