AI Email Import
Borderbolt’s AI Email Import feature uses Claude AI to extract customs data from PDF documents sent via email, automatically creating draft declarations for review and submission. This streamlines data entry for customers who provide declaration information as invoices, packing lists, or other documents.
How It Works
Workflow Overview
Customer Email → MailerSend → AI Extraction → Draft Declaration → Review → Submit- Customer sends email with declaration documents (PDF attachments) to your unique email address
- MailerSend receives the email and parses attachments
- Borderbolt webhook is triggered with email data
- Claude AI extracts customs data from PDFs (invoices, packing lists, bills of lading)
- Draft declaration is created with extracted data
- AI Workbench shows the extraction for review
- User reviews data, makes corrections if needed
- User approves and creates final declaration for submission
Setting Up Email Import
Prerequisites
Before enabling AI Email Import:
- Active Borderbolt subscription with AI features enabled
- MailerSend account configured (automatic for hosted customers)
- Anthropic Claude API access (configured by Borderbolt admin)
Enabling Email Import
- Navigate to Settings → AI Import
- Toggle Enable Email Import
- A unique email address is generated for your organization:
- Format:
{random-uuid}@aideclarations.borderbolt.com - Example:
a1b2c3d4-e5f6-7890@aideclarations.borderbolt.com
- Format:
- Copy this email address
- Share it with customers who will send declaration documents
Unique Email Address: Each organization gets a unique email address to ensure proper routing. Never share your email address with other companies.
Email Settings
Configure how emails are processed:
Auto-Processing
- Auto-Process Emails: Automatically extract data and create drafts (recommended)
- Manual Review Only: Store emails for manual processing (slower but more control)
Confidence Threshold
- Minimum Confidence: AI confidence score required to auto-create drafts (0-100%)
- High (80%+): Only very confident extractions auto-create drafts
- Medium (60%+): Most extractions auto-create drafts (recommended)
- Low (40%+): All extractions auto-create drafts (may have errors)
- If confidence is below threshold, email is flagged for manual review
Default Values
Set defaults for AI-created declarations:
- Default Customer: Pre-fill customer (if all emails are from one customer)
- Default Declarant: Your declarant to use for AI declarations
- Default Declaration Type: H1 (import), B1 (export), or Auto-detect
- Default Office: Customs office code (e.g., NL000396)
Notification Settings
- Notify on Receipt: Email notification when customer email received
- Notify on Draft Created: Email when draft declaration created by AI
- Recipients: Email addresses to notify (comma-separated)
Click Save Settings to apply.
Supported File Types
PDF Documents
AI Email Import currently supports PDF files:
- Invoices (commercial invoices, proforma invoices)
- Packing Lists (detailed item lists)
- Bills of Lading (B/L)
- Airway Bills (AWB)
- CMR (international consignment notes)
- Certificates of Origin
- Other declaration documents
File Size Limit: 50MB per attachment
Multiple Files: Attach multiple PDFs in one email - AI combines data from all files
Future Support
Coming soon:
- Excel spreadsheets (.xlsx)
- Word documents (.docx)
- Images (JPEG, PNG)
Customer Email Instructions
What to Tell Customers
Provide these instructions to customers:
Email Subject: Include reference number or shipment ID (e.g., “Import Declaration - Order #12345”)
Email Body: Brief description of the shipment (optional but helpful)
Attachments: Attach one or more of the following:
- Commercial invoice (required)
- Packing list (recommended)
- Bill of Lading or Airway Bill (recommended)
- Certificate of Origin (if applicable)
- Other supporting documents
Send to: {your-unique-email}@aideclarations.borderbolt.com
Note: You will receive a confirmation email when we receive your documents. We’ll notify you when your declaration is ready for review.
Example Customer Email
To: a1b2c3d4-e5f6-7890@aideclarations.borderbolt.com
Subject: Import Declaration - PO #2024-5678
Hi,
Please prepare import declaration for our shipment arriving tomorrow:
- Purchase Order: 2024-5678
- Supplier: ABC Trading Co., China
- Expected arrival: Rotterdam port
Attached:
- Commercial invoice
- Packing list
- Bill of Lading
Thanks,
John Doe
Logistics ManagerClaude AI Extraction
What Data is Extracted?
Claude AI analyzes PDF documents and extracts:
Declaration Header
- Declaration Type: Auto-detect import or export
- Parties:
- Importer/Exporter EORI and name
- Buyer/Seller name and address
- Consignor/Consignee details
- Transport:
- Mode of transport (sea, air, road, rail)
- Transport document number (B/L, AWB, CMR)
- Container numbers
- Seal numbers
- Commercial:
- Total invoice amount and currency
- Incoterms (FOB, CIF, DDP, etc.)
- Payment terms
- References:
- Invoice number and date
- Purchase order number
- Customer reference
Declaration Lines
For each item on the invoice/packing list:
- Description: Product description
- HS Code: If mentioned in documents (otherwise requires manual entry)
- Quantity: Number of units
- Unit Price: Price per unit
- Currency: Invoice currency
- Line Total: Extended value
- Country of Origin: If stated
- Gross Weight: Total weight
- Net Weight: Item weight
- Package Details: Number and type of packages
Extraction Confidence
Each extracted field has a confidence score:
- High (90-100%): Field is clearly stated and unambiguous
- Medium (70-89%): Field is inferred with reasonable confidence
- Low (50-69%): Field is uncertain, requires review
- None (<50%): Field not found or too uncertain to extract
Low-confidence fields are highlighted in the AI Workbench for manual review.
AI Limitations
AI may struggle with:
- Handwritten documents: OCR quality varies
- Poor scan quality: Low-resolution or blurry PDFs
- Non-standard formats: Custom invoice layouts
- Multiple languages: Mixed-language documents
- Complex tables: Nested or merged cells
- HS Codes: If not explicitly stated in documents
Always review AI extractions before finalizing declarations.
AI Workbench
Accessing the Workbench
- Navigate to AI Import → Workbench
- View all email imports and extractions
Email Import List
The workbench shows:
- Received Date: When email was received
- From: Sender email address
- Subject: Email subject line
- Attachments: Number of PDF files
- Status:
- Pending: Awaiting processing
- Processing: AI extraction in progress
- Review: Ready for review
- Approved: Draft declaration created
- Rejected: Extraction rejected, not usable
- Confidence: Overall confidence score
- Actions: Review, Approve, Reject, Delete
Reviewing an Extraction
- Click Review on an email import
- The extraction details page opens
Extracted Data View
Left Panel: Original PDF(s)
- View embedded PDFs
- Zoom, navigate pages
- Highlight extracted fields (shows where AI found each value)
Right Panel: Extracted declaration data
- Header fields (parties, transport, commercial)
- Line items (description, quantity, value)
- Confidence indicators (color-coded)
- Editable fields (click to modify)
Confidence Color Coding:
- 🟢 Green: High confidence (90%+)
- 🟡 Yellow: Medium confidence (70-89%)
- 🔴 Red: Low confidence (<70%)
Making Corrections
- Click on any field to edit
- Update the value
- Confidence changes to “Manual Override” (100%)
- Click Save Changes
Common corrections:
- Add missing HS codes
- Fix party EORI numbers
- Correct country codes
- Adjust quantities or weights
- Update invoice amounts
Approve or Reject
Approve:
- Review all fields (especially low-confidence ones)
- Make necessary corrections
- Click Approve & Create Declaration
- A draft declaration is created
- Navigate to Declarations to finalize and submit
Reject:
- Click Reject
- Provide reason for rejection:
- Documents not usable (poor quality)
- Wrong document type
- Missing critical information
- Duplicate submission
- Email sender is notified (if configured)
- Extraction is archived
AI Import Settings
Advanced Settings
Configure AI behavior:
AI Model Selection
- Claude 3.5 Sonnet (default): Best balance of speed and accuracy
- Claude 3 Opus: Highest accuracy for complex documents (slower, more expensive)
- Claude 3 Haiku: Fastest processing for simple documents (lower accuracy)
Select based on document complexity and volume.
Field Extraction Priority
Prioritize which fields AI focuses on:
- All Fields: Extract everything (default)
- Header Only: Extract declaration header, manual line entry
- Lines Only: Extract items, manual header entry
Auto-Processing Rules
Create rules for automatic approval:
- High Confidence Only: Auto-create drafts only if all fields >90% confidence
- Known Customers: Auto-approve emails from whitelisted sender addresses
- Specific Senders: Route certain senders to specific customers or declarants
Email Filters
Filter which emails are processed:
- Allowed Senders: Whitelist of email addresses or domains
- Blocked Senders: Blacklist of email addresses or domains
- Required Keywords: Email subject/body must contain keywords (e.g., “import”, “declaration”)
- Blocked Keywords: Reject emails with spam keywords
Auto-Process Settings
Set up automated workflows:
- Confidence Threshold: 70% (recommended)
- Auto-Create Drafts: Enabled
- Auto-Approve: Disabled (always require manual review)
- Auto-Notify Customer: Enabled (email confirmation when draft ready)
This ensures:
- Most extractions create drafts automatically
- User always reviews before finalizing
- Customer knows when declaration is ready
Email Notifications
Customer Notifications
Send automatic emails to customers:
Receipt Confirmation
When: Email received and queued for processing To: Sender Content:
- Thank you for your submission
- Confirmation number
- Estimated processing time
- What happens next
Draft Ready
When: Draft declaration created and ready for review To: Sender (optional) Content:
- Declaration draft created
- Extraction confidence summary
- Link to view status (if customer portal enabled)
- Estimated submission time
Submission Confirmation
When: Declaration submitted to customs To: Sender Content:
- Declaration submitted
- MRN (if received)
- Expected clearance time
- Next steps
Internal Notifications
Notify your team:
New Email Received
When: Customer email arrives To: Operations team Content:
- Sender and subject
- Number of attachments
- Link to review in workbench
Review Required
When: Extraction complete but confidence below threshold To: Declarant or operations team Content:
- Extraction summary
- Low-confidence fields highlighted
- Link to AI Workbench for review
Approval Needed
When: Draft created but auto-approve disabled To: Approver Content:
- Declaration summary
- Total value and duty estimate
- Link to approve and submit
Best Practices
Customer Onboarding
- Provide Clear Instructions: Email format, required documents, subject line format
- Test with Sample: Have customer send test email before go-live
- Feedback Loop: Ask customers which fields AI gets wrong most often
- Training: Train customers to provide consistent document formats
Document Quality
- Encourage PDFs: Ask customers to send PDFs instead of scans when possible
- Resolution: If scanning, use 300 DPI minimum
- Clarity: Ensure text is readable (not blurry or too small)
- Complete Documents: Full invoice with all pages, not excerpts
Review Process
- Daily Review: Check AI Workbench daily for pending extractions
- Prioritize by Confidence: Review low-confidence extractions first
- Consistent Corrections: If AI consistently misses a field, update extraction rules
- Feedback to Customers: If documents are consistently problematic, request format changes
Workflow Optimization
- Set Realistic Thresholds: Start with 70% confidence, adjust based on accuracy
- Automate High-Confidence: Auto-approve extractions >95% confidence from known customers
- Batch Processing: Review multiple extractions in one session for efficiency
- Track Performance: Monitor AI accuracy over time, adjust settings as needed
Troubleshooting
Emails Not Being Received
“Customer sent email but nothing in workbench”
- Verify customer sent to correct email address
- Check spam/junk folder (MailerSend emails may be filtered)
- Verify MailerSend inbound route is configured (Settings → Integrations → MailerSend)
- Check email filters (blocked sender or missing required keywords)
“Email received but not processed”
- Check if email has PDF attachments (other formats not yet supported)
- Verify attachments are <50MB
- Review processing queue (may be delayed during high volume)
- Check error logs (Settings → Logs → AI Import)
Low Extraction Quality
“AI extracts wrong data or misses fields”
- Check PDF quality (resolution, clarity)
- Review document format (non-standard layouts may confuse AI)
- Ensure text is selectable (not scanned image-only PDF)
- Try higher AI model (Claude Opus for complex documents)
- Provide feedback to improve AI (Settings → AI Import → Training)
“HS codes always wrong or missing”
- HS codes are rarely in customer documents
- Configure Item Master with customer SKUs mapped to HS codes
- Enable SKU matching (AI extracts SKU, system looks up HS code)
- Expect manual HS code entry for new items
Confidence Issues
“All extractions show low confidence”
- Check document quality (blurry, low-resolution, handwritten)
- Review AI model selection (try Claude Opus)
- Verify documents are in supported language (English, Dutch, German, French)
- Consider manual entry for very complex documents
“AI is too conservative (high confidence threshold)”
- Lower confidence threshold to 60-70%
- Review manually to verify accuracy
- Gradually increase threshold as AI learns
Integration Issues
“MailerSend webhook not working”
- Verify webhook URL is correct (Settings → Integrations → MailerSend)
- Check webhook secret is configured
- Test webhook manually (MailerSend dashboard → Webhooks → Test)
- If uploads fail with size errors, contact your Borderbolt administrator
“Anthropic API errors”
- Check API key is valid (Settings → Integrations → Anthropic)
- Verify API quota is not exceeded (check Anthropic dashboard)
- Review API error logs for specific error messages
- Contact support if persistent
Related Topics
- Declarations - Finalize and submit AI-created declarations
- Item Master - Map customer SKUs to HS codes for better extraction
- Customers - Configure customer defaults for AI import
- Settings - Configure MailerSend and Anthropic integrations