← Hub NetSuite Integration Map
v10.0
NetSuite Integration Map
Brand System v10.0 — Integration Architecture
NetSuite
Integration
Map
11 external systems connected via TBA + RESTlets.
Complete integration architecture for Global Food Solutions NetSuite deployment. Covers Cloudflare Workers, Zoho CRM, EDI, banking APIs, shipping carriers, USDA compliance, CME data feeds, and Claude AI connections with full endpoint documentation.
RESTlets Webhooks EDI APIs Sync
Document ID GFS-NS-INTMAP
Region Edgewood / Hermitage
Status Active
Version 9.0
Date 05 / 19 / 2026
Classification Integration Arch
Auth TBA (Token-Based)
Integrations 11 External Systems
Owner Global Food Solutions, Inc.
02 Integration Architecture System Topology — NetSuite at Center, 11 Bidirectional Connections
NETSUITE ERP · TBA AUTH CLOUDFLARE WORKERS Webhooks · Scheduled Tasks ZOHO CRM Customer Sync ZOHO MAIL Transactional Emails DROPBOX File Storage · Spec Sheets CLAUDE AI Frosty Chat · Doc Gen EDI GATEWAY 850 / 810 / 856 BANKING APIs ACH · Payments · Recon SHIPPING APIs FedEx · UPS · Tracking USDA PORTAL Compliance · Reporting CME DATA FEED Commodity Prices OPENFOODFACTS Nutrition Data Bidirectional Sync Async / Scheduled Real-time

All integrations authenticate via Token-Based Authentication (TBA) through RESTlet endpoints deployed on NetSuite.

