Deutsche Post Identcode

Deutsche Post Identcode barcode in PHP: 12 digit input, check digit, code example and SVG output

Identcode identifies a consignment in the Deutsche Post network: two digits of primary distribution centre, three of customer number, six of consignment number, and a check digit. It is drawn as Interleaved 2 of 5.

Type Token

ItemValue
Type tokenIDENTCODE
Enum caseBarcodeType::IDENTCODE
FamilyPostal
Class\Com\Tecnick\Barcode\Type\Linear\Identcode

Input

ItemValue
Character setdigits
Length11 digits, or 12 with a valid check digit
Checkmodulo 10 with weights 4 and 9, appended by the library
Extra parametersnone

Examples

A consignment number

<?php

require_once __DIR__ . '/vendor/autoload.php';

$barcode = new \Com\Tecnick\Barcode\Barcode();
$bobj = $barcode->getBarcodeObj(
    type: 'IDENTCODE',
    code: '56310243031',
    width: -3,
    height: -30,
    color: 'black',
    padding: [0, 0, 0, 0],
)->setBackgroundColor('white');

echo $bobj->getInlineSvgCode();

Deutsche Post Identcode barcode encoding 56310243031

Errors

These payloads raise \Com\Tecnick\Barcode\Exception:

PayloadMessage
5631024303131The code must be 11 digits without the check digit or 12 with it, 13 given
56310243031AInput code must be a number

See Also