Please wait ...


Loading...

Invoice data

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 benefit 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 Bambora.

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 Bambora 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: http://www.json.org/

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":"Testervej 1",
       "zip":9000,
       "city":"Aalborg",
       "country":"Denmark"
    },
    "shippingaddress":{
       "firstname":"Jens",
       "lastname":"Jensen",
       "address":"Testervej 1",
       "zip":9000,
       "city":"Aalborg",
       "country":"Denmark"
    },
    "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 type="text/javascript" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" charset="UTF-8"></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","shippingaddress":{"firstname":"Jens","lastname":"Jensen","address":"Testervej 1","zip":9000,"city":"Aalborg","country":"Denmark"}},"lines":[{"id":"6","description":"MacBook","quantity":1,"price":117057,"vat":25},{"id":"shipping","description":"Shipping","quantity":1,"price":700,"vat":25}]}'
});
</script>
 
<input type="button" onclick="javascript: paymentwindow.open()" value="Go to payment" />

Invoice parameters

NameTypeComment
customerCustomerSee customer parameters
shippingaddressShipping addressSee customer shipping address parameters
lines[]Lines arraySee invoice lines parameters

Invoice customer parameters

NameTypeComment
referencestringNot used for Klarna. Max 30 characters.
emailaddressStringMax 50 characters.
firstnameStringNot used for Svea. Max 255 characters.
lastnameStringNot used for Svea. Max 255 characters.
attention
StringNot used for Svea. Max 255 characters.
addressStringNot used for Svea. Max 255 characters.
zipStringNot used for Svea. Max 255 characters.
cityStringNot used for Svea. Max 255 characters.
countryStringNot used for Svea. Max 255 characters.
phoneStringNot used for Svea. Max 255 characters.

Invoice customer shipping address parameters

NameTypeComment
firstnameStringNot used for Svea. Max 255 characters.
lastnameStringNot used for Svea. Max 255 characters.
attentionStringNot used for Svea. Max 255 characters.
addressStringNot used for Svea. Max 255 characters.
zipStringNot used for Svea. Max 255 characters.
cityStringNot used for Svea. Max 255 characters.
countryStringNot used for Svea. Max 255 characters.
phoneStringNot used for Svea. Max 255 characters.

Invoice lines parameters

NameTypeComment
idStringThe identifier of this line from your own system, e.g. your product ID.
Max 10 characters.
descriptionStringDescription for this line, e.g. the product name. Max 40 characters.
textStringUsed for Kvittering.dk/Storebox.com. Text placed under description, e.g. product details. Max 64 characters.
priceIntegerPrice for 1 quantity without VAT. Any discounts are not to be deducted. The price must be defined in minor units.
discount
DoubleThe discount in per cent. For 15%, enter 15.00
quantityIntegerQuantity of this line.
vatDoubleThe VAT in per cent. For 25%, enter 25.00

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["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["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 type="text/javascript" src="https://ssl.ditonlinebetalingssystem.dk/integration/ewindow/paymentwindow.js" charset="UTF-8"></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 type="button" onclick="javascript: paymentwindow.open()" value="Go to payment" />