Provide shopper information

Submit the below-listed fields along with the payment request.

When you send an open invoice payment request, either via HPP or API you always need to include the following additional shopper data fields:

  • shopperEmail
  • shopperReference

For both API and HPP, specify the following additional data fields for Open Invoice:

API integration specific fields

When using API integration, the following fields should always be included:

  • shopperName – A container for the shopper information. For more information, see Name.

  • selectedBrand – for Klarna, set the value to klarna. For RatePay, set the value to ratepay.
  • dateOfBirth
  • telephoneNumber The telephone number of the shopper.
  • socialSecurityNumber – required for Sweden, Finland, Norway, and Denmark. Provide either the last four digits, or the full social security number.
  • deviceFingerprint – Required for RatePay only. 

    To obtain this value, contact RatePay.

  • billingAddress – This object contains billing address details. For more information, see Address.
  • deliveryAddress – only required if the delivery address is not the same as the billing address. This object contains delivery address details. For more information, see Address.

HPP integration specific fields

When using HPP integration,  these fields can be used for pre-populating: when not supplied, the shopper can enter these manually in the HPP. 

  • shopper - For more information, see HPP additional fields.
  • dateOfBirthDayOfMonth
  • dateOfBirthMonth
  • dateOfBirthYear
  • telephoneNumber
  • socialSecurityNumber – required for Sweden, Finland, Norway, and Denmark. Provide either the last four digits, or the full social security number.
  • billingAddress – This object contains billing address details. For more information, see Address.
  • deliveryAddress – only required if the delivery address is not the same as the billing address. This object contains delivery address details. For more information, see Address.

The following fields can be used to specify what should be shown to the shopper.

  • shopperType – Specifies whether the shopper is allowed to view and/or modify the billing address fields
  • billingAddressType – Specifies whether the shopper is allowed to view and/or modify the billing address fields. For more information, see HPP additional fields.
  • deliveryAddressType – Specifies whether the shopper is allowed to view and/or modify the delivery address fields.

Submit invoice lines and details

For open invoice payment methods we require a detailed specification of the items shoppers purchase, because this specification will be included on the invoice sent to the shopper.

To do this, submit invoice lines including the details about each purchased item. This can be done via the openinvoicedata fields. 

When using API integration, the openinvoicedata fields are child elements of additionalData. Each field represents a key and not a JSON structure. 

For more information on these fields, refer to PaymentRequest and Open Invoice fields topics.

{
   "merchantAccount":"TestMerchant",
   "amount":{
      "currency":"SEK",
      "value":"10000"
   },
   "selectedBrand":"klarna",
   "shopperEmail":"youremail@email.com",
   "shopperReference":"14411521",
   "shopperIP":"69.89.31.226",
   "reference":"Test invoice",
   "shopperName":{
      "firstName":"Testperson-se",
      "lastName":"Approved",
      "gender":"MALE"
   },
   "dateOfBirth":"1941-03-21",
   "telephoneNumber":"0765260000",
   "socialSecurityNumber":"9202",
   "billingAddress":{
      "country":"SE",
      "city":"Ankeborg",
      "houseNumberOrName":"1",
      "street":"Stargatan",
      "postalCode":"12345"
   },
   "deliveryAddress":{
      "country":"SE",
      "city":"Ankeborg",
      "houseNumberOrName":"1",
      "street":"Stargatan",
      "postalCode":"12345"
   },
   "additionalData":{
      "openinvoicedata.numberOfLines":"2",
      "openinvoicedata.line1.currencyCode":"SEK",
      "openinvoicedata.line1.description":"item 1",
      "openinvoicedata.line1.itemAmount":"3000",
      "openinvoicedata.line1.itemVatAmount":"0",
      "openinvoicedata.line1.itemVatPercentage":"0",
      "openinvoicedata.line1.numberOfItems":"1",
      "openinvoicedata.line1.vatCategory":"None",
      "openinvoicedata.line2.currencyCode":"SEK",
      "openinvoicedata.line2.description":"item 2",
      "openinvoicedata.line2.itemAmount":"5882",
      "openinvoicedata.line2.numberOfItems":"1",
      "openinvoicedata.line2.itemVatPercentage":"1900",
      "openinvoicedata.line2.itemVatAmount":"1118",
      "openinvoicedata.line2.vatCategory":"High",
      "openinvoicedata.merchantData":"ZXh0cmEgZGF0YSBoZXJl"
   }
}
<html> 
  <body>
   <form method="post" action="https://test.adyen.com/hpp/select.shtml" id="adyenForm" name="adyenForm" target="_parent">      
      <input type="hidden" name="shopperEmail" value="test102@gmail.com" />
	  <input type="hidden" name="shopperReference" value="test102@gmail.com" />
      <input type="hidden" name="merchantSig" value="3iWDU/V5RMtdaiZC4YRIpoX9/v0=" />
      <input type="hidden" name="sessionValidity" value="2014-10-11T10:30:00Z" />
      <input type="hidden" name="shipBeforeDate" value="2014-10-20" />
      <input type="hidden" name="shopperLocale" value="en_GB" />
      <input type="hidden" name="merchantAccount" value="TestMerchant" />
      <input type="hidden" name="paymentAmount" value="10000" />
      <input type="hidden" name="currencyCode" value="GBP" />
      <input type="hidden" name="skinCode" value="4aD37dJA" />
      <input type="hidden" name="merchantReference" value="Internet order 12345" />
      <input type="hidden" name="recurringContract" value="RECURRING,ONECLICK" />
