Delivery Operations
Dispatch, analytics, export, notifications, and webhook management for delivery operations.
Dispatch
Auto-assign drivers and get suggestions for optimal driver matches.
deliveryDispatchSuggest
const suggestions = await ss.delivery.dispatch.suggest({
order_id: 'ord_01',
limit: 5,
})
- Open Delivery and go to Orders
- Click on an unassigned order, then click Suggest Drivers
- Review the ranked driver suggestions
deliveryDispatchAutoAssign
const result = await ss.delivery.dispatch.autoAssign({
order_ids: ['ord_01', 'ord_02', 'ord_03'],
})
- Open Delivery and go to Orders
- Select multiple unassigned orders, then click Auto-Assign
Dispatch Rules
Configure priority-ordered auto-dispatch rules with zone, time window, and radius conditions.
deliveryDispatchRuleCreate
const rule = await ss.delivery.dispatchRules.create({
name: 'Night Shift',
priority: 1,
conditions: { time_window: { start: '22:00', end: '06:00' } },
action: { strategy: 'round_robin', fallback: 'queue' },
})
- Open Delivery and go to Dispatch Rules
- Click Add Rule
- Configure the rule name, priority, conditions (zones, time windows, radius), and dispatch strategy, then click Save
deliveryDispatchRuleList
const { rules } = await ss.delivery.dispatchRules.list()
- Open Delivery and go to Dispatch Rules
- Browse the list of dispatch rules ordered by priority
deliveryDispatchRuleGet
const rule = await ss.delivery.dispatchRules.get('ddr_01')
- Open Delivery and go to Dispatch Rules
- Click on a rule to view its details
deliveryDispatchRuleUpdate
const updated = await ss.delivery.dispatchRules.update('ddr_01', {
enabled: false,
})
- Open Delivery and go to Dispatch Rules
- Click on a rule, edit the fields, then click Save
deliveryDispatchRuleDelete
await ss.delivery.dispatchRules.delete('ddr_01')
- Open Delivery and go to Dispatch Rules
- Click the delete icon next to a rule, then confirm
deliveryDispatchRuleEvaluate
const result = await ss.delivery.dispatchRules.evaluate({
lat: 40.7128,
lng: -74.0060,
})
- Open Delivery and go to Dispatch Rules
- Use the Evaluate tool to test which rule matches for a given location and time
deliveryAutoDispatch
const result = await ss.delivery.dispatchRules.autoDispatch({
order_id: 'ord_01',
})
- Open Delivery and go to Orders
- Click on an unassigned order, then click Auto-Dispatch to trigger rules-based driver assignment
Tracking Links
Generate short-lived public tracking tokens for customer and driver tracking pages.
deliveryTrackingLinkCreate
const link = await ss.delivery.trackingLinks.create({
order_id: 'ord_01',
ttl_minutes: 1440,
})
- Open Delivery and go to Orders
- Click on an order, then click Create Tracking Link
- Copy the customer or driver URL to share
deliveryTrackingLinkResolve
const info = await ss.delivery.trackingLinks.resolve('trk_c_abc123')
- Tracking links are resolved automatically when a customer or driver opens the tracking URL
- No dashboard action needed — this is a public endpoint
deliveryTrackingLinkRevoke
await ss.delivery.trackingLinks.revoke('dtl_01')
- Open Delivery and go to Orders
- Click on an order, find the active tracking link, then click Revoke
Tracking Pages
Public customer and driver tracking routes, plus SSE updates and proof submission flows.
Render Customer Tracking Page
const html = await ss.delivery.trackingPages.customerPage('trk_c_abc123')
- Open Delivery, generate a tracking link for an order, then copy the customer URL
- Paste the URL into a new tab to verify the public customer experience end-to-end
- Or use API Console to fetch the raw HTML route directly from the browser
token requiredLoad Customer Tracking Feed
const feed = await ss.delivery.trackingPages.customerFeed('trk_c_abc123')
- Use API Console to call this public JSON feed with a customer tracking token
- Inspect the order snapshot, proof records, and rating data that power the public tracking page
token requiredSubmit Customer Rating
await ss.delivery.trackingPages.rate('trk_c_abc123', { score: 5, comment: 'Right on time' })
- Generate a tracking link for a delivered order in Delivery
- Open the customer tracking page and submit a rating through the public UI, or send the JSON payload from API Console
token requiredscore requiredcommentRender Driver Tracking Page
const html = await ss.delivery.trackingPages.driverPage('trk_d_abc123')
- Open Delivery, generate a tracking link, then copy the driver URL
- Open the driver URL in a new tab to validate the public courier workflow, including ping and proof actions
token requiredSend Driver Tracking Ping
await ss.delivery.trackingPages.ping('trk_d_abc123', { lat: 51.5072, lng: -0.1276 })
- Open the public driver tracking page in a browser to send live location updates
- Or use API Console with the driver token to test the public JSON endpoint directly
token requiredlat requiredlng requiredUpload Driver Photo Proof
await ss.delivery.trackingPages.uploadPhotoProof('trk_d_abc123', file, { fileName: 'dropoff.jpg', comment: 'Left at reception' })
- Open the public driver tracking page and upload a proof photo from the courier UI
- Or use API Console in form mode to send multipart proof uploads from Chrome
token requiredfile requiredcommentlatlngSubmit Driver Comment Proof
await ss.delivery.trackingPages.commentProof('trk_d_abc123', { text: 'Customer requested handoff at side gate' })
- Open the public driver tracking page to add text proof from the courier flow
- Or send the JSON request from API Console with the driver tracking token
token requiredtext requiredlatlngSubscribe to Public Tracking Updates
const es = new EventSource(ss.delivery.trackingPages.subscribeUrl('trk_c_abc123'))
- Open the customer or driver tracking page to watch live SSE updates automatically
- Or inspect the event stream directly from API Console by calling the subscribe endpoint with a tracking token
token requiredlast_event_idSettings
Configure delivery module behavior per project.
deliverySettingsGet
const settings = await ss.delivery.settings.get()
- Open Delivery and go to Settings
- View the current delivery configuration
deliverySettingsUpdate
const updated = await ss.delivery.settings.update({
auto_dispatch: true,
default_timezone: 'America/New_York',
})
- Open Delivery and go to Settings
- Edit the configuration fields, then click Save
Notifications
Configure which delivery events trigger notifications.
deliveryNotificationList
const templates = await ss.delivery.notifications.list()
- Open Delivery and go to Notifications
- Browse the list of notification templates
deliveryNotificationUpsert
await ss.delivery.notifications.upsert({
event: 'order.delivered',
channel: 'sms',
template: 'Your order {{order_id}} has been delivered!',
enabled: true,
})
- Open Delivery and go to Notifications
- Click on a template to edit it, or click Add Template
- Configure the event trigger, channel, and message template, then click Save
Webhooks
Manage webhooks for delivery-specific event topics.
deliveryWebhookList
const webhooks = await ss.delivery.webhooks.list()
- Open Delivery and go to Webhooks
- Browse the list of registered webhooks
deliveryWebhookCreate
const webhook = await ss.delivery.webhooks.create({
url: 'https://example.com/hooks/delivery',
events: ['order.created', 'order.delivered'],
})
- Open Delivery and go to Webhooks
- Click Add Webhook
- Enter the endpoint URL, select the events to subscribe to, then click Save
ETA Fences
Create and manage ETA fences for delivery destinations. Receive breach webhooks when a tracked entity's driving ETA drops below the configured threshold.
Create Delivery ETA Fence
await ss.delivery.etaFences.create({
name: 'Depot Arrival',
dest_lat: 40.7128, dest_lng: -74.0060,
threshold_min: 30,
avg_speed_kmh: 50,
})
- Open Delivery and go to the ETA Fences tab
- Click Create ETA Fence and fill in the destination, threshold, and speed
- Click Create to save the fence
name requireddest_lat requireddest_lng requiredthreshold_min requiredlogistics.eta_fence.breach webhook fires when driving ETA drops below this value.entity_typesavg_speed_kmh40.heuristic_multiplier1.5.metadataList Delivery ETA Fences
const result = await ss.delivery.etaFences.list()
- Open Delivery and go to the ETA Fences tab
- All ETA fences are displayed with their destination coordinates and threshold
enabledtrue or falselimit25.cursorGet Delivery ETA Fence
const fence = await ss.delivery.etaFences.get('etaf_abc')
- Open Delivery and go to the ETA Fences tab
- Click on a fence to view its destination, threshold, and metadata
fence_id requiredDelete Delivery ETA Fence
await ss.delivery.etaFences.delete('etaf_abc')
- Open Delivery and go to the ETA Fences tab
- Click the delete icon on the fence you want to remove
fence_id requiredAnalytics
Delivery performance analytics and driver statistics.
deliveryAnalyticsSummary
const summary = await ss.delivery.analytics.summary()
- Open Delivery and go to Analytics
- View the summary dashboard with order counts, delivery times, and trends
deliveryAnalyticsDrivers
const driverStats = await ss.delivery.analytics.drivers()
- Open Delivery and go to Analytics
- Switch to the Drivers tab to view per-driver performance metrics
Export
Export delivery data in JSON or CSV format.
deliveryExportOrders
const csv = await ss.delivery.export.orders()
- Open Delivery and go to Orders
- Click the Export button to download orders as CSV