Shipping Notification System

Syncing shipment information and automatic customer notifications in multi-location environments

Shipping NotificationTracking NumberCarrierMulti-LocationFulfillment Management
5 min read

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.

Standard Integration (Single Location)
NextEngine

Shipment confirmed

Standard Integration
Shopify

Stops working with multi-location

Customer

Notification

This System (Multi-Location Compatible)
NextEngine

Shipment confirmed

Periodic fetch
This App

Works with multi-location

API
Shopify → Customer

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

Shipment Info Sync Flow
Business Hours Check

Execute only weekdays 8:00-21:00

Acquire Lock

Prevent concurrent execution, 25min TTL

Fetch Shipment Data

Get data since last sync time

Store Filtering

Multi-store support

Process Each Order

Check tracking number · Duplicate check · Carrier detection

Shopify API Registration

Register fulfillment → Auto-notify customer

Update Sync Timestamp

Record statistics

Automatic Carrier Detection

The system automatically identifies carriers from keywords and generates tracking URLs.

Domestic Carriers (Japan)

ヤマト, yamato, 宅急便, クロネコ
CarrierYamato Transport
Tracking Sitekuronekoyamato.co.jp
佐川, sagawa
CarrierSagawa Express
Tracking Sitesagawa-exp.co.jp
日本郵便, ゆうパック, japan post
CarrierJapan Post
Tracking Sitepost.japanpost.jp
西濃, seino
CarrierSeino Transportation
Tracking Sitetrack.seino.co.jp
福山, fukuyama
CarrierFukuyama Transporting
Tracking Sitecorp.fukutsu.co.jp

International Carriers

dhl
CarrierDHL
Tracking Sitedhl.com
fedex
CarrierFedEx
Tracking Sitefedex.com
ups
CarrierUPS
Tracking Siteups.com

Processing Result Status

Each order's processing result is classified as one of the following:

OK
MeaningCompleted successfully
Trigger ConditionFulfillment registration and notification succeeded
SKIP
MeaningSkipped
Trigger ConditionAlready processed, or fulfillment already registered
PENDING
MeaningOn hold
Trigger ConditionTracking number not entered (will retry later)
ERROR
MeaningError
Trigger ConditionOrder 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.

Watermark Method
First Execution

Fetch all data

Record Latest Datetime

Save as watermark

Subsequent Executions

Fetch only data after recorded datetime

Update Latest 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:

Business Hours Detection
Convert to Japan Timezone

Timezone conversion

Check Day/Time

Determine execution eligibility

Saturday/Sunday
Don't execute
Before 8:00
Don't execute
After 21:00
Don't execute
Weekday 8:00-21:00
Execute

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

Multi-location
Standard Integration× Doesn't work
This System○ Works
Sync timing
Standard IntegrationReal-time
This SystemPeriodic (~30 min)
Carrier support
Standard IntegrationLimited
This SystemCustomizable
Logs
Standard IntegrationHard to check
This SystemDetailed 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.

Related Topics