apyhub
DATA VALIDATION · DEVELOPER TOOLS

Validate Or Generate Barcode Check Digits API

What it does

Barcode Check Digit Validator checks or generates barcode check digits for EAN, UPC, and ISBN values. Send a barcode string, and use mode to validate a full code, generate a check digit for the body, or calculate the check digit directly.

The response tells you whether the barcode is valid and may include the detected format, length, the normalized barcode, and check-digit fields such as check_digit and expected_check_digit. That makes it useful when you need to catch mistyped product codes, verify imported catalog data, or finish building a barcode before storing or printing it.

Use it in inventory systems, product feeds, checkout flows, or admin tools where barcode accuracy matters. It gives you a small, focused validation step without having to implement barcode math in your own service.

If you already have a full code, validate it. If you only have the body, generate the check digit and compare the result before moving the record downstream.

POST
Validate or generate barcode check digits (EAN/UPC/ISBN).
http://localhost:8080/creightonnick0/validate-barcode-check-digits
QUICKSTARTGUIDE

Quickstart

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

curl -X POST "http://localhost:8080/creightonnick0/validate-barcode-check-digits" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"barcode":"4006381333931"}'

What you'll get back

Returns a JSON object with these top-level fields: valid (boolean), format (string), length (integer), barcode (string), check_digit (integer), and expected_check_digit (integer).

{
  "valid": true,
  "format": "EAN-13",
  "length": 13,
  "barcode": "4006381333931",
  "check_digit": 1,
  "expected_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*
Operation to perform on the barcode.
The barcode (full, for validate; body without check digit, for generate)

About this endpoint

What it does

Validates a barcode’s check digit or generates/returns the check digit information for an EAN/UPC/ISBN barcode. The request body accepts the barcode and an optional mode, and the response returns barcode validation/check-digit details in a JSON object.

Request Body

ParameterTypeMandatoryDescription
barcodeStringYesThe barcode value. Use the full barcode for validate; use the barcode without the check digit for generate.
modeStringNovalidate | generate | check_digit.

Response

Returns a JSON object with these top-level fields: valid boolean, format string, length integer, barcode string, check_digit integer, and expected_check_digit integer. The schema does not declare any nested response structure.

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.

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.