Managing Long Receipts
The BlinkReceipt Scan API supports multi-frame processing for long receipts, enabling you to submit multiple images of a single receipt. Once the last frame is submittied, results will be aggregated and returned in the last request. We recommend allowing users to take multiple images of a long receipt in sections, rather than attempt to capture a long receipt from within one image. Proximity to a receipt will improve OCR results
Follow these steps to manage long receipts:
Step-by-Step Instructions
1. Submit the First Frame:
-
Include the first image of the receipt.
-
Set
frame_idxto1 -
Set
last_frametofalse(indicating that more frames will follow).
- Note: Save the
blink_receipt_idfrom the response, as it is required for subsequent frames.
2. Submit Subsequent Frames:
-
Include the
blink_receipt_idreturned from the first request. -
Increment frame_idx by 1 for each new frame.
-
Keep last_frame set to false for intermediate frames.
Sample Request for Frame 2:
- Submit the Final Frame:
-
Include the
blink_receipt_idfrom the initial request. -
Set
last_frametotrueto indicate the end of the receipt submission.
- Sample Request for the Last Frame:
Key Notes:
- Order Matters: Ensure frames are submitted sequentially, starting with
frame_idx=1. - Use Last Frame Flag: The final frame must have
last_frame=trueto indicate the completion of the submission. - Optional Final Call: If your workflow doesn’t know the last frame during real-time processing, make an additional API call after all frames are submitted with just the
license_key,blink_receipt_id, andlast_frame=trueto finalize the session.