Update a job
AI agents: read /llms.txt; add .md to any page URL. This page as Markdown: /reference/jobs/v2-job-update.md. Index of every page and the rules for every call: /llms.txt. Guides and concepts in one file: /llms-full.txt. OpenAPI: /openapi.json.
PUT/
Check success, not only the HTTP status: when the job's order is neither a draft nor published, this call answers HTTP 200 with { "status": 500, "success": false, "error": { "code": "action_not_allowed", "message": null } } and changes nothing.
Changes a job's name, note, position or rush flag, and adds, changes or removes its services, tasks, mockups and production files in one call.
Send only what you change. Each of service, pipeline, mockup and production_file is a list of actions: every entry has an action of create, update or delete, and entries you leave out stay as they are.
Changing services (the decoration, its location, option or order) reprices the job and recalculates the sales order's totals. Other changes don't touch prices.
To change the status use Change a job's status; for the job number use Change a job number; for dates use Schedule a job. Returns the updated job.
Business rules
- The job's sales order must be a draft or published. Otherwise the reply is HTTP 200 with
success: falseanderror.codeaction_not_allowedand nothing changes. - Every list entry needs an
action.serviceentries needservice_id,option,locationandpositionunless they delete. - A task's
status_idmust belong to itspipeline_id(task preset).
Side effects
- Changing services reprices the job and recalculates the order, its invoices and shipments that share pricing tiers.
- Turning
is_rushon or off sends thejob.marked_as_rushorjob.marked_as_not_rushwebhook. - Deleting a mockup with
approval_request_action: remove_open_itemschanges the job's open artwork approvals (see the field); Customer Portal pages the customer has open refresh for the approvals that remain. - Open Admin Portal pages refresh.
Path parameters
Your team slug, shown as Team ID next to your API key in Profile.
- Example
your-team
- Example
The job's hash id (
id). Hash ids only: a unique key or a document number gives 404.- Example
WaGvtaWsx7Kcn4
- Example
Query parameters
Optional.
1(ortrue,yes,on) makes the answer smaller: each mockup and production file'scurrent_approvalleaves out itsitemslist, and every other key stays as it is. The job'spending_approvaland webhook payloads keep their items. Every file repeats its approval with all of its items, so a job with many files on one approval answers with far less data this way; read approval items from the approvals operations instead. Left out (or any other value), the answer is unchanged. Only the query string is read: a body field with this name is ignored.- Example
1
- Example
Request body
application/json, required.
has_servicebooleanAccepted for older clients; it changes nothing.
is_rushbooleanMarks the job as a rush job.
mockuparray of objectsMockup actions. Mockups are uploaded files attached to the job.
Fields of each item (7)
- One of:
"create","update","delete"
- One of:
The uploaded file (for
create) or the mockup.approval_request_actionstringFor
delete: what to do with open artwork approvals that include this mockup.remove_open_itemstakes it out of every open approval of the job, and deletes each approval left with nothing to approve. Withkeep(the default) a mockup under an open approval stays in that approval.- One of:
"keep","remove_open_items"
- One of:
job_servicestring | arrayThe job service or services the mockup shows.
namestringpositionintegerRequired when
actioniscreate, but not used: YoPrint puts the new file last.show_in_pdfbooleanShow it on the sales order PDF. Required unless
actionisdelete.
namestringThe job name. A null is ignored (the name is kept).
notestringThe job note.
pipelinearray of objectsTask actions.
Fields of each item (10)
- One of:
"create","update","delete"
- One of:
assigned_usersarray of stringsUser hash ids to assign.
due_datestring (date-time) | nullAn ISO 8601 date or date-time, or null. Required (it may be null) when
actioniscreate.idstringThe task. Required unless
actioniscreate.namestringThe task name.
pipeline_idstringThe task preset. Required unless
actionisdelete.positioninteger- Minimum -2147483648
- Maximum 2147483647
start_datestring (date-time) | nullAn ISO 8601 date or date-time, or null. Required (it may be null) when
actioniscreate.status_idstringA status of that task preset. Required unless
actionisdelete.unassigned_usersarray of stringsUser hash ids to unassign (
updateonly).
positionintegerThe job's place among the order's jobs. To reorder every job safely, use Reorder the jobs of a sales order or quote.
- Minimum -2147483648
- Maximum 2147483647
production_filearray of objectsProduction file actions.
Fields of each item (4)
- One of:
"create","update","delete"
- One of:
The uploaded file (for
create) or the production file.job_servicestring | arrayThe job service or services the file is for.
positionintegerRequired when
actioniscreate, but not used: YoPrint puts the new file last.
scoped_idstringAccepted but ignored here. Use Change a job number.
servicearray of objectsService actions (the decorations on the job).
Fields of each item (8)
- One of:
"create","update","delete"
- One of:
Required for every action. For
updateanddelete, the job service's hash id. Forcreate, a temporary id you choose that starts withtmpid-(tmpid-1);mockupandproduction_fileentries in the same call can name it injob_service. Any other made-up value fails as a bad hash id.customer_notestringCustomer notes.
locationobjectWhere the service goes. Required unless
actionisdelete.notestringInternal notes.
optionanyThe service option, as your service defines it. Required unless
actionisdelete.positionintegerOrder of the service on the job. Required unless
actionisdelete.- Minimum -2147483648
- Maximum 2147483647
service_idstringThe service from your team's services. Required unless
actionisdelete.
More examples (1)
Rename a job and mark it rush
curl -X PUT 'https://secure.yoprint.com/v2/api/store/your-team/v2/job/WaGvtaWsx7Kcn4' \ -H 'Authorization: Bearer YOUR_API_KEY' \ -H 'Accept: application/json' \ -H 'X-Yoprint-Decimal-Format: exact-v1' \ -H 'Content-Type: application/json' \ -d '{ "is_rush": true, "name": "Front and back print" }'Response
200Successful response.
Errors
401The API key is missing or wrong (
unauthenticated).403You are not allowed to do this.
api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only{"message": "Insufficient Permission"}. Other refusals use the error envelope, withunauthorizedoruser_is_not_authorized.- When
- Your role can't edit this order (
user_is_not_authorized). - Fix
- Ask the team owner to adjust your role or assign you to the order.
404Not found.
page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's.code: null, with a message that starts "No query results for": there is no record with that id.- When
- The job isn't your team's, its order is an old (version 1) order, or an entry's
id(task, mockup, production file) isn't on this job. Jobs on quotes work too. - Fix
- Use the job's hash id (
id) from the order's job list; unique keys don't work in this path.
422The request was refused and changed nothing.
validation_failedlists what to fix inerror.fields; other codes name a business rule, explained inerror.message. A few checks answer with only{"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answerconnect_timeout("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.- When
- A list entry breaks its field rules (for example a service without
location.type):validation_failed. - Fix
- Read
error.fieldsand resend the entries. - When
- A service, option, task preset or task status is not valid, a task gets only one of its two dates, or a file wasn't uploaded first:
job_validation_error, with the reason inerror.messageand noerror.fields. - Fix
- Correct that entry and resend.
Notes
- A refusal here is HTTP 200 with
success: falseanderror.codeaction_not_allowed(the body'sstatussays 500). A client that only checks the HTTP status will treat it as done. - Do not send
status_idhere. Use Change a job's status, which checks the status and sends the status webhook. - Mockup and production file
createentries take the hash id of a file you uploaded first with the async upload (v1.public.async_upload.store); any other id is a 422.
Related
- GETGet one job of an order
/v2/ api/ store/ {team_slug}/ v2/ sales_order/ {hash_id}/ job/ {job_id} - PUTChange a job's status
/v2/ api/ store/ {team_slug}/ v2/ job/ {hash_id}/ status - PUTChange a job number
/v2/ api/ store/ {team_slug}/ v2/ job/ {hash_id}/ scoped_id - PUTSchedule a job
/v2/ api/ store/ {team_slug}/ v2/ job/ {hash_id}/ update_prod_date - PUTReorder the jobs of a sales order or quote
/v2/ api/ store/ {team_slug}/ v2/ sales_order/ {hash_id}/ job/ rearrange
