Search docs ⌘K
esc
Type to search across all documentation pages
Delivery

Delivery Operations

Dispatch, analytics, export, notifications, and webhook management for delivery operations.

Dispatch

Auto-assign drivers and get suggestions for optimal driver matches.

deliveryDispatchSuggest

GET
typescript
const suggestions = await ss.delivery.dispatch.suggest({
  order_id: 'ord_01',
  limit: 5,
})
  1. Open Delivery and go to Orders
  2. Click on an unassigned order, then click Suggest Drivers
  3. Review the ranked driver suggestions

deliveryDispatchAutoAssign

GET
typescript
const result = await ss.delivery.dispatch.autoAssign({
  order_ids: ['ord_01', 'ord_02', 'ord_03'],
})
  1. Open Delivery and go to Orders
  2. Select multiple unassigned orders, then click Auto-Assign

Dispatch Rules

Configure priority-ordered auto-dispatch rules with zone, time window, and radius conditions.

deliveryDispatchRuleCreate

GET
typescript
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' },
})
  1. Open Delivery and go to Dispatch Rules
  2. Click Add Rule
  3. Configure the rule name, priority, conditions (zones, time windows, radius), and dispatch strategy, then click Save

deliveryDispatchRuleList

GET
typescript
const { rules } = await ss.delivery.dispatchRules.list()
  1. Open Delivery and go to Dispatch Rules
  2. Browse the list of dispatch rules ordered by priority

deliveryDispatchRuleGet

GET
typescript
const rule = await ss.delivery.dispatchRules.get('ddr_01')
  1. Open Delivery and go to Dispatch Rules
  2. Click on a rule to view its details

deliveryDispatchRuleUpdate

GET
typescript
const updated = await ss.delivery.dispatchRules.update('ddr_01', {
  enabled: false,
})
  1. Open Delivery and go to Dispatch Rules
  2. Click on a rule, edit the fields, then click Save

deliveryDispatchRuleDelete

GET
typescript
await ss.delivery.dispatchRules.delete('ddr_01')
  1. Open Delivery and go to Dispatch Rules
  2. Click the delete icon next to a rule, then confirm

deliveryDispatchRuleEvaluate

GET
typescript
const result = await ss.delivery.dispatchRules.evaluate({
  lat: 40.7128,
  lng: -74.0060,
})
  1. Open Delivery and go to Dispatch Rules
  2. Use the Evaluate tool to test which rule matches for a given location and time

deliveryAutoDispatch

GET
typescript
const result = await ss.delivery.dispatchRules.autoDispatch({
  order_id: 'ord_01',
})
  1. Open Delivery and go to Orders
  2. Click on an unassigned order, then click Auto-Dispatch to trigger rules-based driver assignment

Tracking Pages

Public customer and driver tracking routes, plus SSE updates and proof submission flows.

Render Customer Tracking Page

GET
/modules/delivery/tracking-pages/customer/:token
typescript
const html = await ss.delivery.trackingPages.customerPage('trk_c_abc123')
  1. Open Delivery, generate a tracking link for an order, then copy the customer URL
  2. Paste the URL into a new tab to verify the public customer experience end-to-end
  3. Or use API Console to fetch the raw HTML route directly from the browser
Path param
Type
Description
token required
string
Customer tracking token from a generated tracking link
Error responses
404 Tracking link is invalid, expired, or the order no longer exists

Load Customer Tracking Feed

GET
/modules/delivery/tracking-pages/customer/:token/feed
typescript
const feed = await ss.delivery.trackingPages.customerFeed('trk_c_abc123')
  1. Use API Console to call this public JSON feed with a customer tracking token
  2. Inspect the order snapshot, proof records, and rating data that power the public tracking page
Path param
Type
Description
token required
string
Customer tracking token
Error responses
401 Tracking token is invalid or expired
404 Order no longer exists

Submit Customer Rating

POST
/modules/delivery/tracking-pages/customer/:token/rating
typescript
await ss.delivery.trackingPages.rate('trk_c_abc123', { score: 5, comment: 'Right on time' })
  1. Generate a tracking link for a delivered order in Delivery
  2. Open the customer tracking page and submit a rating through the public UI, or send the JSON payload from API Console
