apyhub
Back
DATA VALIDATION · E-COMMERCE QUICK TOOLS

Barcode Check Digit Validator

What it does

Barcode Check Digit Validator helps you validate barcode strings or generate the missing check digit for common retail formats like EAN, UPC, and ISBN. Send a barcode in the request body, choose a mode, and get a compact result back.

Use mode: validate to check a full barcode, or mode: generate to compute the check digit from the barcode body without it. The response can include valid, format, length, barcode, check_digit, and expected_check_digit, depending on the input and mode. That makes it easy to confirm data at the point of capture or fill in incomplete product codes before you store them.

Barcode Check Digit Validator is a fit for catalog imports, POS integrations, inventory tools, and validation steps in e-commerce workflows. If you are cleaning supplier feeds or checking scanned codes before persistence, this endpoint gives you a simple deterministic check without extra parsing logic. If you already have a full code, validate it. If you only have the body, use generate to get back the check digit plus the finished barcode, or check_digit if you just need the digit itself without the assembled code.

POST
Validate or generate barcode check digits (EAN/UPC/ISBN).
https://api.eu.apyverse.com/pankajretestflows/validate-barcode-check-digits

QUICKSTART

GUIDE

Quickstart

Validate a barcode check digit by sending the full barcode you want to check.

curl -X POST "https://api.eu.apyverse.com/pankajretestflows/validate-barcode-check-digits" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"barcode":"4006381333931"}'

What you'll get back

{
  "valid": true,
  "format": "EAN-13",
  "length": 13,
  "barcode": "4006381333931",
  "check_digit": 1,
  "expected_check_digit": 1
}

Generate a check digit (and the finished barcode)

Send the barcode body without its check digit, and set mode to generate:

curl -X POST "https://api.eu.apyverse.com/pankajretestflows/validate-barcode-check-digits" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"barcode":"400638133393","mode":"generate"}'
{
  "mode": "generate",
  "format": "EAN-13",
  "body": "400638133393",
  "check_digit": 1,
  "barcode": "4006381333931"
}

Get just the check digit

Same body, with mode set to check_digit — this skips assembling the full barcode and returns only the computed digit:

curl -X POST "https://api.eu.apyverse.com/pankajretestflows/validate-barcode-check-digits" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"barcode":"400638133393","mode":"check_digit"}'
{
  "mode": "check_digit",
  "format": "EAN-13",
  "body": "400638133393",
  "check_digit": 1
}
TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*
The barcode (full, for validate; body without check digit, for generate)
validate | generate | check_digit

About this endpoint

What it does

Validates a barcode's check digit, or computes the check digit for a barcode body, for an EAN/UPC/ISBN barcode. The request body accepts the barcode and an optional mode, and the response shape depends on which mode you use — see the tables below.

Request Body

ParameterTypeMandatoryDescription
barcodeStringYesFor validate, pass the full barcode (including its check digit). For generate and check_digit, pass only the barcode body, without the check digit.
modeStringNovalidate (default) checks whether a full barcode's check digit is correct. generate computes the check digit for a barcode body and returns the full assembled barcode. check_digit computes the check digit for a barcode body only, without assembling the full barcode.

Response

The response fields differ by mode:

validate

ParameterTypeMandatoryDescription
validBooleanNoWhether the barcode is valid.
formatStringNoThe barcode format.
lengthIntegerNoThe barcode length.
barcodeStringNoThe barcode value.
check_digitIntegerNoThe check digit.
expected_check_digitIntegerNoThe expected check digit.

Example:

{
  "valid": true,
  "format": "EAN-13",
  "length": 13,
  "barcode": "4006381333931",
  "check_digit": 1,
  "expected_check_digit": 1
}

generate

ParameterTypeMandatoryDescription
modeStringNoEchoes the mode used, "generate".
formatStringNoThe barcode format.
bodyStringNoThe barcode body you sent (without check digit).
check_digitIntegerNoThe computed check digit.
barcodeStringNoThe full barcode, with the computed check digit appended.

Example:

{
  "mode": "generate",
  "format": "EAN-13",
  "body": "400638133393",
  "check_digit": 1,
  "barcode": "4006381333931"
}

check_digit

ParameterTypeMandatoryDescription
modeStringNoEchoes the mode used, "check_digit".
formatStringNoThe barcode format.
bodyStringNoThe barcode body you sent (without check digit).
check_digitIntegerNoThe computed check digit.

Example:

{
  "mode": "check_digit",
  "format": "EAN-13",
  "body": "400638133393",
  "check_digit": 1
}

Note: check_digit returns everything generate does except the assembled barcode field — that's the field to reach for if you need the finished code, not just the digit.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.