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
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| barcode | String | Yes | The barcode value. Use the full barcode for validate; use the barcode without the check digit for generate. |
| mode | String | No | validate | 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.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| valid | Boolean | No | Whether the barcode is valid. |
| format | String | No | The barcode format. |
| length | Integer | No | The barcode length. |
| barcode | String | No | The barcode value. |
| check_digit | Integer | No | The check digit. |
| expected_check_digit | Integer | No | The expected check digit. |