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.
Null to customer and supplier portal users, like the run's batches.
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_eligiblebooleannullableWhether 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.
Null to customer and supplier portal users, like the rest of your commission settings.
notification_typesarray of stringnullableenumValues:invoiceorder_acknowledgementpurchase_order_submissionThe notifications you send this user about the customer or supplier account they belong to.
Set when the account you are acting in is a customer or supplier account you manage, and an empty list when none are enabled; turn them on and off with preferences on create and update. null for your own account's users, and where an account user is embedded in another resource.
order_acknowledgement: the confirmation email sent when an order is placed for the customer.invoice: invoice emails for the customer's orders.purchase_order_submission: a copy of each purchase order you submit to the supplier.
last_used_atstring (date-time)nullableWhen the user last accessed this account.
Null to customer and supplier portal users: it is your own team's activity.
created_atstring (date-time)When the account user was created.
updated_atstring (date-time)When the account user was last updated.
batch_countintegernullableNumber of batches currently recorded against this run.
Null to customer and supplier portal users: a run can hold other customers' work.
The run's batches totalled per item and unit, ordered by SKU.
Null to customer and supplier portal users: a run can hold other customers' work.
objectstringenumValues:listResource type identifier.
page_infoobjectPagination metadata.
next_page_urlstringnullableRelative URL that fetches the next page of results.
previous_page_urlstringnullableRelative URL that fetches the previous page of results.
has_next_pagebooleanWhether more results exist after this page.
has_prev_pagebooleanWhether results exist before this page.
dataarray of production_run_batch_summaryResources in this page.
objectstringenumValues:production_run_batch_summaryResource type identifier.
itementitynullableThe item the batches produce, named by its SKU.
idstringUnique identifier for the entity.
objectstringenumValues:entityResource type identifier.
typestringenumValues:accountactorentityThe 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.
namestringnullableHuman-readable display name for the entity (e.g. a user's full name, a sales order number).
handlestringnullableSecondary human-readable identifier (e.g. email address, username, redacted API key value).
unitentitynullableThe unit the quantity is counted in, named by its abbreviation.
idstringUnique identifier for the entity.
objectstringenumValues:entityResource type identifier.
typestringenumValues:accountactorentityThe 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.
namestringnullableHuman-readable display name for the entity (e.g. a user's full name, a sales order number).
handlestringnullableSecondary human-readable identifier (e.g. email address, username, redacted API key value).
quantity_valuestring (decimal)Total quantity of the batches, as a decimal string.
batch_countintegerNumber of batches in the total.
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