Path param
Type
Description
token required
string
Customer tracking token
Body field
Type
Description
score required
integer
Star rating from 1 to 5
comment
string
Optional rating comment (max 1000 chars)
Error responses
400 Order is not yet delivered or the rating payload is invalid
401 Unauthorized
404 Not Found

Render Driver Tracking Page

GET
/modules/delivery/tracking-pages/driver/:token
typescript
const html = await ss.delivery.trackingPages.driverPage('trk_d_abc123')
  1. Open Delivery, generate a tracking link, then copy the driver URL
  2. Open the driver URL in a new tab to validate the public courier workflow, including ping and proof actions
Path param
Type
Description
token required
string
Driver tracking token from a generated tracking link
Error responses
404 Tracking link is invalid, expired, or the order no longer exists

Send Driver Tracking Ping

POST
/modules/delivery/tracking-pages/driver/:token/ping
typescript
await ss.delivery.trackingPages.ping('trk_d_abc123', { lat: 51.5072, lng: -0.1276 })
  1. Open the public driver tracking page in a browser to send live location updates
  2. Or use API Console with the driver token to test the public JSON endpoint directly
Path param
Type
Description
token required
string
Driver tracking token
Body field
Type
Description
lat required
number
Latitude
lng required
number
Longitude
Error responses
400 Invalid JSON body or missing coordinates
401 Unauthorized

Upload Driver Photo Proof

POST
/modules/delivery/tracking-pages/driver/:token/proof/photo
typescript
await ss.delivery.trackingPages.uploadPhotoProof('trk_d_abc123', file, { fileName: 'dropoff.jpg', comment: 'Left at reception' })
  1. Open the public driver tracking page and upload a proof photo from the courier UI
  2. Or use API Console in form mode to send multipart proof uploads from Chrome
Path param
Type
Description
token required
string
Driver tracking token
Body field
Type
Description
file required
binary
Image file to upload as proof
comment
string
Optional comment saved alongside the proof
lat
number
Latitude where the proof was captured
lng
number
Longitude where the proof was captured
Error responses
400 Expected multipart form data with a valid image file
401 Unauthorized

Submit Driver Comment Proof

POST
/modules/delivery/tracking-pages/driver/:token/proof/comment
typescript
await ss.delivery.trackingPages.commentProof('trk_d_abc123', { text: 'Customer requested handoff at side gate' })
  1. Open the public driver tracking page to add text proof from the courier flow
  2. Or send the JSON request from API Console with the driver tracking token
Path param
Type
Description
token required
string
Driver tracking token
Body field
Type
Description
text required
string
Proof note text (1–2000 chars)
lat
number
Latitude where the note was recorded
lng
number
Longitude where the note was recorded
Error responses
400 Missing text or invalid JSON body
401 Unauthorized

Subscribe to Public Tracking Updates

GET
/modules/delivery/tracking-pages/subscribe/:token
typescript
const es = new EventSource(ss.delivery.trackingPages.subscribeUrl('trk_c_abc123'))
  1. Open the customer or driver tracking page to watch live SSE updates automatically
  2. Or inspect the event stream directly from API Console by calling the subscribe endpoint with a tracking token
Path param
Type
Description
token required
string
Customer or driver tracking token
Query param
Type
Description
last_event_id
string
Optional SSE cursor for resuming a previous stream
Error responses
400 Invalid last_event_id value
401 Unauthorized
404 Not Found

Settings

Configure delivery module behavior per project.

deliverySettingsGet

GET
typescript
const settings = await ss.delivery.settings.get()
  1. Open Delivery and go to Settings
  2. View the current delivery configuration

deliverySettingsUpdate

GET
typescript
const updated = await ss.delivery.settings.update({
  auto_dispatch: true,
  default_timezone: 'America/New_York',
})
  1. Open Delivery and go to Settings
  2. Edit the configuration fields, then click Save

Notifications

Configure which delivery events trigger notifications.

deliveryNotificationList

GET
typescript
const templates = await ss.delivery.notifications.list()
  1. Open Delivery and go to Notifications
  2. Browse the list of notification templates

