Prompt
I'm building a B2B product and need bi-directional sync with NetSuite
Latest observation
Bi-directional sync with NetSuite is very doable, but the right approach depends heavily on what objects you need to sync, how real-time it needs to be, and whether NetSuite is the system of record for each entity.
A practical way to think about it
For bi-directional sync, you usually want:
- A canonical data model in your product
- Field-level ownership rules
- e.g. NetSuite owns invoices, your app owns UI-specific fields
- Change detection on both sides
- Conflict resolution
- Idempotent write logic
- Retry / dead-letter handling
- Observability and auditability
Common NetSuite integration options
1) SuiteTalk REST API
Best for modern integrations when available.
- Good for standard CRUD on many record types
- Easier than SOAP
- Supports pagination, filtering, and some metadata access
- Good fit for “sync objects periodically + webhook-like triggers from your system”
2) SuiteTalk SOAP API
Still common in older/complex NetSuite accounts.
- Wider coverage for some record types and operations
- More verbose and harder to work with
- Often needed for edge cases or legacy implementations
3) SuiteScript / RESTlets
Useful when:
- NetSuite API coverage is insufficient
- You need custom logic close to NetSuite data/processes
- You need to expose custom endpoints
4) Saved Searches / Scheduled exports
Useful for bulk sync and reconciliation.
- Great for incremental polling if APIs are limited
- Not ideal alone for near-real-time bi-directional sync
Typical architecture
Recommended pattern
- Inbound from NetSuite → your app
- Poll modified records or use custom event-based mechanisms
- Store
netsuite_internal_id,last_modified, and sync state
- Outbound from your app → NetSuite
- Push changes via API
- Use an async job queue
- Ensure idempotency with an external ID field
Data model essentials
For each synced record, keep:
external_id/netsuite_internal_idlast_synced_atlast_modified_sourcesync_versionor hashsync_statusconflict_status
Important NetSuite specifics
External IDs
Use External ID wherever possible. It helps with:
- Matching records
- Idempotent upserts
- Reconciliation after failures
Custom fields
If your product needs extra attributes, NetSuite custom fields or custom records are often necessary.
Governance / rate limits
NetSuite has governance limits and API throughput considerations:
- Batch where possible
- Avoid chatty sync patterns
- Backoff and retry on throttling/errors
Record relationships
NetSuite data often has dependencies:
- Customers → Contacts → Sales Orders → Invoices
- You’ll need to sync in dependency order or support deferred linking.
Conflict resolution strategies
Choose one per field or object:
- Last write wins — simplest, but risky
- Source of truth by field — usually best
- Manual review queue — for ambiguous conflicts
- Version checks — reject stale updates
For B2B products, a field-ownership model usually works best.
A good implementation pattern
Option A: Near-real-time
- Webhooks/events from your app
- Polling or scheduled incremental sync from NetSuite
- Queue-based processors
- Reconciliation job nightly
Option B: Batch-first
- 5–15 minute polling windows
- Bulk upserts
- Reconciliation after each batch
- Simpler and often sufficient
Questions to answer before designing it
- Which records? Customers, contacts, orders, invoices, items, custom records?
- Who owns each field?
- Do you need true real-time or is 5–15 minutes okay?
- Is this one-way in some areas and two-way in others?
- Do you need to support custom objects in NetSuite?
- Do you need multi-tenant sync across many customer NetSuite accounts?
Recommendation
If you’re early, I’d suggest:
- Use REST API where possible
- Build async, queued sync jobs
- Use external IDs
- Define field ownership
- Add a nightly reconciliation process
If you want, I can help you design:
- a NetSuite sync architecture,
- a data model for bi-directional sync, or
- a field-by-field ownership matrix for your specific objects.