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: http://www.json.org/
Notice! The parameter amount must match the total of the invoice including VAT.
{
"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
}]
}
Name | Values | Comment |
customer | Type: customer | See customer parameters |
shippingaddress | Type: shippingaddress | See customer shipping address parameters |
lines[] | Type: Array | See invoice lines 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]{0,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. |
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]{0,3}$ | The principal subdivision, e.g. province or state. Use the ISO 3166-2 subdivision code. |
Name | Type | 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 |
<?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
);
?>>