The payee or the payee's ERP system should decide the specific KID structure(s) to be used, and this/these structure(s) must be communicated to Mastercard Payment Services as part of the customer’s service agreement.

A payee may have a maximum of 3 different KID structures per AvtaleGiro/OCR agreement, but each of these structures must have different lengths. In addition, the customer reference within the KID (see illustration below) must have a different length for each KID structure.

__KID Length__

A KID can be 4-25 digits, but the length must match the configuration set by the payee in their service agreement.

__KID format__

The KID consists of up to four basic parts:

**Customer ID** – The customer ID is a unique ID for a payer and should be consistent in all payments related to a specific customer or subscription. A KID that only identifies an object (e.g. an apartment number) may not be used unless an ID is added that differentiates the new owner from the previous owner of the object, e.g. a consecutive owner number. Otherwise, the payment claim may be handled incorrectly when the object changes ownership. Note: if using AvtaleGiro and eFaktura in combination, the customer ID should match the "eFaktura reference."

**Payment type** (optional) – Payment types can be used to differentiate between different products or services paid for by a single customer (e.g. rent for a house and a parking space).

**Invoice ID** – The invoice ID is unique for each invoice or payment and is used to distinguish each invoice in a payer/payee relationship.

**Control digit** – The control digit helps ensure that the KID has not been corrupted or changed during communication and processing. The payee or the payee’s ERP system can choose to calculate the control digit using one of two methods: modulus 10 or modulus 11. The control digit is calculated using the rest of the KID as follows:

__For modulus 10__

Step 1 – Multiply each digit of the KID by the weighting, alternating the weights between 2 and 1, starting from the right and moving left.

Step 2 – Add all the digits of the resulting products from step 1. Note that if a product result is a multi-digit number, each individual digit should be summed, not the whole number.

Step 3 – The single last digit of the result of step 2 (7 in the below example) is subtracted from 10. If the single digit from step 2 is 0, the control digit will be 0.

KID Digits 1 2 3 4 5 6 7 0 1 1 2 3 4 5

Weighting 1 2 1 2 1 2 1 2 1 2 1 2 1 2

Products 1 4 3 8 5 12 7 0 1 2 2 6 4 10

Sum of digits 1+4 +3+8 +5+1+2+7+0+1+2+2+6+4+1+0 = 47

Control digit = 10 –
7 =
3

__For modulus 11__

Step 1 – Multiply each digit of the KID by the weighting. The weights follow the pattern 2 3 4 5 6 7 2 3 4 5 6 7 (…), starting from the right and moving left.

Step 2 – Add all the resulting products from step 1. Unlike the modulus 10 calculation described above, the entire products should be added, not the individual digits.

Step 3 – Divide the sum from step 2 by 11 and keep the remainder (the definition of modulus).

Step 4 - Subtract the result of step 3 from 11 for the control digit. If the remainder is 0, the control digit is 0. If the remainder is 1, the control digit must be replaced with a – (minus sign).

KID Digits 1 2 3 4 5 6 7 0 1 1 2 3 4 5

Weighting 3 2 7 6 5 4 3 2 7 6 5 4 3 2

Products 3 4 21 24 25 24 21 0 7 6 10 12 12 10

Sum 3+4+21+24+25+24+21+0+7+6+10+12+12+10 =
179

Control digit = 11 – (179 % 11) = 11 – 3 =
8

Go to topGo back to Developer