Endpoint (file upload): POST /inject
Description: Upload a shipping label (PDF or GIF for UPS Saver US) and inject extra content (text and barcode) at the bottom or inside the label. Returns a new PDF.
.pdf for RM/FedEx, .gif for UPS Saver US), sent as multipart/form-dataoutside (default) or inside. Controls where the extra content is placed.rm (default), fedex, or upssaverus. UPS Saver US supports placement=outside only; it rotates the input GIF, centers it on A4 at 110mm width, and places the barcode directly under it.curl Usagecurl -X POST https://barcodeinjector.mikeilin.com/inject \
-F "file=@your_label.pdf" \
-F "barcode_text=CK-2618777-UK" \
-F "placement=inside" \
-F "type=fedex" \
--output output.pdf
Endpoint (URL upload): POST /injecturl
Description: Provide a publicly accessible file URL instead of uploading a file. The server downloads the file in-memory only and applies the same processing as /inject. No source file is persisted on the server.
.pdf or .gif)outside (default) or inside (UPS Saver US supports outside only)rm, fedex, or upssaveruscurl Usagecurl -X POST https://barcodeinjector.mikeilin.com/injecturl \
-H "Content-Type: application/json" \
-d '{
"file_url": "https://easypost-files.s3.us-west-2.amazonaws.com/files/postage_label/20250808/e805df5f33b27b468db70ea6827c13fbd9.pdf",
"barcode_text": "CK-2618777-UK",
"placement": "outside",
"type": "fedex"
}' \
--output output.pdf
Endpoint (base64 image): POST /injectb64
Description: Provide an image as base64 in the payload. Designed for type=upssaverus and behaves like the GIF flow: rotates 90° clockwise, centers on A4 at 110mm width, puts text and barcode beneath, and draws a border around the block. Input is processed in-memory only.
data:image/gif;base64,...).outside (required for UPS Saver US)upssaverustrue/1/yes/on, returns JSON with pdf_b64 instead of a PDF fileresponse_b64; set to b64 or base64curl Usagecurl -X POST https://barcodeinjector.mikeilin.com/injectb64 \
-H "Content-Type: application/json" \
-d '{
"image_b64": "PASTE_BASE64_HERE",
"barcode_text": "CK-2618777-UK",
"placement": "outside",
"type": "upssaverus"
}' \
--output output.pdf
Example (base64 response):
curl -X POST https://barcodeinjector.mikeilin.com/injectb64 \
-H "Content-Type: application/json" \
-d '{
"image_b64": "PASTE_BASE64_HERE",
"barcode_text": "CK-2618777-UK",
"placement": "outside",
"type": "upssaverus",
"response_b64": true
}'
application/pdf