Preview Production Schedule Regenerate

Beta
PUT/v1/operations/production-schedules/{id}/actions/preview-regenerate

This endpoint is idempotent. Learn more

Returns what regenerating this draft would change, without changing it.

Every campaign either plan holds is listed, including the ones both agree on, so the caller can render a full side-by-side rather than a list of surprises. Only a draft can be previewed, for the same reason only a draft can be regenerated.

The comparison is run the way a regenerate runs by default — hand-edited campaigns are kept, and the fresh solve plans around them — so they read as unchanged rather than as work the solver wants to take away. manual_line_count is how many campaigns on the draft were placed or edited by hand, which is the work a replace_all regenerate is putting at risk.

The horizon and demand basis default to the ones this version already has, so a plain call changes only how current the plan is, not what question is being asked.

Permissions requiredValues:production_schedules:read
The role behind your API key or agent must grant every one of these permissions.
idstring

ID of the production schedule.

planning_as_ofoptional string (date-time)

The instant to plan against, which is what stock, demand history and active demand overrides are read as of.

Defaults to now rather than to the instant the version was first generated, so a plain call answers "what would the solver say today". Because the horizon re-anchors to the week containing this instant, a campaign can appear under a different week_index than the one stored on the draft.

horizon_weeksoptional integer

Number of weeks the re-solve should cover, defaulting to the horizon this version already has.

demand_basisoptional stringenumValues:trailing_12seasonal_ema

How future demand is derived, defaulting to the basis this version was solved with.

  • trailing_12: demand is the trailing twelve months of orders.
  • seasonal_ema: demand is a seasonal exponential moving average, which follows a season arriving early or late rather than flattening it.
objectstringenumValues:production_schedule_regenerate_preview

Resource type identifier.

production_scheduleentitynullable

The draft this would act on.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The resource kind that this entity references, as an object-type value (e.g. user, account).

Unlike object — which is always entity — this names the underlying resource the id points to.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

solver_versionstring

Which solver produced the proposal.

planning_as_of_atstring (date-time)

The instant the fresh solve planned from.

Unless the caller names an instant, a regenerate plans from now rather than replaying the one the draft was first generated against, so demand overrides added since then are taken into account and the horizon re-anchors to today.

lineslistnullable

Every campaign either plan holds, including the ones both agree on.

objectstringenumValues:list

Resource type identifier.

page_infoobject

Pagination metadata.

next_page_urlstringnullable

Relative URL that fetches the next page of results.

previous_page_urlstringnullable

Relative URL that fetches the previous page of results.

has_next_pageboolean

Whether more results exist after this page.

has_prev_pageboolean

Whether results exist before this page.

dataarray of object

Resources in this page.

changestringenumValues:addedremovedchanged

What the regenerate would do to this campaign.

  • added: the fresh solve wants a campaign the current plan does not have.
  • removed: the current plan holds a campaign the fresh solve does not want.
  • changed: both hold the campaign, in different quantities.
  • unchanged: both agree on it.
itementitynullable

The item the campaign produces.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The resource kind that this entity references, as an object-type value (e.g. user, account).

Unlike object — which is always entity — this names the underlying resource the id points to.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

skustring

SKU of that item.

machineentitynullable

The machine the campaign runs on.

idstring

Unique identifier for the entity.

objectstringenumValues:entity

Resource type identifier.

typestringenumValues:accountactorentity

The resource kind that this entity references, as an object-type value (e.g. user, account).

Unlike object — which is always entity — this names the underlying resource the id points to.

namestringnullable

Human-readable display name for the entity (e.g. a user's full name, a sales order number).

handlestringnullable

Secondary human-readable identifier (e.g. email address, username, redacted API key value).

week_indexinteger

Zero-based horizon week.

current_quantitynumber

Units the current plan asks for.

Zero when the campaign is being added.

proposed_quantitynumber

Units the fresh solve asks for.

Zero when the campaign is being removed.

current_is_manualboolean

Whether the current campaign was created or edited by a person.

added_countinteger

Campaigns the fresh solve wants that the current plan does not have.

removed_countinteger

Campaigns the current plan has that the fresh solve does not want.

changed_countinteger

Campaigns both hold, in different quantities.

manual_line_countinteger

Hand-edited campaigns currently on the draft.

discarded_manual_countinteger

Hand-edited campaigns replace_all would destroy.

Responses

200

Successful response for Preview Production Schedule Regenerate