Training Documentation - Forums
- Forge
Get Involved Get Involved - Home
- Jobs
- Ideas
- Members
- Mentorship
- User Groups

- Downloads

- Platforms
- OutSystems.com
- My Platform
- Community

- Resources
Support

Log in

Sign Upversion 1.0.1 (Compatible with OutSystems 11)

Uploaded

on 11 Oct (4 weeks ago)

by Details

The Global Trade Item Number is an identifier for trade items, developed by the international organization GS1. Such identifiers are used to look up product information in a database which may belong to a retailer, manufacturer, collector, researcher, or other entity. You can validate all your GS1 Standard GTIN numbers effortlessly using this plugin.

Read more
$( document ).ready(function() {
var height = $('#PortalTheme_wt3_block_wtMainContent_wt7_Forge_Pat_wt121_block_wtContent_Forge_Pat_wt200_block_wtContent_Forge_Pat_wt197_block_wtSectionExpandable_WebPatterns_wtSectionExpandable_DetailsContent_block').find('.ReadMoreContainer').height();
var Header = $('#PortalTheme_wt3_block_wtMainContent_wt7_Forge_Pat_wt121_block_wtContent_Forge_Pat_wt200_block_wtContent_Forge_Pat_wt197_block_wtSectionExpandable_WebPatterns_wtSectionExpandable_DetailsContent_block').find('.SectionExpandable_header');
if(height > 190){
Header.click(function() {
toggleExpandCollapse('PortalTheme_wt3_block_wtMainContent_wt7_Forge_Pat_wt121_block_wtContent_Forge_Pat_wt200_block_wtContent_Forge_Pat_wt197_block_wtSectionExpandable_WebPatterns_wtSectionExpandable_DetailsContent_block_wtTitle_wt162_wtBtn_ReadMore', 'Read less', 'Read more');
})
}
else {
Header.hide()
}
});

**GTIN Validator**

GTIN (Global Trade Item Number) is used to uniquely identify trade items globally. There are different types of GTINs based on their lengths: GTIN-8, GTIN-12 (UPC), GTIN-13 (EAN), and GTIN-14. They all use a checksum formula to ensure the code's validity, which is based on the Modulo 10 (mod 10) algorithm. Here are the validation formulas for each type:

**General Steps for GTIN Validation (Mod 10 Algorithm)**

1. Start from the rightmost digit (ignoring the check digit).

2. Multiply each digit by a weight (alternating between 3 and 1).

- For GTIN-12 and GTIN-13, start with 1.

- For GTIN-8 and GTIN-14, start with 3.

3. Sum all the products.

4. Take the sum modulo 10.

5. Subtract the result from 10 to get the check digit.

6. If the result is 10, the check digit is 0.

** GTIN-8 Validation Formula**

For a GTIN-8 (which has 7 digits + 1 check digit):

1. Multiply each digit by alternating weights of 3 and 1, starting with 3.

2. Sum the results.

3. Take the sum modulo 10 and subtract from 10 to get the check digit.

Example: GTIN-8 = `1234567` (7 digits, check digit will be calculated)

- (1 * 3) + (2 * 1) + (3 * 3) + (4 * 1) + (5 * 3) + (6 * 1) + (7 * 3) = 3 + 2 + 9 + 4 + 15 + 6 + 21 = 60

- 60 % 10 = 0

- Check digit is 0, so the valid GTIN-8 is `12345670`.

** GTIN-12 (UPC-A) Validation Formula**

For a GTIN-12 (which has 11 digits + 1 check digit):

1. Multiply each digit by alternating weights of 1 and 3, starting with 1.

2. Sum the results.

3. Take the sum modulo 10 and subtract from 10 to get the check digit.

Example: GTIN-12 = `03600029145` (11 digits, check digit will be calculated)

- (0 * 1) + (3 * 3) + (6 * 1) + (0 * 3) + (0 * 1) + (2 * 3) + (9 * 1) + (1 * 3) + (4 * 1) + (5 * 3) = 0 + 9 + 6 + 0 + 0 + 6 + 9 + 3 + 4 + 15 = 52

- 52 % 10 = 2

- Check digit is 10 - 2 = 8, so the valid GTIN-12 is `036000291458`.

** GTIN-13 (EAN) Validation Formula**

For a GTIN-13 (which has 12 digits + 1 check digit):

1. Multiply each digit by alternating weights of 1 and 3, starting with 1.

2. Sum the results.

3. Take the sum modulo 10 and subtract from 10 to get the check digit.

Example: GTIN-13 = `400638133393` (12 digits, check digit will be calculated)

- (4 * 1) + (0 * 3) + (0 * 1) + (6 * 3) + (3 * 1) + (8 * 3) + (1 * 1) + (3 * 3) + (3 * 1) + (3 * 3) + (9 * 1) + (3 * 3) = 4 + 0 + 0 + 18 + 3 + 24 + 1 + 9 + 3 + 9 + 9 + 9 = 89

- 89 % 10 = 9

- Check digit is 10 - 9 = 1, so the valid GTIN-13 is `4006381333931`.

** GTIN-14 Validation Formula**

For a GTIN-14 (which has 13 digits + 1 check digit):

1. Multiply each digit by alternating weights of 3 and 1, starting with 3.

2. Sum the results.

3. Take the sum modulo 10 and subtract from 10 to get the check digit.

Example: GTIN-14 = `1234567890123` (13 digits, check digit will be calculated)

- (1 * 3) + (2 * 1) + (3 * 3) + (4 * 1) + (5 * 3) + (6 * 1) + (7 * 3) + (8 * 1) + (9 * 3) + (0 * 1) + (1 * 3) + (2 * 1) + (3 * 3) = 3 + 2 + 9 + 4 + 15 + 6 + 21 + 8 + 27 + 0 + 3 + 2 + 9 = 109

- 109 % 10 = 9

- Check digit is 10 - 9 = 1, so the valid GTIN-14 is `12345678901231`.

Release notes (1.0.1)

All the actions are modified as reusable components

License (1.0.1)

BSD-3 license (https://opensource.org/licenses/BSD-3-Clause)

Reviews (0)

Other assets in this category$(document).ready(function() {
$content = $('#PortalTheme_wt3_block_wtMainContent_wt7_Forge_CW_wt114_block_wt5_WebPatterns_wt3_block_wtContent').detach();
$('#PortalTheme_wt3_block_wtMainContent_wt7_Forge_CW_wt114_block_wt5_RichWidgets_wtCurationInfo_block').tooltipster({
content: $content,
trigger: 'hover',
interactive: true,
contentCloning: false,
position: 'bottom',
theme: 'Balloon',
zindex: $('#PortalTheme_wt3_block_wtMainContent_wt7_Forge_CW_wt114_block_wt5_RichWidgets_wtCurationInfo_block').closest('.Header').css('zIndex')
}).addClass('balloon');
});