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.
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
Name | Values | Comment |
---|---|---|
customer | Type: customer | See customer parameters |
shippingaddress | Type: shippingaddress | See customer shipping address parameters |
lines[] | Type: Array | See invoice lines parameters |
Invoice customer parameters
Name | Values | Comment |
---|---|---|
reference | Type: string Max: 30 characters. | Not used for Klarna. |
emailaddress | Type: string Max: 50 characters. | |
firstname | Type: string Max: 255 characters. | Not used for Svea. |
lastname | Type: string Max: 255 characters. | Not used for Svea. |
attention | Type: string Max: 255 characters. | Not used for Svea. |
address | Type: string Max: 255 characters. | Not used for Svea. |
zip | Type: string Max: 255 characters. | Not used for Svea. |
city | Type: string Max: 255 characters. | Not used for Svea. |
country | Type: string Max: 255 characters. | Not used for Svea. |
phone | Type: string Max: 255 characters. | Not used for Svea. |
state | Type: string Pattern: ^[a-zA-Z0-9]3$ | The principal subdivision, e.g. province or state. Use the ISO 3166-2 subdivision code. |
homephonenumber | Type: string | Home phone number, preferably following ITU-E.164 specification. |
workphonenumber | Type: string | Work phone number, preferably following ITU-E.164 specification. |
Invoice customer shipping address parameters
Name | Values | Comment |
---|---|---|
firstname | Type: string Max: 255 characters. | Not used for Svea. |
lastname | Type: string Max: 255 characters. | Not used for Svea. |
attention | Type: string Max: 255 characters. | Not used for Svea. |
address | Type: string Max: 255 characters. | Not used for Svea. |
zip | Type: string Max: 255 characters. | Not used for Svea. |
city | Type: string Max: 255 characters. | Not used for Svea. |
country | Type: string Max: 255 characters. | Not used for Svea. |
phone | Type: string Max: 255 characters. | Not used for Svea. |
state | Type: 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
Name | Values | Comment |
---|---|---|
id | Type: string Max: 10 characters | The identifier of this line from your own system, e.g. your product ID. |
description | Type: String Max: 40 characters | Description for this line, e.g. the product name. |
text | Type: string Max: 64 characters | Used for Kvittering.dk/Storebox.com. Text placed under description, e.g. product details. |
price | Type: integer | Price for 1 quantity without VAT. Any discounts are not to be deducted. The price must be defined in minor units. |
discount | Type: double | The discount in per cent. For 15%, enter 15.00 |
quantity | Type: integer | Quantity of this line. |
vat | Type: double | The VAT in per cent. For 25%, enter 25.00 |