deliveryNotificationUpsert

GET
typescript
await ss.delivery.notifications.upsert({
  event: 'order.delivered',
  channel: 'sms',
  template: 'Your order {{order_id}} has been delivered!',
  enabled: true,
})
  1. Open Delivery and go to Notifications
  2. Click on a template to edit it, or click Add Template
  3. Configure the event trigger, channel, and message template, then click Save

Webhooks

Manage webhooks for delivery-specific event topics.

deliveryWebhookList

GET
typescript
const webhooks = await ss.delivery.webhooks.list()
  1. Open Delivery and go to Webhooks
  2. Browse the list of registered webhooks

deliveryWebhookCreate

GET
typescript
const webhook = await ss.delivery.webhooks.create({
  url: 'https://example.com/hooks/delivery',
  events: ['order.created', 'order.delivered'],
})
  1. Open Delivery and go to Webhooks
  2. Click Add Webhook
  3. 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

GET
typescript
await ss.delivery.etaFences.create({
  name: 'Depot Arrival',
  dest_lat: 40.7128, dest_lng: -74.0060,
  threshold_min: 30,
  avg_speed_kmh: 50,
})
  1. Open Delivery and go to the ETA Fences tab
  2. Click Create ETA Fence and fill in the destination, threshold, and speed
  3. Click Create to save the fence
Body field
Type
Description
name required
string
ETA fence name (1–256 chars)
dest_lat required
number
Destination latitude (−90 to 90)
dest_lng required
number
Destination longitude (−180 to 180)
threshold_min required
number
ETA threshold in minutes (0.5–1440). A logistics.eta_fence.breach webhook fires when driving ETA drops below this value.
entity_types
string[]
Entity types to monitor (each 1–64 chars, max 20). Null matches all types.
avg_speed_kmh
number
Assumed average speed for heuristic ETA (1–300 km/h). Default 40.
heuristic_multiplier
number
Multiplier applied to threshold for heuristic pre-filter (1–5). Default 1.5.
metadata
object
Arbitrary key-value metadata (max 8 KB)
Error responses
400 Invalid body or max 50 ETA fences per project
401 Unauthorized
402 Insufficient Tokens
429 Rate Limited

List Delivery ETA Fences

GET
typescript
const result = await ss.delivery.etaFences.list()
  1. Open Delivery and go to the ETA Fences tab
  2. All ETA fences are displayed with their destination coordinates and threshold
Query param
Type
Description
enabled
string
Filter by enabled status: true or false
limit
integer
Results per page (1–100). Default 25.
cursor
string
Pagination cursor from previous response
Error responses
401 Unauthorized
402 Insufficient Tokens
429 Rate Limited

Get Delivery ETA Fence

GET
typescript
const fence = await ss.delivery.etaFences.get('etaf_abc')
  1. Open Delivery and go to the ETA Fences tab
  2. Click on a fence to view its destination, threshold, and metadata
Path param
Type
Description
fence_id required
string
ETA fence ID
Error responses
401 Unauthorized
402 Insufficient Tokens
404 Not Found
429 Rate Limited

Delete Delivery ETA Fence

GET
typescript
await ss.delivery.etaFences.delete('etaf_abc')
  1. Open Delivery and go to the ETA Fences tab
  2. Click the delete icon on the fence you want to remove
Path param
Type
Description
fence_id required
string
ETA fence ID to delete
Error responses
401 Unauthorized
404 Not Found
429 Rate Limited

Analytics

Delivery performance analytics and driver statistics.

deliveryAnalyticsSummary

GET
typescript
const summary = await ss.delivery.analytics.summary()
  1. Open Delivery and go to Analytics
  2. View the summary dashboard with order counts, delivery times, and trends

deliveryAnalyticsDrivers

GET
typescript
const driverStats = await ss.delivery.analytics.drivers()
  1. Open Delivery and go to Analytics
  2. Switch to the Drivers tab to view per-driver performance metrics

Export

Export delivery data in JSON or CSV format.

deliveryExportOrders

GET
typescript
const csv = await ss.delivery.export.orders()
  1. Open Delivery and go to Orders
  2. Click the Export button to download orders as CSV