Create Production Run from Sales Order
Beta/v1/sales/sales-orders/{id}/actions/create-production-runIdempotent with Idempotency-Key header. Learn more
Creates a production run from a sales order.
Walks the production flow behind each item-backed line to work out what actually has to be made, then creates one batch for each item that is produced directly from raw materials, sized to cover every line that needs it. Reserves the material inventory those batches consume and links the run to the order. The caller becomes the run's responsible user. An order can have at most one production run, and a line whose item has no production flow contributes no batches.
idstringSales order ID.
include[]optional arrayenumValues:responsible_userresponsible_user.userSub-objects to expand in the response. When omitted, sub-objects are returned as null.
idstringProduction run ID.
objectstringenumValues:production_runResource type identifier.
numberstringProduction run number, unique per account.
Assigned automatically at creation as the next sequential number for the account; can be changed via update.
Account user accountable for executing the run.
idstringAccount user ID.
objectstringenumValues:account_userResource type identifier.
statusstringenumValues:activedisabledremovedThe current state of this user's membership in the account.
active: the user can sign in to the account and occupies one of the plan's seats.disabled: the user is locked out of the account and their sessions have been revoked, but the membership is retained.removed: the membership has been soft-deleted; it is hidden from listings by default and can be restored with the activate action.
The role that determines what this user is permitted to do in the account.
null in this endpoint.The department this user belongs to within the account.
null in this endpoint.useruserExpandablenullableThe underlying user profile, shared across every account this person belongs to.
idstringUser ID.
objectstringenumValues:userResource type identifier.
emailstringnullableEmail address the user signs in with and receives platform email at.
namestringnullableUser's full display name.
usernamestringnullableUsername the user can sign in with instead of their email address.
Usernames are unique across the whole platform, not just within your account.
email_verified_atstring (date-time)nullableWhen the user verified their email address.
image_urlstringnullableLocation of the user's profile image.
For photos uploaded through the API this holds an internal path rather than a fetchable image URL; call Get User Photo URL to obtain a temporary link to the image itself.
created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last updated timestamp.
is_commission_eligiblebooleanWhether this user can be assigned as a sales representative on orders, territories, and targets.
Independent of the sales_rep role type, which still scopes analytics and hides cost. Users with the sales_rep role are always eligible.
last_used_atstring (date-time)nullableWhen the user last accessed this account.
created_atstring (date-time)When the account user was created.
updated_atstring (date-time)When the account user was last updated.
batch_countintegerNumber of batches currently recorded against this run.
started_atstring (date-time)nullableTime the run started production.
Set automatically the first time a batch in the run is scanned at a station.
completed_atstring (date-time)nullableTime the run finished production.
Set automatically once every batch in the run has been scanned or deleted. From that point the run can no longer be updated and no further batches can be added to it.
created_atstring (date-time)Creation timestamp.
updated_atstring (date-time)Last-updated timestamp.
Responses
Successful response for Create Production Run from Sales Order