D2D² Schedulerhelp

D² Scheduling — Integration API

Integration guide · v1.6 · November 23, 2026 · Aigent Solutions

This guide covers D²'s read-only integration endpoints, for a company's own data systems that read its D² data on a schedule. They read, except one: a company's own system may send D² stocking suggestions (section 4.13), which a person then decides in D². Each endpoint is listed below once it is live in production. Metric definitions (how D² computes each figure it reports) are in the Metric Definitions guide.

1. Basics

ItemValue
Base URLhttps://api.d2scheduling.com (no /api prefix)
Paths/integration/v1/...
FormatJSON over HTTPS
AuthenticationAn API key in the X-D2-Api-Key header (section 2), or a Bearer token from POST /auth/login as an integration user
RolesThe integration role (an admin login also reaches these routes; use an integration user)
Rate limitsPer calling IP address: 60 requests a minute overall, 5 logins a minute, 10 token refreshes a minute. Per API key: 60 requests a minute. Over a limit → 429.
CallersServer-side callers only (scheduled jobs). Keep the key or password in your own secret store.

2. Authentication

With an API key (recommended). An admin makes a key in D², Settings, Company Settings, 10 API keys: a name for the system that will read, and an expiry if wanted. D² shows the key once, when it is made; it starts d2k_. Send it on every request, and no Authorization header with it:

X-D2-Api-Key: d2k_...

A key reaches the /integration/v1/ routes only, as your company's integration role, and nothing else. Every route reads, except the stocking suggestions write (section 4.13). A missing, unknown, revoked or expired key is a 401; a key and a sign-in on the same request are a 400. Give each system its own key. To change one, make a new key, move the system to it, then revoke the old one in the same section. D² keeps only a hash of each key, so a lost key cannot be shown again: revoke it and make a new one.

Or sign in as an integration user. D² support sets up one integration user for your company (Settings, Users does not offer the role, and cannot edit that user once it holds it). Ask support@d2scheduling.com, naming the system that will read. Log in as that user:

POST /auth/login
{ "email": "integration@yourcompany.com", "password": "••••••" }

Send the access token on every other request:

Authorization: Bearer <access_token>

The access token lasts 15 minutes. A scheduled job can log in at the start of each run, and refresh (POST /auth/refresh with the refresh_token) only if one run lasts longer than 15 minutes. The integration role reaches the /integration/v1/ routes and two older routes (GET /work-orders, and the notes on a step); nothing else.

3. Paging and changes since

Every list takes the same three query parameters and returns the same shape.

ParameterMeaning
updated_sinceOnly rows changed at or after this time (ISO 8601: 2026-10-27T00:00:00Z, 2026-10-27, or with an offset). Leave it out to read everything.
limitRows per page, 1 to 1000; 500 when left out.
cursorThe nextCursor of the previous page. Leave it out for the first page.
{ "items": [ ... ], "nextCursor": "MjAyNi0xMC0yMFQxMDowMDowMC4xMjM0NTZafC4uLg" }

Rows come oldest change first, ties in the order of their id, so a page boundary never skips or repeats a row. Keep reading with each nextCursor until it is null. To read only what changed, save the updatedAt of the last row you read and pass it as updated_since next run: the boundary row comes back once more, by design, so treat rows by id. A cursor is good only with the same updated_since it was returned with.

4. Endpoints

4.1 Customers

GET /integration/v1/customers?updated_since=2026-10-27T00:00:00Z&limit=500

Every customer of your company in D², active or not. Needs the Sales add-on; without it the answer is 403.

FieldMeaning
idD²'s customer id
customerNoOrderTime's customer number
externalIdOrderTime's customer id; null when D² has none
nameThe customer's name
isActiveActive in OrderTime
isLeadOrderTime marks the customer as a lead
missingFromOrderTimeAtWhen D² saw the customer missing from OrderTime; null while OrderTime lists it
createdAt, updatedAtWhen D² created and last changed the row (ISO 8601)

Contact details (people, email, phone, address) are not returned. A customer is never deleted from D²: one that leaves OrderTime keeps its row, with isActive false and missingFromOrderTimeAt set.

4.2 Work-order execution

