Generate signed GS1 Digital Link barcode URLs for your products, and authenticate every scanned barcode from your own backend.
REST · JSONServer-to-serverGS1 Digital LinkAPI Key AuthBase URL: https://api.ratifye.ai
01Overview
Ratifye.ai provides APIs for generating signed barcode URLs and authenticating scanned barcode URLs. The APIs are intended for server-to-server integration and should be called from a trusted backend where the API key can be kept private.
The Generate API creates a serial pool and the corresponding barcode URLs. The Scan Authentication API accepts a scanned Ratifye URL and returns the decoded GS1 data together with authentication information and barcode quality.
Base URL
URL
https://api.ratifye.ai
02Authentication
Every API request requires an API key in the x-api-key header. Production keys must remain private; they appear as YOUR_API_KEY throughout this document.
Header
Value
Content-Type
application/json
x-api-key
YOUR_API_KEY
03Barcode Generate API
POST/barcode/generate?serialEnabled=true
When serialEnabled=true, Ratifye.ai generates unique serial values and returns a signed URL for each serial. The example below requests 1,000 serials, and the response reports urlsCount: 1000.
Unique ID of the generated serial pool. Store it for reconciliation.
serials
Array of generated serial values.
urls
Array of signed barcode URLs, one per serial, ready for printing.
urlsCount
Number of URLs generated.
timings
Processing time in milliseconds for each stage: serial pool, URL build, signature, audit, serial update and total. 1,000 URLs were generated in 864 ms in the example.
04Barcode URL structure
Each generated URL follows the GS1 Digital Link format. Every value is preceded by its GS1 Application Identifier (AI).
Parsed GS1 values keyed by Application Identifier, each with a name and value.
encrypted_text
Encrypted signature text carried in the barcode.
quality
Authentication result for the scan. Real in the example. Use this field in your scan decision flow.
06GS1 Application Identifiers
AI
Name
Example value
Meaning
01
GTIN
18901234567897
Global Trade Item Number
10
Batch/Lot
AMI432
Batch or lot identifier
17
Expiry
270606
Expiry date (YYMMDD)
21
Serial
GKBM4O3OI0SB
Unique product/item serial
07Recommended integration flow
Store the API key securely on your backend.
Call the Generate API with product, batch, expiry and serial-pool parameters.
Store poolId, serials and urls as required by your business workflow.
Print or distribute the generated barcode payloads on your packaging.
Send each scanned Ratifye URL to the Scan Authentication API.
Read gs1_data and quality from the response.
Use the authentication response as the trusted scan result.
08Security guidelines
Keep API keys confidential and server-side.
Use HTTPS for all API calls.
Do not expose production API keys in mobile apps or browser bundles.
Do not log complete API keys.
Validate both the HTTP status and the success field.
Handle authentication failures, malformed URLs, network failures and empty data arrays.
Use the returned quality field in the scan decision flow.
09Example client-side processing
JavaScript · client handler
const response = await authenticateBarcode(scannedUrl);
if (response.success && response.data?.length) {
const result = response.data[0];
console.log(result.gs1_data["01"].value); // GTIN
console.log(result.gs1_data["10"].value); // Batch/Lot
console.log(result.gs1_data["17"].value); // Expiry
console.log(result.gs1_data["21"].value); // Serial
console.log(result.quality); // Real
}
Note for client developers. Examples are based on the payloads supplied for the Ratifye.ai integration; serials and URLs are abbreviated for readability. Replace YOUR_API_KEY with the credential issued for the appropriate environment, keep credentials outside source control, and rotate them if exposed.
10Quick reference
Operation
Method
Endpoint
Generate barcode URLs
POST
/barcode/generate?serialEnabled=true
Authenticate scanned barcode
POST
/barcode/scan/authenticate
Ratifye.ai · Barcode API · Developer DocumentationSchoofi Software Solutions Pvt. Ltd. · New Delhi