PhotoCopyOrder.Create

Try it in Swagger

Endpoint

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 Conditional 12 Court code, not the court display name. Required unless noCourt is true. Empty values and NONE are rejected unless noCourt is true. Use Court.Search, Court.GetAll, or Court.Get to retrieve valid court codes.
noCourt bool No When true, the order is saved with court code NONE. Send courtCode as "" or NONE. Do not send a real court code with this flag. Defaults to false.
attorney int? Yes Attorney code from Attorney.GetAll.
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 When true, creates a WinCopy CWorkOrder after saving the photocopy order. Defaults to false.
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.

Required Fields (enforced on Create)

Create validates the following before saving and returns 400 Bad Request with a field-level errors object if any are missing. SaveDraft does not enforce these required fields, so drafts may be partial. When attorney or courtCode is sent on SaveDraft, those values must exist in the tenant database. Both Create and SaveDraft reject values that exceed field max lengths (courtCode max 12, party/facility state max 2) and return the same field-level errors object.

Field Rule
referenceNumber Always required.
attorney Always required. Use a valid attorney code from Attorney.GetAll.
courtCode Required unless noCourt is true. Send a valid court code from Court.Search, Court.GetAll, or Court.Get. Empty values and NONE are rejected unless noCourt is true.
caseNumber Required unless releaseType is 11.
plaintiff Required unless releaseType is 11.
defendant Required unless releaseType is 11.
birthDate Required when releaseType is 11.
injuryDate Required when releaseType is 11, unless the customer is configured to make it optional.
facilities At least one facility is required. Each facility must include a name.

Each facility supports additional record-type booleans: bank, creditCard, accidentReport, stockRecords, phoneRecords, policeReport, inmate, optometry, mentalHealth, and taxRecords. These map to WinCopy RecordsType byte positions via PhotoCopyFacilityRecordTypeEnum. Use phone for the facility contact phone number and phoneRecords for the Phone records checkbox. | documents | At least one document or attachment is required. Each document must include an id or base64 content. New orders (without webOrder) must include at least one document with base64 content. |

Database Constraints (enforced on Create)

After required-field validation, Create checks tenant-database constraints and returns 400 Bad Request with field-level errors when values would fail on save or export. SaveDraft applies the attorney and courtCode existence checks whenever those fields are provided:

Field Rule
attorney Must exist for the order customer and must not be retired. Use Attorney.GetAll.
releaseType Must exist in the tenant database. Use ReleaseType.GetAll.
courtCode When noCourt is false, must exist in the tenant database. When noCourt is true, the order is stored as NONE.
billToAttorney When export is true, billToAttorney (or attorney when omitted) must exist for the resolved bill-to customer. Use BillTo.GetAttorneys.
export When export is true, the resolved bill-to customer must exist in the tenant database.

When export is true, the API creates a WinCopy CWorkOrder. The bill-to attorney used for export is billToAttorney when provided; otherwise attorney is used.

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, or NONE / "" when noCourt is true Send the court code, not the court name/description.
facilities[].recordDates 0, 1, or 2 See Facility Record Dates. Values outside 02 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": true,
  "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. On final create, the service resolves the temp file by id, records the resulting attachment, and deletes the temp file. Customers with PhotocopyToS3 enabled stage incoming base64 to S3 temp ({CompanyCode}/temp/{id}) and store finalized attachments in S3 only; otherwise, the service also writes FTP facility-folder copies. Export writes WinCopy CWorkorderAttachment rows and {workOrder}/Attachments S3 objects.

Expected Response Schema

Status Codes

Status Notes
200 OK Returned by the controller for this operation.
400 Bad Request Missing required fields or a value longer than the database allows (returns a field-level errors object), invalid request, invalid contact, invalid or empty document base64, a document that could not be staged to the upload folder, service/export failure, or an attachment id that does not exist in the temp upload folder. Document problems return errors 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.

Validation Error Body

When required fields are missing, the response is a standard ValidationProblemDetails that lists each offending field:

{
  "type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": {
    "attorney": ["attorney is required."],
    "caseNumber": ["caseNumber is required unless releaseType is 11."],
    "facilities": ["At least one facility is required."]
  }
}

For validation and not-found failures raised during save (for example a missing attachment file or an unknown draft), the response is a ProblemDetails with the message in detail and a machine-readable errorCode:

{
  "title": "Validation failed.",
  "status": 400,
  "detail": "File 'a1b2c3' does not exist in the temp upload folder.",
  "errorCode": "ValidationError"
}

Success Body

Response type: string when export is false. When export is true, the response is an object with the saved web order id and generated WinCopy work order id.

See the Order Lifecycle guide for how draft web order ids become exported work order ids.

Response Sample

"W123456"

Export Response Sample

{
  "webOrderId": "W123456",
  "workOrderId": "C123456",
  "generatedWorkOrders": [
    {
      "workOrder": "C123456",
      "servee": null
    }
  ]
}

Retrieving Facilities After Export

A photocopy order is one work order with one or more facilities. Export returns a single workOrderId (for example C123456); it does not return the per-facility list. The response never contains multiple work order numbers.

To get the facilities for an exported order, call GET PhotoCopyOrder/GetExisting/{workOrder} with the workOrderId from the export response. The facilities array in that response lists each facility on the order.

Each facility is addressed as {workOrder}-{facilityId} (for example C123456-01, C123456-02), where the suffix is the facility's pseudo-facility number. Use that combined form when an endpoint targets a specific facility, such as POST Notes/Add (or send facilityLineItem on that endpoint) or GET PhotoCopyOrder/GetExisting/{workOrder}-{facilityId} to scope status updates to one facility.