Quote Sales Order Commitment

Beta
POST/v1/sales/sales-orders/actions/quote-commitment

Idempotent with Idempotency-Key header. Learn more

Previews the ship-by date a set of commitment inputs would produce, without creating or changing anything.

Runs the same resolution an order runs when it is issued: a promised delivery date has the customer's receiving days, the carrier's transit, and the plant's shipping days worked back through it, while a lead time or a pinned ship date is snapped onto the next earlier day the plant ships. The returned steps are that derivation in order, so a caller can show why a date is what it is rather than restating the rules.

At most one of promised_at, lead_time_override_days, and ship_by_override_date may be set; they are alternative answers to the same question.

Advisory rather than binding. Carrier transit comes from a lane cache warmed in the background, so a lane nobody has shipped yet quotes against the service level's default or against no transit at all, and the date stamped at issue may differ once the lane has been rated.

Permission requiredValues:sales_orders:read
The role behind your API key or agent must grant this permission.
sales_order_idoptional string

An existing order to preview against. Its customer, ship-to address, carrier, and service level are used, and the commitment fields below replace whatever it currently carries.

Omit it to preview an order that has not been created yet, supplying the parts directly.

buyer_account_idoptional string

The buying account, used to resolve its lead time and receiving days.

ship_to_address_idoptional string

The ship-to address, which decides the destination timezone and the lane transit is quoted on.

carrier_idoptional string

Carrier for the shipment.

service_level_idoptional string

Service level for the shipment, which the lane's transit estimate is keyed on.

issued_atoptional string (date-time)

When the order would be issued. Defaults to the date sales_order_id was issued on, or to now for an order that has not been issued — a lead time is measured from issue, so an order built today but issued next week commits to next week's date, and re-committing one issued last week still counts from last week.

promised_atoptional string (date-time)

Date delivery would be promised to the customer.

lead_time_override_daysoptional integer

Days between issue and the order being due to ship, in place of the customer's standing lead time.

ship_by_override_dateoptional string (date-time)

The exact date the order would be due to ship.

objectstringenumValues:sales_order_commitment_quote

Resource type identifier.

commitmentcommitmentnullable

The commitment the inputs would produce — the same object an order carries once issued, so a preview and the stamped result cannot drift.

Its ship_by_date is null when no rule resolves one, and transit_days is null when the lane has never been quoted and the service level carries no default, or when no service level was supplied to quote one on.

objectstringenumValues:commitment

Resource type identifier.

promised_atstring (date-time)nullable

Date delivery was promised to the customer, if one was committed.

lead_time_override_daysintegernullable

Days between issue and the ship-by date, set on this record alone in place of the customer's standing lead time.

ship_by_override_datestring (date-time)nullable

The ship date pinned by hand, bypassing transit and the customer's receiving days.

ship_by_datestring (date-time)nullable

When the record is contractually due to ship.

Stamped at issue. With a promised delivery date, this is that date less the carrier's transit for the order's lane and less any day the customer cannot receive on — when the order has to leave to arrive when promised. Otherwise it comes from a lead time, whether the order's own or the one on the customer, its parent account, its account group, or the account.

Always a day the plant actually ships on, whichever rule produced it, and carries the plant's pickup cutoff as its time of day when the shipping calendar sets one — the moment freight has to be tendered by, not just the day. Midnight UTC means no cutoff is configured rather than a deadline at midnight.

Recomputed while the order is still open whenever something it was derived from moves — the basis above, or the carrier, service level, or ship-to address the transit was quoted on. Renegotiating a customer's standing lead time or adding a holiday to a calendar does not reach back into commitments already made. Cleared if the order is unissued.

lead_time_daysintegernullable

Calendar days between issue and the ship-by date.

lead_time_sourcestringnullableenumValues:customerparent_customeraccount_group

Which rule produced the ship-by date.

transit_daysintegernullable

Business days the carrier needs to cover this lane, subtracted from the promised delivery date to reach the ship-by date.

Only set when a delivery date was promised and the lane could be priced. Without it the ship-by date falls back to the promised date itself.

transit_sourcestringnullableenumValues:carrier_laneservice_level

Where the transit estimate came from.

calendar_adjustment_daysintegernullable

Days the customer's receiving calendar and the plant's shipping calendar pulled the ship-by date back, beyond what carrier transit accounted for.

Zero means every date along the way already fell on an open day. This is what explains a ship-by date that is earlier than transit alone would suggest.

estimated_delivery_datestring (date-time)nullable

When freight leaving on the ship-by date would reach the customer: transit walked forward from it and landed on a day their dock receives.

Reported by the commitment preview, which is asked what a set of inputs would produce and so computes the arrival too. A record carries the commitment it was stamped with, not a projection, and leaves this null.

stepsarray of object

The derivation in order, one entry per rule that moved the date.

codestringenumValues:basisreceive_calendarcarrier_transit

Which rule applied.

datestring (date-time)

Where the running date stood after this rule.

days_movedinteger

How far this rule pulled the date back. Zero means the rule applied and changed nothing, which is worth showing: it says the date was already on an open day.

detailstringnullable

The rule's own parameter — where a transit estimate came from, or the cutoff time applied. Null for a rule that takes none, rather than an empty string: snapping onto an open day has no parameter to report.

Responses

200

Successful response for Quote Sales Order Commitment