Create Production Run from Sales Order

Beta
POST/v1/sales/sales-orders/{id}/actions/create-production-run

Idempotent with Idempotency-Key header. Learn more

Creates a production run from a sales order.

Creates a batch for each of the order's item-backed lines, reserves the material inventory required to produce them, and links the run to the order. An order can have at most one production run.

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

Sales order ID.

include[]optional arrayenumValues:responsible_userresponsible_user.user

Sub-objects to expand in the response. When omitted, sub-objects are returned as null.

idstring

Production run ID.

objectstringenumValues:production_run

Resource type identifier.

numberstring

Production run number, unique per account.

Assigned automatically at creation as the next sequential number for the account; can be changed via update.

responsible_useraccount_userExpandablenullable

Account user accountable for executing the run.

idstring

Account user ID.

objectstringenumValues:account_user

Resource type identifier.

statusstringenumValues:activedisabledremoved

Account user status.

  • active: the user can access the account.
  • disabled: the user is locked out of the account.
  • removed: the user has been removed (soft-deleted) from the account.
rolerolenullable

Assigned role.

Always returned as null in this endpoint.
departmentdepartmentnullable

Assigned department.

Always returned as null in this endpoint.
useruserExpandablenullable

Underlying user.

idstring

User ID.

objectstringenumValues:user

Resource type identifier.

emailstringnullable

Email address.

namestringnullable

User's full display name.

usernamestringnullable

Username.

email_verified_atstring (date-time)nullable

When the user verified their email address.

image_urlstringnullable

URL of the user's profile image.

created_atstring (date-time)

Creation timestamp.

updated_atstring (date-time)

Last updated timestamp.

last_used_atstring (date-time)nullable

When 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_countinteger

Number of batches currently recorded against this run.

started_atstring (date-time)nullable

Time the run started production.

Set automatically when the first batch in the run is scanned, and unset until then.

completed_atstring (date-time)nullable

Time the run was marked complete.

Set automatically once every batch in the run has been scanned or deleted, and unset while the run is still in progress. Once set, the run can no longer be updated and new batches can no longer be added.

created_atstring (date-time)

Creation timestamp.

updated_atstring (date-time)

Last-updated timestamp.

Responses

201

Successful response for Create Production Run from Sales Order