Supporting Guide
REST API Documentation: Endpoint Shape, Validation Behavior, and Error Handling
The barcode API surface should stay intentionally small: one generation endpoint, predictable validation errors, and a clear contract for output formats. That keeps client SDKs easier to test and makes operational telemetry easier to interpret.
| Field | Meaning |
|---|---|
| data | Raw payload to encode after client-side validation |
| type | Symbology selector such as code128, upca, ean13, datamatrix, qr, or pdf417 |
| format | Preferred output such as svg, png, pdf, or eps |
GET /v1/generate?data=012345678905&type=upca&format=svg
Authorization: Bearer YOUR_API_KEY
Return 422 for invalid payload structure, 429 for throttling, and content-type-specific success bodies for the requested format.