GET /integration/v1/work-orders/execution?updated_since=2026-10-27T00:00:00Z&limit=500

Every work order of your company, open and closed, one row per order with its steps, as D² records them on the shop floor. Planned dates (due, scheduled, promised) are not returned: they belong to OrderTime and the schedule, not to execution. An order counts as changed when the order or any of its steps changed, so updated_since also returns an order whose step was started, logged, finished or moved.

FieldMeaning
woNumberOrderTime's work order number. Key your rows on it: it stays the same when an order closes or reopens
itemThe item the order makes
quantityOrdered, quantityCompleted, quantityScrappedThe order's quantities
statuspending, waiting, ready, in_production, on_hold, finished, cancelled, or closed
locationOrderTime's location for the order; null on a closed order (D² does not keep it at close)
priorityD²'s priority number for the order; null on a closed order that had none
isExpediteThe order is marked expedite
currentStepThe sequence number of the lowest step not complete or skipped; null when every step is, and always null on a closed order
currentStepDetailThe step currentStep names, as an object: seq, name, workCenter, department (that work centre's D² department id, as capacity and lead times return it; null when it has none) and status (pending, ready, in_progress or on_hold). null whenever currentStep is. A change to a work centre's department alone does not move updatedAt (added in v1.1)
procurementNoteThe work order's procurement note: D²'s note for the buyer from quoting or engineering (copied from the quote line when D² made the work order, or typed at Finalize or by a planner). D² only, never in OrderTime; null when there is none. A change to it moves updatedAt (added in v1.6)
closedAtWhen D² closed the order; null while it is open
updatedAtThe latest change to the order or any of its steps
stepsThe order's steps, in sequence order (below)

Each step:

FieldMeaning
seqThe step's sequence number
nameThe step's name
workCenterThe work centre the step runs at in D², a planner's change included
statuspending, ready, in_progress, on_hold, complete or skipped
actualStart, actualEndWhen the step started and finished on the floor; null until then
minutesLoggedMinutes of time logged on the step
quantityCompleted, quantityScrappedThe step's quantities
machineUsedThe machine recorded for the step
holdReason, holdStartedAtWhy the step is on hold, and since when; null when it is not

The person who started or finished a step is not returned. When an order closes, D² keeps a copy of it and its steps as they stood at that moment: the order comes back with status closed and closedAt set, and its steps from that copy. If OrderTime reopens it, it comes back as open again, under the same woNumber.

4.3 Labor

GET /integration/v1/labor?updated_since=2026-10-27T00:00:00Z&limit=500

Every time record of your company: one row each time someone clocked onto a step, logged time to it, or completed it with time, on open and closed orders. Each row names the step's work centre and labor type, never the person. Sum the rows however you need them (by day, work centre, order); a step's minutesLogged in section 4.2 is normally the sum of its finished records.

FieldMeaning
idThe time record's id. Key your rows on it
woNumberOrderTime's work order number
stepSeq, stepNameThe step the time was logged to
workCenterThe work centre the step runs at in D², a planner's change included
laborTypeshop, saw, qc or external
startedAtWhen the time started
endedAtWhen it ended; null while someone is still clocked in
minutesThe record's minutes; null while it is running
sourceHow it was entered: clock (clocked in and out), log_time (entered after the fact), gantt_complete (completed from the schedule), ran_with (a share of a run that covered several orders)
updatedAtThe latest change to the record

When an order closes, its records move into the copy D² keeps of it and come back once with a new updatedAt, under the same id. A record copied before August 28, 2026 had no id of its own: it carries one D² makes from the closed order and the record's place in it, the same on every read. If OrderTime reopens one of those older orders, its records come back under new ids; read that order's records again by woNumber. A closed order's step total can be corrected by hand in D² without changing its records, so for such a step the sum of its records can differ from minutesLogged.

4.4 Labor removed

GET /integration/v1/labor/removed?updated_since=2026-10-27T00:00:00Z&limit=500

The time records an admin deleted, oldest first, so you can drop them from what you hold. An order closing removes nothing (its records move, section 4.3).

FieldMeaning
idThe id of the time record that was deleted
removedAtWhen it was deleted

The list is read from D²'s record of each delete. That record is written on a best-effort basis: in the rare case it fails, the delete is not listed. To catch one, compare your sums with the steps' minutesLogged (section 4.2).

4.5 Capacity

GET /integration/v1/capacity?updated_since=2026-10-27T00:00:00Z&limit=500

D²'s capacity by work centre, one row per work centre and day: the Capacity view's Day figures as they stood at 10:00 your time that day. D² writes each day's rows once and never changes them, so a row's capturedAt is its only change. Rows start on September 28, 2026. Only work centres that use labor capacity have rows. Every amount is in minutes; the Capacity screen shows the same figures in hours.

FieldMeaning
idThe row's id
dateYour company's day the figures are for (YYYY-MM-DD)
workCenterId, workCenterThe work centre, by its D² id and its name that day
departmentThe work centre's department that day; null when it had none
capacityMinutesCapacity available that day, D²'s capacity % included
staffedMinutesStaffed time, as entered
releasedMinutes, loadedMinutes, committedMinutesThe work in each queue section at the work centre
pastDueMinutesCommitted work whose planned end had passed; already included in committedMinutes
workOnHandMinutes, workOnHandDaysAll the work on hand, in minutes and in open days of capacity; days null when there was no staffed time to measure by, or when beyondWindow is true
beyondWindowThe work on hand outlasted the 60 open days D² reads ahead
openJobsWork orders with a step at the work centre
onTimeCounted, onTimeSteps finished in the 4 weeks before that carried a promise, and how many of those finished by the promised day
capturedAtWhen D² wrote the row

Read updated_since as "written since": pass the capturedAt of the last row you read.

4.6 Lead times

GET /integration/v1/lead-times

The current lead time for every work centre that uses labor capacity and for every department, worked out at the moment you call, by the definition in the Metric Definitions guide (current_queue_leadtime_v1): the work on hand divided by the daily capacity averaged over the 14 open days from today. It is a reading, not stored history: it takes no updated_since, cursor or limit, and returns every row at once. To keep a history, call it on a schedule (once a day, say) and store what comes back with its asOf.

{ "asOf": "2026-10-28T17:00:00.000Z", "today": "2026-10-28", "metric": "current_queue_leadtime_v1", "items": [ ... ] }
FieldMeaning
scopework_center or department
id, nameThe work centre's or department's D² id and name
departmentA work centre's department; null on a department row
leadTimeDaysThe work on hand over the daily capacity, in days, worked out before rounding (so dividing the two minute figures can differ in the second decimal); null when there is no capacity
queuedMinutesThe work on hand the Capacity view shows: the work centre queue plus committed work in the next 14 open days
dailyCapacityMinutesThe capacity, averaged over the 14 open days from today
workCentersThe work centres measured: the one on a work centre row, the ones pooled on a department row

Work centres come first, in their D² sort order, then departments by name. A department pools its work centres' minutes before dividing.

4.7 Quotes

GET /integration/v1/quotes?updated_since=2026-10-27T00:00:00Z&limit=500

Every quote of your company in D², drafts included. Needs the Sales add-on; without it the answer is 403. A quote is for a customer (customerId, the id the customers route returns) or for a lead, a prospect not yet in OrderTime (leadId and leadName). The buyer's name, email and phone are not returned, for a customer or a lead.

FieldMeaning
id, quoteNoD²'s quote id and number (shown as Q-1001)
statusdraft, sent, won or lost
customerIdThe customer; null on a lead's quote
leadId, leadNameThe lead; null on a customer's quote
repUserId, repNameThe rep on the quote
subtotalEach line at its first (lowest) quantity break, times that break's price, summed; a break with no price counts 0. The figure the Quotes screen shows
feesTotalThe quote's fees summed, each a percent of the subtotal or a flat amount
validUntilThe day the quote is good through (YYYY-MM-DD); null when none
sentAt, decidedAtWhen it was sent, and when it was won or lost
ordersThe D² orders made from it, each { id, soNumbers }: the order's D² id and OrderTime's sales order numbers for this quote's lines once sent
createdAt, updatedAtWhen D² created and last changed the quote

A quote becomes won when an order made from it reaches OrderTime. D² shows a sent quote past its validUntil as expired; it is not stored, so work it out from status and validUntil if you need it. To count the quotes open today, count draft and sent (and leave out those you treat as expired). Making an order from a quote does not change the quote's updatedAt until the order is sent and the quote is won; orders is read as it stands when you call.

4.8 Quotes removed

GET /integration/v1/quotes/removed?updated_since=2026-10-27T00:00:00Z&limit=500

The quotes that were deleted, oldest first, so you can drop them from what you hold. Only a draft can be deleted; a sent, won or lost quote is kept. Read from D²'s record of each delete, written on a best-effort basis: in the rare case it fails, the delete is not listed.

FieldMeaning
idThe id of the quote that was deleted
removedAtWhen it was deleted

4.9 Orders

GET /integration/v1/orders?updated_since=2026-10-27T00:00:00Z&limit=500

The sales orders entered in D² (orders entered in OrderTime directly are not here). Needs the Sales add-on; without it the answer is 403. One row per order entered: when it is sent, D² makes one OrderTime order per ship-to (and per date when an order is split), listed in orders.

FieldMeaning
idThe D² order's id; the id a quote's orders names (section 4.7)
customerIdThe customer, as the customers route returns it
customerPoThe customer's PO as entered
statusdraft (not sent), sending, partly_sent or sent
valueEach line's quantity times its price, summed: OrderTime's price once the line is in OrderTime, else the price from the quote it came from
lines, unpricedLinesHow many lines, and how many have no price yet (they count 0 in value, so value is incomplete while this is above 0)
firstDeliveryDate, lastDeliveryDateThe earliest and latest line delivery dates (YYYY-MM-DD)
ordersThe OrderTime orders it makes, each { seq, customerPo, soNumber, status }: the PO sent on it, OrderTime's sales order number once created, and pending, created, failed, unknown or withdrawn
enteredAt, sentAtWhen it was entered in D², and when it was sent
updatedAtThe latest change to the order or any of its lines

4.10 Orders removed

GET /integration/v1/orders/removed?updated_since=2026-10-27T00:00:00Z&limit=500

The orders deleted in D², oldest first. An order can be deleted only before any of its OrderTime orders was created (one in OrderTime is withdrawn there first). Read from D²'s record of each delete, written on a best-effort basis: in the rare case it fails, the delete is not listed.

FieldMeaning
idThe id of the order that was deleted
removedAtWhen it was deleted

4.11 Work-order schedule

GET /integration/v1/work-orders/schedule?updated_since=2026-11-03T00:00:00Z

Each work order's plan beside its execution (4.2): its steps on D²'s schedule, D²'s projected finish, its sales order and customer, and the work orders it feeds and depends on. One row per work order D² holds, and per work order D² closed in the last 30 days. At most 500 rows a page, whatever limit asks. Key your rows on woNumber: a work order's D² id changes when it closes. Added in v1.2.

An order counts as changed when the order, any of its steps (its scheduled times included) or any of its feed links changes, so updated_since returns an order D² re-scheduled. D² works out the projected finish when you read, and does not store it: a projection that moves only because time passed or the shop's measured pace moved, on steps not yet scheduled, does not move updatedAt. Neither does stock or a purchase order that starts or ends a material block (below). Read the whole set once a day (no updated_since) to pick those up.

An order that needs material that is short and has no open purchase order line is not projected (added in v1.3): its projectedFinishAt, measuredFinishAt and projectedFinishBasis are null, projectionNote is material not on order, and the steps from the first step that needs that material on carry no projectedEnd. A component on no step counts at the first open step. Outside-process services and labour are not material, and a part another open work order is making for the order, or that a purchase order is pegged to it for, is on order (corrected 2026-11-06). D²'s own screens show "Material not on order" for the same orders.

FieldMeaning
woNumberOrderTime's work order number, the key to use
statusD²'s status for the order; closed for an order D² has closed
soNumberThe order's sales order number; null for stock or internal work
customerIdThe D² customer id that 4.1 returns, through the sales order; null when there is none
qtyOrdered, qtyCompleteThe order's quantities
dueDateThe work order's due date in D² (YYYY-MM-DD)
promiseDate, promiseSourceThe date D²'s projected finish is compared against: the sales order's promise (sales_order) when the order is for one, else the due date (work_order)
feedsWoNumbersThe work orders this one's output goes into (its parents); empty when it feeds stock or ships
dependsOnWoNumbersThe work orders that must finish before this one (its children). A parent and its child always list each other
procurementNoteThe same as 4.2's procurementNote: the buyer's note for the work order, or null. A change to it brings the order back as changed (added in v1.6)
currentStepThe same object as 4.2's currentStepDetail; null when every step is done, and on a closed order
stepsThe order's steps, in sequence order (below)
projectedFinishAtD²'s ETA for the order, the date D²'s own screens show; null when it cannot be projected
measuredFinishAtThe finish at the shop's measured pace, D²'s "At measured pace": the same walk, with every open step dated by measured pace instead of the schedule or a planner's date; null when projectedFinishAt is (added in v1.3)
projectedFinishBasisscheduled when every open step is dated by D²'s schedule or a planner's date; estimated when some are dated by measured pace or OrderTime's estimate; null with projectionNote
projectionNoteWhy there is no projection: closed, no ETA, or material not on order (added in v1.3)
remainingMinutesThe sum of the steps' remainingMinutes
updatedAtThe latest change to the order, a step or a feed link
removedAtWhen D² closed the order, or the last change of a cancelled one; null otherwise

Each step:

FieldMeaning
seq, nameThe step's sequence number and name
workCenter, workCenterIdThe work centre the step runs at in D² (a planner's change included) and its D² id; null id when D² has no work centre of that name
departmentThat work centre's D² department id, as 4.5 and 4.6 return it; null when it has none
statusnot_started (pending, ready), in_progress (in progress, on hold) or complete (complete, skipped)
d2StatusD²'s own status: pending, ready, in_progress, on_hold, complete or skipped
estMinutes, actualMinutesOrderTime's estimate and the minutes logged
remainingMinutesestMinutes less actualMinutes, never below 0; 0 on a complete or skipped step
scheduledStart, scheduledEndThe step's slot on D²'s schedule; null when it has none, and on a closed order
projectedEnd, projectedSourceWhen D²'s ETA has the step finishing, and what set it (finished, skipped, scheduled, planner_eta, measured or estimated); null on a closed order, and from the step that needs material not on order on

A work centre name can belong to more than one D² work centre; D² takes one, in this order: not ignored, active, with a department, the lowest code. 4.2 takes the same one. The person who ran a step is not returned.

4.12 Purchase order lines

GET /integration/v1/purchase-orders/lines?updated_since=2026-11-06T00:00:00Z

Each purchase order line with its purchase order's dates and the two notes D²'s PO Tracker shows for it. One row per line of an open purchase order, and per line of one closed in the last 30 days (D² keeps no closing date; a closed purchase order stops changing when it closes, so its last change stands for it). Key your rows on lineId. Added in v1.4.

A line counts as changed when the line or its purchase order changes. Saving either note moves it, so updated_since returns a line whose note changed. D² also refreshes every open purchase order from OrderTime every few minutes, which moves it too: expect every open line in each read, not only the ones whose notes changed. D² keeps no separate time for when a note changed.

FieldMeaning
lineIdThe D² id of the line, the key to use
poNumber, lineNoOrderTime's purchase order number and the line's number on it
vendorNo, vendorNameOrderTime's vendor id and name
poStatusOrderTime's status name for the purchase order
poClosed, lineClosedOrderTime has closed the purchase order, or the line
partNo, descriptionThe part number and the line's description
quantity, receivedQty, qtyRemainingOrdered, received, and left to receive
plannerNotesThe PO Tracker's Notes for this line (the planner's note); null when there is none
vendorNotesThe PO Tracker's Vendor Notes for this line; null when there is none
promiseDateThe purchase order's promise date in OrderTime (YYYY-MM-DD)
dateSentThe purchase order's Date Sent (YYYY-MM-DD)
materialEtaThe purchase order's Material ETA (YYYY-MM-DD), when the company names the OrderTime field that holds it
linkedWoNumberThe work order the line is linked to, as the PO Tracker shows it: an open one first, the soonest due; null when there is none. Its steps, Planner ETA dates included, are in 4.2 and 4.11
updatedAtThe latest change to the line or its purchase order

4.13 Stocking suggestions (write and read-back)

POST /integration/v1/stocking-suggestions

A company's own system sends D² its stocking suggestions: a run size and reorder point per item. A person then accepts, edits, rejects or defers each one in D², 08 Items, Suggestions, beside D²'s own. A suggestion never changes a stocking policy or an item's stocking mode by itself. This is the only route in this guide that writes, and it needs the Sales add-on. Added in v1.5.

Register the source first. An admin adds the source by name in D², 10 Sales Settings, Stocking suggestions, Sources. A source is on when it is added. Switched off, it adds nothing, and its suggestions already in stay to be decided. A source is never renamed or removed, because its suggestions carry its name. Each request names its source, in any case.

{
  "source": "Planning-Sheet",
  "suggestions": [
    { "partNo": "A-100", "kind": "stock", "runSize": 1200, "reorderPoint": 300, "monthlyUse": 400, "leadTimeDays": 21, "explanation": "Seasonal peak in Q1" },
    { "partNo": "A-200", "kind": "made_to_order" }
  ]
}
FieldMeaning
sourceA source your company registered and switched on
suggestions1 to 500 items, each judged on its own
partNoNeeded: an active item of your company in D², 1 to 100 characters
kindNeeded: stock or made_to_order
runSizeNeeded for stock: a number, zero or more
reorderPointFor stock: a number, zero or more, or null for none (a person types one when accepting)
monthlyUse, leadTimeDays, explanationOptional, shown on the suggestion as sent: numbers zero or more (lead time at most 3650 days), and text up to 2000 characters

A made_to_order item sends no run size or reorder point. Numbers are below 100,000,000,000 and kept to four decimal places. A field this route does not know, or a number sent as text, refuses that item, so a misspelt field is never dropped. An item named twice in one request is refused after its first.

A suggestion is added only when its kind, run size or reorder point differs from this source's latest suggestion for the item. A changed explanation or monthly use alone adds nothing. An open suggestion from the same source that it differs from is kept as replaced. D²'s own suggestions and another source's are never compared or replaced.

{ "source": "Planning-Sheet", "saved": true, "received": 2, "added": 1, "unchanged": 0, "refused": 1,
  "results": [ { "index": 0, "partNo": "A-100", "result": "added", "id": "...", "problems": [] },
               { "index": 1, "partNo": "A-200", "result": "refused", "id": null, "problems": ["..."] } ] }

index is the item's place in suggestions, from 0. result is added, unchanged or refused, with problems saying why.

GET /integration/v1/stocking-suggestions?source=Planning-Sheet&updated_since=2026-11-01T00:00:00Z

The read-back: this source's suggestions with their decisions, paged as in section 3. source is needed, a registered source, on or off. Key your rows on id. It never says who decided.

FieldMeaning
idThe D² id of the suggestion
partNo, source, kindAs sent; the source with its registered spelling
workedOutAtWhen D² received it
runSize, reorderPoint, monthlyUse, leadTimeDays, explanationAs sent, null when none
stateto_decide, deferred, accepted, edited, rejected or replaced
deferredUntilThe day a deferred suggestion is to decide again
finalRunSize, finalReorderPoint, effectiveFromThe run size, reorder point and first day of the policy saved, when accepted or edited
reasonWhy a number was changed, when edited
rejectReason, rejectNoteWhy it was rejected
decidedAtWhen it was decided
updatedAtThe latest change

5. Errors

CodeMeaningWhat to do
400An API key and a sign-in on the same request; or, for section 4.13, a source that is not registered (or is switched off, for a write) or a body that is not 1 to 500 suggestions; or a parameter is not valid: updated_since that is not a time, a cursor this API did not return, limit outside 1 to 1000 (section 4.11 pages at most 500 rows whatever limit asks)Fix and retry
401A missing, unknown, revoked or expired API key; or a missing or expired tokenCheck the key, or make a new one; refresh, or log in again
403Not an integration user, or the company does not have the add-on the route needsUse the integration user; check the add-on
429Rate limit reachedWait a minute and retry

6. Good citizenship


Questions: support@d2scheduling.com