Background
With Shopify and NextEngine's standard integration, when shipping is processed in NextEngine, shipment information is automatically registered in Shopify, and customers receive shipping notification emails. However, when multiple locations (warehouses) are set up in Shopify, this standard integration also stops working.
This article explains the system built to maintain shipping notifications in multi-location environments.
Why Custom Implementation is Needed
Without the standard integration, processing shipments in NextEngine doesn't reflect in Shopify. This means:
- Customers don't receive shipping notification emails
- Shipping status doesn't update in Shopify admin
- Tracking numbers don't reach customers
To solve these issues, we built a custom system that retrieves shipment data from NextEngine and registers it in Shopify.
Shipment confirmed
Stops working with multi-location
Notification
Shipment confirmed
Works with multi-location
Notification
How Shipment Information Sync Works
Periodic Data Retrieval
This system periodically retrieves confirmed shipment data from NextEngine and registers fulfillment information in Shopify. While not real-time like the standard integration, synchronization occurs at approximately 30-minute intervals.
Operators simply process shipments in NextEngine as usual, and customer notifications are sent automatically.
Automatic Carrier and Tracking Number Linking
When registering fulfillment information in Shopify, carrier and tracking number must be set correctly. The system automatically identifies carriers from names entered in NextEngine and generates tracking URLs.
Business Hours Only Execution
Since running the system during late night or early morning hours serves no purpose, we made it possible to configure operating hours to match business schedules.
Overall Data Flow
Execute only weekdays 8:00-21:00
Prevent concurrent execution, 25min TTL
Get data since last sync time
Multi-store support
Check tracking number · Duplicate check · Carrier detection
Register fulfillment → Auto-notify customer
Record statistics
Automatic Carrier Detection
The system automatically identifies carriers from keywords and generates tracking URLs.
Domestic Carriers (Japan)
| Detection Keywords | Carrier | Tracking Site |
|---|---|---|
| ヤマト, yamato, 宅急便, クロネコ | Yamato Transport | kuronekoyamato.co.jp |
| 佐川, sagawa | Sagawa Express | sagawa-exp.co.jp |
| 日本郵便, ゆうパック, japan post | Japan Post | post.japanpost.jp |
| 西濃, seino | Seino Transportation | track.seino.co.jp |
| 福山, fukuyama | Fukuyama Transporting | corp.fukutsu.co.jp |
International Carriers
| Detection Keywords | Carrier | Tracking Site |
|---|---|---|
| dhl | DHL | dhl.com |
| fedex | FedEx | fedex.com |
| ups | UPS | ups.com |
Processing Result Status
Each order's processing result is classified as one of the following:
| Status | Meaning | Trigger Condition |
|---|---|---|
| OK | Completed successfully | Fulfillment registration and notification succeeded |
| SKIP | Skipped | Already processed, or fulfillment already registered |
| PENDING | On hold | Tracking number not entered (will retry later) |
| ERROR | Error | Order not found in Shopify, API call failed, etc. |
Efficiency Through Watermark Method
Rather than fetching all shipment data every time, we record the "latest shipment datetime from last fetch" and only retrieve data after that point.
Fetch all data
Save as watermark
Fetch only data after recorded datetime
Minimize API calls · Reduce processing time
Business Hours Detection Logic
Running the system outside business hours serves no purpose. Execution is controlled with the following logic:
Timezone conversion
Determine execution eligibility
This setting can be customized per store. For stores operating on weekends, you can configure weekend execution.
Duplicate Processing Prevention
To prevent notifications from being sent twice for the same shipment, we record processed shipments.
The hash value used for determination combines three pieces of information:
- Order ID
- Shipment datetime
- Tracking number
Processing matching this combination is considered complete and skipped. Records are kept for 90 days and automatically deleted afterward.
Comparison with Standard Integration
| Item | Standard Integration | This System |
|---|---|---|
| Multi-location | × Doesn't work | ○ Works |
| Sync timing | Real-time | Periodic (~30 min) |
| Carrier support | Limited | Customizable |
| Logs | Hard to check | Detailed records |
Notes
When Tracking Number is Not Entered
If shipment is confirmed in NextEngine without entering a tracking number, that order becomes "PENDING" status. Once a tracking number is entered, it will be automatically processed in the next sync.
When Carrier Cannot Be Identified
If the carrier name isn't registered, notification is sent without a tracking URL. To add new carriers, add keyword-to-URL mappings in the configuration.
About Sync Timing
Unlike standard integration, this uses periodic sync rather than real-time. There may be up to 30 minutes of delay from shipment processing to customer notification, but this is acceptable for operations.
Summary
While standard shipping notification features don't work in multi-location environments, combining NextEngine API and Shopify API enables equivalent automatic notifications.
Custom implementation allows flexible operations that were difficult with standard integration, such as adding carriers and checking logs.