PhotoCopyOrder.SaveDraft
Endpoint
- Method:
POST - Route:
PhotoCopyOrder/SaveDraft - Authentication:
Authorize
Request Schema
Headers
| Header | Required | Notes |
|---|---|---|
X-Api-Key |
Required when tenant is not resolved by subdomain | Resolves the tenant/customer database. |
Authorization: Bearer {token} |
Required for authorized endpoints | Get a token from Auth/Token or Session/Create. |
JSON Body
Body type: PhotoCopyOrderRequest
| Field | Type | Required | Max Length | Notes |
|---|---|---|---|---|
webOrder |
string? |
No | 20 | |
referenceNumber |
string |
Yes | ||
caseNumber |
string |
Conditional | Required unless releaseType is 11. | |
courtCode |
string |
No | 12 | Court code, not the court display name. Optional on draft saves. When sent, it must exist in the tenant court table. Names such as TUOLUMNE are rejected; send the court code from Court.Search, Court.GetAll, or Court.Get. PhotoCopyOrder.Create requires a valid court code unless noCourt is true. |
noCourt |
bool |
No | When true, the draft is saved with court code NONE. Send courtCode as "" or NONE. |
|
attorney |
int? |
Yes | Attorney code from Attorney.GetAll. Optional on a partial draft. When sent, the code must exist for the authenticated customer and must not be retired. |
|
billToAttorney |
int? |
No | Attorney code from BillTo.GetAttorneys. |
|
plaintiff |
string |
Conditional | Required unless releaseType is 11. | |
defendant |
string |
Conditional | Required unless releaseType is 11. | |
representing |
string |
Yes | ||
billMe |
bool |
No | ||
shipToMe |
bool |
No | ||
releaseType |
int |
Yes | Release type code from ReleaseType.GetAll. That endpoint returns the possible release type options. |
|
patientName |
string |
Yes | ||
patientId |
string |
Yes | ||
birthDate |
DateTime? |
Conditional | Required when releaseType is 11. | |
injuryDate |
DateTime? |
Conditional | Required when releaseType is 11. | |
specialInstructions |
string |
Yes | ||
dueDate |
DateTime? |
No | ||
rush |
bool |
No | ||
export |
bool |
No | Ignored by SaveDraft. Draft saves never create WinCopy CWorkOrder records. |
|
billToParties |
List<PhotoCopyBillToPartyRequest> |
No | ||
shipToParties |
List<PhotoCopyShipToPartyRequest> |
No | ||
opposingCounsels |
List<PhotoCopyOpposingCounselRequest> |
No | ||
facilities |
List<PhotoCopyFacilityRequest> |
Yes | At least one facility is required. Each facility may include record date fields (recordDates, from, to) — see Facility Record Dates. |
|
documents |
List<PhotoCopyDocumentRequest> |
Yes | At least one document or attachment is required. |
Type / Enum Values
| Field | Allowed Values | Notes |
|---|---|---|
releaseType |
Integer from ReleaseType.GetAll | Use the returned code from the linked lookup endpoint. |
shipToParties[].shipVia |
code from ShipRecordsVia.GetAll |
Use the linked lookup endpoint to get valid shipping methods for records. |
courtCode |
code from Court.Search, Court.GetAll, or Court.Get |
Send the court code, not the court name/description. |
facilities[].recordDates |
0, 1, or 2 |
See Facility Record Dates. Values outside 0–2 are treated as 0 (AllDates). |
Facility Record Dates
Record dates are set per facility on each item in facilities[]. They control whether the order requests all dates, from a start date through present, or a closed date range.
| Field | Type | Required | Notes |
|---|---|---|---|
recordDates |
int |
No | Record date mode. Defaults to 0 (AllDates) when omitted. |
from |
DateTime? |
Conditional | Start date. Use when recordDates is 1 (ToPresent) or 2 (DateRange). |
to |
DateTime? |
Conditional | End date. Use when recordDates is 2 (DateRange). |
recordDates values
| Value | Name | How to use |
|---|---|---|
0 |
AllDates | Request all available dates. Omit from and to (or leave them null). |
1 |
ToPresent | Request records from a start date through present. Send from; omit to (or leave it null). |
2 |
DateRange | Request a closed date range. Send both from and to. |
Examples
All dates:
{
"name": "General Hospital",
"recordDates": 0
}
From a date to present:
{
"name": "General Hospital",
"recordDates": 1,
"from": "2025-01-01T00:00:00"
}
Specific date range:
{
"name": "General Hospital",
"recordDates": 2,
"from": "2025-01-01T00:00:00",
"to": "2026-05-01T00:00:00"
}
Request Sample
{
"webOrder": "W123456",
"referenceNumber": "REF-12345",
"caseNumber": "24STCV12345",
"courtCode": "LASC",
"noCourt": false,
"attorney": 123,
"billToAttorney": 456,
"plaintiff": "Acme Corporation",
"defendant": "John Doe",
"representing": "Plaintiff",
"billMe": true,
"shipToMe": false,
"releaseType": 1,
"patientName": "John Patient",
"patientId": "PAT-12345",
"birthDate": "1980-01-15T00:00:00",
"injuryDate": "2026-04-15T00:00:00",
"specialInstructions": "Please request complete chart.",
"dueDate": "2026-05-21T00:00:00",
"rush": false,
"export": false,
"billToParties": [
{
"firmName": "Acme Insurance",
"adjuster": "Alex Adjuster",
"address": "500 Billing Ave",
"city": "Los Angeles",
"state": "CA",
"zip": "90012",
"phone": "2135550199",
"claimNumber": "CLM-12345",
"dateOfLoss": "2026-04-15T00:00:00",
"insuredName": "John Patient",
"policyNumber": "POL-12345"
}
],
"shipToParties": [
{
"firmName": "Acme Law",
"adjuster": "Sarah Ship",
"address": "600 Ship St",
"city": "Los Angeles",
"state": "CA",
"zip": "90012",
"phone": "2135550123",
"shipVia": 1,
"ocr": true,
"tabbing": false,
"bateStampInstructions": "Stamp lower right."
}
],
"opposingCounsels": [
{
"name": "Opposing Counsel LLP",
"adjuster": "Olivia Opposing",
"address": "700 Counsel Rd",
"city": "Los Angeles",
"state": "CA",
"zip": "90012",
"phone": "2135550456",
"consumer": "John Patient",
"representing": "Defendant",
"representativeName": "John Doe",
"primaryOpposingCounsel": true,
"handServeOpposing": false,
"mailNotice": true,
"emailNotice": false
}
],
"facilities": [
{
"id": "FAC-001",
"name": "General Hospital",
"custodian": "Records Custodian",
"address": "800 Health Way",
"city": "Los Angeles",
"state": "CA",
"zip": "90012",
"phone": "2135550789",
"fax": "2135550790",
"medicalRecordNumber": "MRN-12345",
"recordDates": 2,
"from": "2025-01-01T00:00:00",
"to": "2026-05-01T00:00:00",
"medical": true,
"billing": true,
"dental": false,
"other": false,
"otherRecords": "",
"xRays": false,
"pathology": false,
"ambulance": false,
"signIn": false,
"employment": false,
"insurance": false,
"prescription": false,
"pathMaterial": false,
"school": false,
"legal": false,
"psych": false,
"payroll": false,
"bank": false,
"accidentReport": false,
"stockRecords": false,
"creditCard": false,
"phoneRecords": false,
"policeReport": false,
"optometry": false,
"mentalHealth": false,
"inmate": false,
"taxRecords": false,
"specialInstructions": "Include billing ledger.",
"depositionDate": null,
"depositionTime": null,
"facilityNumber": 1001,
"depositionName": "",
"depositionStreet": "",
"depositionCity": "",
"depositionState": "",
"depositionZip": "",
"trialDate": null,
"trialTime": null,
"depositionInstructions": "",
"depositionGoodCause": "",
"depositionMateriality": "",
"department": "Records",
"division": "Medical",
"room": "101",
"who": "Records Custodian",
"isOrderedToDesignate": false,
"isRecordedStenographic": false,
"isVideoForUseAtTrial": false,
"isInstantVisualText": false,
"isDepositionVirtual": false,
"isExcludingNoticeToConsumer": false,
"mattersPhrase": null,
"isContinuedOnAttachment": false,
"doSendCopyOfTrialSubpoena": false,
"willFirmEnsurePartiesNotifiedOfTrial": false,
"doCreateNoticeOfTakingDeposition": false,
"hasCreatedOwnDepositionNoticeToInclude": false,
"isFirmRequiredToSendDepositionNotice": false,
"hasAttachmentForDescriptionOfDeponentAndMatters": false,
"isAuthorizedToAdvanceWitnessFees": false,
"isWitnessFeeTenderedAtTimeOfService": false,
"isOrderedToAppearAndProduceRecords": false,
"isNotRequiredToAppear": true,
"contactPerson": "Riley Records",
"specialNotes": "Call before pickup.",
"doUseOwnLanguageForMaterialitySection": false,
"isProvidingOwnMaterialityLanguageForSubpoena": false
}
],
"documents": [
{
"id": "doc-123",
"name": "authorization.pdf",
"base64": "JVBERi0xLjQ=",
"facilityIds": [
"FAC-001"
]
}
]
}
Document Upload Mapping
For each item in documents:
| Field | Meaning |
|---|---|
id |
Client-supplied temporary attachment id. When base64 is provided, the API writes the decoded bytes to the configured upload folder using this id after replacing characters that are not letters, digits, or underscores with _ (including spaces, colons, and hyphens). The original name is kept as the display file name. If id is omitted with base64, the API generates a GUID id. When base64 is omitted, id must reference an existing draft attachment id from a prior save/get-draft response. |
name |
Display file name saved with the attachment, such as authorization.pdf. |
base64 |
Base64-encoded file bytes for a new upload. Standard Base64 and data:<media-type>;base64,<payload> URIs are accepted. Invalid, empty, or undecodable content returns 400 with a field error on documents[n] that names the document and the problem. Staging or save failures for that document use the same field key. |
facilityIds |
Client facility ids from the facilities[] array. These map the attachment to one or more photocopy facilities. If empty, the finalized upload is attached to all facilities. |
On draft save, id is persisted as OrderAttachment and as the WebSiteCopyAttachmentEntity.FileName. Incoming base64 is written to the local upload folder and, when PhotocopyToS3 is enabled, also staged to S3 temp ({CompanyCode}/temp/{id}).
Expected Response Schema
Status Codes
| Status | Notes |
|---|---|
200 OK |
Returned by the controller for this operation. |
400 Bad Request |
Validation, invalid request, invalid contact, an attorney or courtCode that does not exist on the tenant, invalid or empty document base64, a document that could not be staged to the upload folder, service/export failure, a value longer than the database allows (errorCode StringLengthExceeded), or an attachment id that does not exist in the temp upload folder. Unknown attorney or court codes return a ProblemDetails errors object keyed by attorney and/or courtCode. Document problems return a ProblemDetails errors object keyed by documents[n] (or documents when the save itself fails) with a message that names the file and the reason. |
404 Not Found |
The referenced photocopy draft (via webOrder) could not be found. Returns a ProblemDetails with errorCode NotFound. |
Success Body
Response type: string
The response body is a JSON string.
Error Body
Validation and not-found failures raised during save return a ProblemDetails with the message in detail and a machine-readable errorCode:
{
"title": "Resource not found.",
"status": 404,
"detail": "Photocopy draft could not be found.",
"errorCode": "NotFound"
}
A value that exceeds a database column length returns 400 instead of 500. The body always names the field in errors and detail:
{
"title": "One or more values exceed the maximum allowed length.",
"status": 400,
"detail": "courtCode is 35 characters long, but the maximum allowed length is 12.",
"errorCode": "StringLengthExceeded",
"errors": {
"courtCode": [
"courtCode is 35 characters long, but the maximum allowed length is 12."
]
},
"entity": "WebSiteCopyOrderEntity",
"fields": [
{
"field": "courtCode",
"currentLength": 35,
"maxLength": 12,
"overflow": 23,
"value": "SAN FRANCISCO COUNTY SUPERIOR COURT"
}
]
}
Draft saves also reject values that exceed documented max lengths (for example courtCode max 12, party/facility state max 2) with the same field-keyed errors object.
When attorney or courtCode is provided, SaveDraft looks them up in the tenant database. Unknown values return 400 and do not create a draft:
{
"title": "One or more validation errors occurred.",
"status": 400,
"errors": {
"attorney": [
"Attorney code 79676 is not valid for customer 'TRISTAR'. Use Attorney.GetAll to list valid attorneys."
],
"courtCode": [
"Court code 'TUOLUMNE' was not found. Use Court.GetAll or Court.Search to list valid court codes."
]
}
}
Response Sample
"W123456"