Introduction
As integrations scale, keeping NetSuite and connected systems (Shopify, Salesforce, etc.) synchronized becomes harder.
Even with good APIs, network delays, user edits, or partial updates can lead to:
- Missing transactions
- Duplicates
- Out-of-sync totals
This guide walks you through automated data reconciliation, so your team can identify mismatches daily — automatically.
🎯 Objectives
- Compare data between NetSuite and external systems.
- Identify mismatched or missing records.
- Generate a reconciliation report.
- Schedule validation automatically.
⚙️ 1. Design Overview
flowchart LR
A[External System: Shopify/Salesforce] -->|API or Export| B[Integration Queue]
B --> C[NetSuite Saved Search (expected data)]
C -->|Compare| D[Reconciliation Script]
D --> E[Results Log + Alert + Dashboard]
✅ This setup keeps NetSuite as the source of truth while validating incoming data from external APIs or CSV exports.
🧱 2. Create a Custom Record: customrecord_reconciliation_log
Field ID | Label | Type |
---|---|---|
custrecord_source_system | Source System | List/Text |
custrecord_record_type | Record Type | Text |
custrecord_nsid | NetSuite Internal ID | Text |
custrecord_extid | External ID | Text |
custrecord_status | Match/Unmatched | List |
custrecord_diff | Difference Details | Long Text |
custrecord_date | Checked On | DateTime |
✅ This record stores one row per reconciliation result.
🔍 3. Step 1 — Fetch External Data
Example for Shopify Orders (pseudo code for clarity):
const shopifyResp = https.get({
url: 'https://api.shopify.com/orders.json?status=any',
headers: { 'X-Shopify-Access-Token': SHOPIFY_TOKEN }
});
const shopifyOrders = JSON.parse(shopifyResp.body).orders.map(o => ({
extId: o.id,
total: parseFloat(o.total_price),
email: o.email
}));
🔎 4. Step 2 — Fetch NetSuite Data (Saved Search)
const results = [];
search.load({ id: 'customsearch_shopify_orders' })
.run().each(r => {
results.push({
nsId: r.id,
extId: r.getValue('custbody_shopify_orderid'),
total: parseFloat(r.getValue('total')),
email: r.getValue('email')
});
return true;
});
⚖️ 5. Step 3 — Compare Records
const mismatches = [];
shopifyOrders.forEach(ext => {
const nsRec = results.find(r => r.extId === ext.extId);
if (!nsRec) {
mismatches.push({ type: 'Missing in NetSuite', ext });
} else if (Math.abs(nsRec.total - ext.total) > 0.01) {
mismatches.push({ type: 'Amount Mismatch', extId: ext.extId, ns: nsRec.total, shopify: ext.total });
}
});
✅ You can expand comparison to fields like customer email, item count, or tax.
🧾 6. Step 4 — Log Results
mismatches.forEach(e => {
const rec = record.create({ type: 'customrecord_reconciliation_log' });
rec.setValue('custrecord_source_system', 'Shopify');
rec.setValue('custrecord_record_type', 'Sales Order');
rec.setValue('custrecord_status', 'UNMATCHED');
rec.setValue('custrecord_diff', JSON.stringify(e));
rec.save();
});
🧮 7. Step 5 — Summary Report
Generate totals after comparison:
log.audit('Reconciliation Summary', {
totalExternal: shopifyOrders.length,
totalNetSuite: results.length,
mismatches: mismatches.length
});
Send summary via email or Slack (reuse logic from Blog 75).
📊 8. Optional — Build a Dashboard
Use a Suitelet with:
- Pie chart (Matched vs. Unmatched).
- Bar chart by system (Shopify, Salesforce).
- List of most frequent mismatch causes.
Integrate this with your existing Integration Health Dashboard (Blog 76).
🔁 9. Schedule Daily or Weekly
Deploy as a Scheduled Script:
- Daily for high-volume systems (Shopify).
- Weekly or monthly for CRM data (Salesforce).
Store each run’s summary for audit and compliance.
🧠 10. Best Practices
Tip | Benefit |
---|---|
Use saved searches for NetSuite data | Consistent filters |
Limit batch size (200–500 records) | Prevent timeouts |
Compare only deltas | Faster performance |
Log differences, not all matches | Smaller footprint |
Add Slack alerts for mismatches | Instant awareness |
Retain history 30–60 days | Audit-ready reports |
✅ Example Output
Source | Record | Status | Details |
---|---|---|---|
Shopify | 30015 | ✅ Matched | — |
Shopify | 30016 | ⚠ Amount mismatch | NS = $149.99 / Shopify = $150.00 |
Salesforce | Opp-1245 | ❌ Missing in NS | Not found |
Conclusion
Data reconciliation ensures your integrations are accurate and auditable.
By automating comparisons between NetSuite and systems like Shopify or Salesforce, you can detect discrepancies early, avoid reporting errors, and maintain trust in your data.
When combined with alerting (Blog 75) and dashboards (Blog 76), this creates a closed-loop integration monitoring ecosystem — from detection to resolution.
Discover more from The NetSuite Pro
Subscribe to get the latest posts sent to your email.
Leave a Reply