<!--Invoice Line Specification --> 
	  <input type="hidden" name="openinvoicedata.numberOfLines" value="2" /> <input type="hidden" name="openinvoicedata.refundDescription" value="Refund for testReference" /> 
	  <input type="hidden" name="openinvoicedata.line1.numberOfItems" value="1" /> 
	  <input type="hidden" name="openinvoicedata.line1.itemAmount" value="3500" /> 
	  <input type="hidden" name="openinvoicedata.line1.currencyCode" value="EUR" /> 
	  <input type="hidden" name="openinvoicedata.line1.itemVatAmount" value="665" /> 
	  <input type="hidden" name="openinvoicedata.line1.itemVatPercentage" value="1900" /> 
	  <input type="hidden" name="openinvoicedata.line1.vatCategory" value="High" /> 
	  <input type="hidden" name="openinvoicedata.line1.description" value="Description 1" /> 
	  <input type="hidden" name="openinvoicedata.line2.numberOfItems" value="1" /> 
	  <input type="hidden" name="openinvoicedata.line2.itemAmount" value="2100" /> 
	  <input type="hidden" name="openinvoicedata.line2.currencyCode" value="EUR" /> 
	  <input type="hidden" name="openinvoicedata.line2.itemVatAmount" value="399" /> 
	  <input type="hidden" name="openinvoicedata.line2.itemVatPercentage" value="1900" /> 
	  <input type="hidden" name="openinvoicedata.line2.vatCategory" value="Low" /> 
	  <input type="hidden" name="openinvoicedata.line2.description" value="Description 2" /> 
	  <input type="hidden" name="openinvoicedata.merchantData" value="d2hhdGV2ZXIga2xhcm5hIHJlcXVlc3RzIGZvciBFTUQgY2FuIGJlIHB1dCBoZXJlLg==" />
<!-- Buttons and offset --> 
      <input type="hidden" name="offset" value="0" />
      <input type="submit" value="Send" />
      <input type="reset" />
   </form>   
  </body>
</html>

Calculate total amounts

Your open invoice detail service should respond with the invoice lines corresponding to the specified reference, i.e. the reference originally included in the initial payment request.

The total amount in the line specification response has to match the amount included in the line specification request. To calculate the total amount of the invoice lines, you can refer to the following pseudo-code:

value = 0;

for each (InvoiceLine in lines) {
  value += (itemPrice + itemVAT) * numberOfItems;
}

totalValue = value;

In the request and response code examples, the requested amount (EUR 19,50) matches the total amount of the invoice lines in the response:

(325 + 75) * 4 = 1600
(350 +  0) * 1 = 350
Total: 1600 + 350 = 1950