■ Dashed lines indicate asynchronous or scheduled connections. Solid lines indicate real-time bidirectional sync.
03 Integration Details 7 Core Integrations — Endpoints, Auth, Payloads, Error Handling
Cloudflare Workers
Active
Cloudflare Workers serve as the primary middleware layer between NetSuite and external consumers. Workers handle webhook ingestion, scheduled data pulls, HTML quote generation, and the Frosty chat API proxy.
Endpoints
gfs-api.workers.dev/*
Auth Method
TBA OAuth 1.0 (4-key)
Payload Format
JSON (application/json)
Frequency
Real-time + Cron triggers
Error Handling
3 retries, exponential backoff, DLQ to D1
Rate Limit
10 req/sec per RESTlet
Sample Webhook Payload (Order Created)
{ "event": "order.created", "timestamp": "2026-05-19T14:30:00Z", "data": { "orderId": "SO-26-05-0834", "customer": "FreshMart Distribution", "total": 11850.40, "items": 6 } }
EDI Gateway
Active
Electronic Data Interchange for automated order processing with large-scale distribution partners. Supports standard ANSI X12 document types through a VAN (Value Added Network) provider.
Document Types
850 (PO), 810 (Invoice), 856 (ASN)
VAN Provider
SPS Commerce
Format
ANSI X12 4010
Trading Partners
12 active partners
Processing
Polled every 15 min
Error Handling
997 Functional Ack, email alert on reject
DocumentDirectionDescriptionAuto-Create
850 Purchase OrderInboundCustomer PO creates Sales Order in NetSuiteYes — Sales Order
810 InvoiceOutboundNetSuite Invoice sent to customer on fulfillmentAuto-generated
856 ASNOutboundAdvance Ship Notice with tracking and lot detailsAuto-generated
Banking APIs
Active
Automated payment processing including ACH file generation for vendor payments, positive pay file uploads for check fraud prevention, and daily bank reconciliation imports.
ACH Format
NACHA (CCD/PPD)
Positive Pay
CSV upload, daily at 4:00 PM ET
Bank Recon
BAI2 / OFX import, daily at 6:00 AM ET
Auth
SFTP with RSA key pair
Encryption
AES-256 in transit and at rest
Error Handling
Reject file parsing, controller email alert
Shipping APIs
Active
Direct carrier API integration for shipping label generation, rate shopping, and real-time tracking webhook reception. Supports FedEx and UPS for non-fleet deliveries.
Carriers
FedEx REST v1, UPS OAuth 2.0
Label Format
4x6 ZPL (thermal) / PDF
Rate Shopping
Multi-carrier comparison on fulfillment
Tracking
Inbound webhooks on status change
Error Handling
Fallback to manual label if API timeout
SLA
Label gen < 3 sec, tracking < 5 min delay
CME Data Feed
Active
Chicago Mercantile Exchange commodity price feed for market-linked pricing on barrel cheddar, block cheddar, butter, and dry whey. Prices update the Price Bracket custom records and drive automated cost calculations.
Data Format
JSON via scheduled REST pull
Update Frequency
Daily at 3:30 PM CT (market close)
Commodities
Barrel, Block, Butter, Dry Whey
Price Mapping
CME settle → Price Bracket + moisture premium
Trailing Week
5-day average calc for vendor pricing
Error Handling
Use previous day price if feed fails, alert ops
CME Price Record (Mapped to NetSuite)
{ "date": "2026-05-19", "barrel_settle": 1.8925, "block_settle": 1.9450, "butter_settle": 2.4100, "whey_settle": 0.4675, "trailing_week_barrel": 1.8840, "source": "CME Group" }
Zoho CRM + Mail
Active
Bidirectional customer and contact sync between Zoho CRM and NetSuite. Zoho Mail handles transactional email delivery for order confirmations, shipping notifications, and compliance alerts.
Contact Sync Fields
Name, Email, Phone, Company, Address, Sales Rep
Sync Frequency
Every 30 min (bidirectional)
Conflict Resolution
Last-modified wins, manual flag on field conflict
Email Templates
12 transactional templates in Zoho Mail
Trigger Events
New customer, address change, credit hold
Error Handling
Sync log in D1, retry on 429/5xx, skip on 4xx
USDA Portal
Active
Integration with USDA WBSCM (Web-Based Supply Chain Management) for commodity program compliance reporting, allocation management, and certification uploads.
Reporting Format
XML + CSV per WBSCM schema
Submission Schedule
Monthly (5th business day)
Cert Uploads
SQF, HACCP, facility licenses via SFTP
Allocation Sync
Quarterly allocation import to USDA Allocation records
Drawdown Reports
Weekly shipment summary export
Error Handling
Validation pre-check, email on submission failure
■ All active integrations are monitored via the Integration Health Dashboard (Section 07). Planned integrations are in the development backlog.
04 RESTlet Endpoints 6 GFS RESTlets — Complete API Documentation with Request/Response Examples

All RESTlets are deployed as SuiteScript 2.1 scripts with Token-Based Authentication (TBA). Base URL: https://{accountId}.restlets.api.netsuite.com/app/site/hosting/restlet.nl

MethodEndpointScript IDDescription
GET/item/{id}customscript_gfs_item_apiItem lookup with pricing and inventory
GET/inventory/{item}/{location}customscript_gfs_inv_apiReal-time stock check by item and location
POST/ordercustomscript_gfs_order_apiCreate a new Sales Order
POST/receiptcustomscript_gfs_receipt_apiRecord an Item Receipt against a PO
GET/customer/{id}/balancecustomscript_gfs_arbal_apiCustomer AR balance and aging
POST/frosty/chatcustomscript_gfs_frosty_apiFrosty AI natural language query
GET /item/{id}

Returns item details including description, UOM, base price, active price brackets, and on-hand inventory across all locations.

Request
GET /item/4821 Authorization: OAuth 1.0 (TBA) Content-Type: application/json
Response (200 OK)
{ "id": 4821, "sku": "BC-040-001", "name": "Barrel Cheddar 40lb", "uom": "EA", "basePrice": 23.67, "category": "Cheese - Natural", "vendor": "Bongards", "onHand": { "edgewood": 480, "hermitage": 320, "total": 800 }, "activeBrackets": [ { "bracket": 1, "minLbs": 0, "maxLbs": 20000, "rate": 2.1847 }, { "bracket": 2, "minLbs": 20001, "maxLbs": 40000, "rate": 2.1420 } ] }
GET /inventory/{item}/{location}

Returns real-time inventory for a specific item at a specific location. Includes on-hand, committed, available, and on-order quantities.

Request
GET /inventory/4821/edgewood Authorization: OAuth 1.0 (TBA)
Response (200 OK)
{ "item": "BC-040-001", "location": "Edgewood, NY", "onHand": 480, "committed": 120, "available": 360, "onOrder": 200, "reorderPoint": 100, "lastReceived": "2026-05-14", "uom": "EA" }
POST /order

Creates a new Sales Order in NetSuite. Validates customer credit, checks inventory availability, and applies active price brackets automatically.

Request Body
{ "customerId": 1042, "shipDate": "2026-05-22", "poNumber": "FM-PO-8821", "location": "edgewood", "items": [ { "sku": "BC-040-001", "qty": 120 }, { "sku": "MZ-LMP-001", "qty": 80 } ], "memo": "Weekly standing order" }
Response (201 Created)
{ "success": true, "orderId": "SO-26-05-0835", "internalId": 48210, "total": 4400.40, "status": "Pending Approval" }
POST /receipt

Records an Item Receipt against an existing Purchase Order. Creates lot records, captures dock temperature, and updates inventory quantities.

Request Body
{ "poId": 32104, "location": "edgewood", "items": [ { "line": 1, "qtyReceived": 120, "lotNumber": "GFS-260519-A", "vendorLot": "BNG-4835", "expiryDate": "2026-11-19" } ], "dockTemp": 38.4, "receivedBy": "jmartinez" }
Response (201 Created)
{ "success": true, "receiptId": "IR-26-05-1204", "internalId": 51482, "tempLogId": 8421, "lotTraceId": 6104 }
GET /customer/{id}/balance

Returns the customer's current AR balance with aging breakdown by bucket (current, 1-30, 31-60, 61-90, 90+).

Request
GET /customer/1042/balance Authorization: OAuth 1.0 (TBA)
Response (200 OK)
{ "customerId": 1042, "name": "FreshMart Distribution", "totalBalance": 18420.50, "creditLimit": 50000.00, "availableCredit": 31579.50, "aging": { "current": 12200.00, "days1to30": 4820.50, "days31to60": 1400.00, "days61to90": 0.00, "days90plus": 0.00 }, "terms": "Net 30", "onHold": false }
POST /frosty/chat

Frosty AI endpoint accepts natural language queries about inventory, orders, pricing, and customer data. Routes through Claude AI for query interpretation and returns structured data from NetSuite.

Request Body
{ "query": "What's the current barrel cheddar price and how much do we have in stock?", "userId": "mlevine", "context": "sales" }
Response (200 OK)
{ "response": "Barrel Cheddar 40lb (BC-040-001) is currently priced at $2.1847/lb based on the CME trailing week average from 05/12. We have 800 units across both facilities: 480 in Edgewood and 320 in Hermitage. 120 are committed to pending orders, leaving 680 available.", "data": { "item": "BC-040-001", "price": 2.1847, "available": 680, "source": "CME Wk 05/12 Barrel" }, "confidence": 0.97 }
■ All RESTlets require TBA authentication. Rate limit: 10 requests/second per script deployment. Responses include standard HTTP status codes.
05 Webhook Events 6 Outbound Event Triggers — Real-Time Notifications

NetSuite User Event scripts fire outbound webhook notifications to Cloudflare Workers on key business events. Each webhook includes a retry policy and dead letter queue for failed deliveries.

order.created
Fires when a new Sales Order is saved with status Pending Fulfillment or Pending Approval. Payload includes order header, line items, and customer details.
gfs-api.workers.dev/hooks/order
order.shipped
Fires when an Item Fulfillment is marked as Shipped. Includes tracking number, carrier, ship date, and all lot numbers in the shipment.
gfs-api.workers.dev/hooks/ship
payment.received
Fires when a Customer Payment is applied against open invoices. Includes payment amount, method, applied invoices, and remaining balance.
gfs-api.workers.dev/hooks/payment
temp.excursion
Fires immediately when a Temperature Log is saved with Compliance Status = Fail. Includes facility, zone, reading, threshold, and sensor ID for rapid corrective action.
gfs-api.workers.dev/hooks/alert
inventory.low
Fires when available quantity drops below the reorder point for any item at any location. Triggers auto-PO workflow for preferred vendors.
gfs-api.workers.dev/hooks/inventory
compliance.expiry
Fires daily at 7:00 AM ET for any Compliance Document entering the 30-day, 60-day, or 90-day expiry window. Notifies compliance team and blocks related transactions if expired.
gfs-api.workers.dev/hooks/compliance
Retry Policy: 3 attempts with exponential backoff (1s, 5s, 30s). On final failure, payload is written to Cloudflare D1 dead letter table for manual review. Alert sent to ops channel via Slack webhook.
■ Webhook payloads are signed with HMAC-SHA256 using a shared secret. Consumers must verify the X-GFS-Signature header before processing.
06 Data Sync Schedule 24-Hour Automated Sync Timeline — All Integrations

Visual timeline showing when each automated data sync runs across a 24-hour cycle. All times are Eastern Time (ET). Real-time integrations (webhooks, API calls) are not shown as they fire on-demand.

SCHEDULED SYNC TIMELINE (ET)
Bank Recon Import
0
2
4
6
8
10
12
14
16
18
20
22
6AM
Compliance Check
0
2
4
6
8
10
12
14
16
18
20
22
7AM
Zoho CRM Sync
0
2
4
6
8
10
12
14
16
18
20
22
Every 30 min (7AM–6PM)
EDI Poll (SPS)
0
2
4
6
8
10
12
14
16
18
20
22
Every 15 min (24/7)
CME Price Feed
0
2
4
6
8
10
12
14
16
18
20
22
3:30P CT
Positive Pay Upload
0
2
4
6
8
10
12
14
16
18
20
22
4PM
Inventory Snapshot
0
2
4
6
8
10
12
14
16
18
20
22
11PM
Dropbox File Backup
0
2
4
6
8
10
12
14
16
18
20
22
2AM
Financial
CRM
EDI
Market Data
Operations
Storage
Sync JobFrequencyTime (ET)DurationDirection
Bank ReconciliationDaily6:00 AM~3 minInbound (BAI2)
Compliance Expiry CheckDaily7:00 AM~1 minInternal scan
Zoho CRM Contact SyncEvery 30 min7AM–6PM~45 secBidirectional
EDI Document PollEvery 15 min24/7~30 secBidirectional
CME Price FeedDaily (M–F)3:30 PM CT~2 minInbound
Positive Pay UploadDaily4:00 PM~1 minOutbound (CSV)
Inventory SnapshotDaily11:00 PM~5 minInternal capture
Dropbox File BackupDaily2:00 AM~8 minOutbound
■ All scheduled syncs run as SuiteScript 2.1 Scheduled Scripts or Map/Reduce scripts. Timing adjustments require system administrator approval.
07 Error Handling & Monitoring Error Codes, Retry Logic, Dead Letter Queue, Health Dashboard
INTEGRATION HEALTH DASHBOARD
Cloudflare Workers
Healthy
99.97% (30d)
EDI Gateway
Healthy
99.92% (30d)
Banking APIs
Healthy
100.0% (30d)
Shipping APIs
Degraded
98.41% (30d)
CME Data Feed
Healthy
99.80% (30d)
Zoho CRM
Healthy
99.95% (30d)
USDA Portal
Healthy
99.60% (30d)
Frosty AI
Healthy
99.88% (30d)
ERROR CODES
CodeNameDescriptionAuto-RetryResolution
GFS-E001Auth FailureTBA token expired or invalidNoRegenerate token pair in NetSuite
GFS-E002Rate LimitedExceeded 10 req/sec RESTlet limitYes (30s delay)Automatic backoff and retry
GFS-E003Record LockedTarget record being edited by another userYes (5s delay)Retry up to 3 times, then DLQ
GFS-E004Validation FailedRequired fields missing or invalid data typesNoFix payload, resubmit manually
GFS-E005TimeoutRESTlet execution exceeded 300sYes (60s delay)Retry once, split batch if needed
GFS-E006Credit HoldCustomer on credit hold, order blockedNoReview AR balance, release hold
GFS-E007Inventory ShortRequested quantity exceeds available stockNoAdjust order quantity or backorder
GFS-E008EDI RejectTrading partner rejected document (997)NoReview 997 details, fix and resubmit
GFS-E009Feed UnavailableExternal data source not respondingYes (5m delay)Use last known good value, alert ops
GFS-E010DLQ OverflowDead letter queue exceeds 100 entriesN/AImmediate page to on-call engineer
RETRY LOGIC
ATTEMPT 1
Immediate retry after 1 second delay. Most transient errors (rate limits, record locks) resolve on first retry.
Delay: 1s
ATTEMPT 2
Exponential backoff with 5 second delay. If the integration target is briefly overloaded, this window allows recovery.
Delay: 5s
ATTEMPT 3 (FINAL)
Last attempt with 30 second delay. On failure, payload is written to the Dead Letter Queue in Cloudflare D1 for manual processing.
Delay: 30s → DLQ on failure
DEAD LETTER QUEUE (DLQ)

Failed integration payloads are stored in a Cloudflare D1 SQLite table for manual review and reprocessing. Each DLQ entry includes the original payload, error details, timestamp, and integration source.

DLQ Table Schema
CREATE TABLE dlq ( id INTEGER PRIMARY KEY AUTOINCREMENT, integration TEXT NOT NULL, -- e.g., "order.created" payload TEXT NOT NULL, -- Original JSON payload error_code TEXT NOT NULL, -- GFS-E001 through GFS-E010 error_msg TEXT, -- Human-readable error attempts INTEGER DEFAULT 3, -- Total retry attempts made created_at DATETIME DEFAULT CURRENT_TIMESTAMP, resolved_at DATETIME, -- NULL until manually resolved resolved_by TEXT -- Username who resolved );
ALERTING RULES
WARNING
Any integration uptime drops below 99.5% over a 24-hour window. DLQ has > 10 unresolved entries. Sync job takes > 2x normal duration.
Channel: #gfs-ops (Slack)
CRITICAL
Any integration completely unreachable for > 5 minutes. DLQ exceeds 100 entries. Banking or EDI integration failure during business hours.
Channel: #gfs-critical (Slack) + SMS to on-call
■ Integration health metrics are aggregated hourly and displayed on the NetSuite executive dashboard. Monthly SLA reports are generated automatically on the 1st of each month.
← Back to Hub · GFS Design System v10.0 · Global Food Solutions, Inc. · Edgewood, NY