> ## Documentation Index > Fetch the complete documentation index at: https://developers.cmicglobal.com/llms.txt > Use this file to discover all available pages before exploring further. # Create Purchase Change Order > # PO Change Order — Create from Purchase Order ## Overview Creates a new change order header from its parent purchase order and automatically generates all of its summary lines. The caller only identifies which purchase order and release to base the change order on — the change order number, every header value, and the summary lines are all generated automatically. ## Notes - The whole operation — release validation, header build, line population — runs inside a single transaction. If any step fails the transaction is rolled back and nothing is persisted. - `header.pocohNum` is ignored if supplied by the client (a warning is logged) — the change order number is always generated by the database from the PO/release. - Database routines invoked (no business logic reimplemented in Java): - `da.dbk_po_comst.validate_rel_num` — rejects if an open CO already exists for the release (`PO-000033-ERR`), or the PO is not in an eligible status for a Change Order at that release (`PO-000179-ERR`, requires status `O`/`A`, or `C` with default receiving code `A`). - `da.dbk_po_comst.create_co_from_po` — generates the CO number and copies the header from the PO. - `da.dbk_po_comst.populate_co_details` — generates the summary lines. - The header's virtual UUID (`pocohVUuid`) is generated on the Java side via `sys_guid()` (`Utility.generateVuuid`), available before the row is even posted. - On success, the response is built by re-reading the created change order the same way as `GET /{vuuid}` — header from `PO_COMAST_API_V`, lines from `PO_COSUMMARY_API_V`. ## UI Navigation Asset Management → Purchase Order → Change Orders → Enter Change Order ## Finders Not applicable — this is a create operation. ## HTTP Method & Endpoint ``` POST {base_url}/po-rest-api/jersey/v1/po-change-order Content-Type: application/json ``` ## Path Parameters None. ## Query Parameters None. ## Example Request ``` curl -X POST "{base_url}/po-rest-api/jersey/v1/po-change-order" \ -H "Authorization: Basic {credentials}" \ -H "Content-Type: application/json" \ -d '{ "header": { "pocohCompCode": "ALT", "pocohPoNum": "PO000004", "pocohReleaseNum": 1 } }' ``` ## Example Response (201 Created) ``` json { "header": { "pocohVUuid": "57583E9AF08A542CE0630B811DACCB66", "pocohCompCode": "ALT", "pocohPoNum": "PO000004", "pocohNum": "2", "pocohReleaseNum": 1, "pocohStatCode": "O" }, "lines": [ { "pocsVUuid": "...", "pocsLineNum": 1, "pocsItmCode": "PAPER-A4" } ] } ``` ## Attributes ### Request body — `header` object | Name | Description | Type | Required | Notes | | --- | --- | --- | --- | --- | | pocohCompCode | Company code of the parent PO | String(8) | True | Uppercased before use | | pocohPoNum | Parent Purchase Order number | String(11) | True | Uppercased before use | | pocohReleaseNum | PO release number the change order is created against | Number(11) | True | Must resolve via `validate_rel_num` | | pocohNum | Change order number | String(11) | Ignored if supplied | Always generated by `create_co_from_po`; a client-supplied value is logged and discarded | No other header fields are read from the request body on create — every other attribute on the response `header` is copied from the parent PO by `create_co_from_po`. ### Response body — `header` object | Name | Object | Description | Type | Data Length | Example | Mandatory | | --- | --- | --- | --- | --- | --- | --- | | pocohVUuid | header | Virtual UUID, unique row identifier | String | 64 | 57583E9AF08A542CE0630B811DACCB66 | System Generated | | pocohCompCode | header | Company code | String | 8 | ALT | Key | | pocohCompName | header | Company name (lookup) | String | 30 | ALT Company | System Generated | | pocohPoNum | header | Parent Purchase Order number | String | 11 | PO000004 | Key | | pocohNum | header | Change order number | String | 11 | 1 | Key | | pocohBchNum | header | Posting batch number | Number(11) | 11 | 42 | System Assigned | | pocohVenCode | header | Vendor code | String | 8 | V0001 | False | | pocohVenName | header | Vendor name (lookup) | String | 50 | ACME Supplies | System Generated | | pocohDeptCode | header | Department code | String | 6 | ADMIN | False | | pocohDeptName | header | Department name (lookup) | String | 30 | Administration | System Generated | | pocohExptdDate | header | Expected date | Date | — | 2026-09-01 | False | | pocohOrdDate | header | Order date | Date | — | 2026-08-20 | False | | pocohRecDate | header | Receipt date | Date | — | 2026-09-05 | False | | pocohTypeCode | header | Change order type code | String | 1 | S | False | | pocohAdjCode | header | Adjustment code | String | 1 | A | False | | pocohStatCode | header | Status code | String | 1 | O | System Assigned | | pocohChgCode | header | Change code | String | 1 | C | False | | pocohTermCode | header | Payment terms code | String | 6 | NET30 | False | | pocohTermName | header | Payment terms name (lookup) | String | 30 | Net 30 Days | System Generated | | pocohInvCode | header | Invoice code | String | 20 | INV001 | False | | pocohInvDate | header | Invoice date | Date | — | 2026-09-10 | False | | pocohInvDueDate | header | Invoice due date | Date | — | 2026-10-10 | False | | pocohInvDiscDate | header | Invoice discount date | Date | — | 2026-09-20 | False | | pocohInvDiscAmt | header | Invoice discount amount | Number(18,2) | 18,2 | 25.00 | False | | pocohCurrCode | header | Currency code | String | 3 | USD | False | | pocohCurrName | header | Currency name (lookup) | String | 30 | US Dollar | System Generated | | pocohFobCode | header | FOB code | String | 2 | FO | False | | pocohBuyCode | header | Buyer code | String | 30 | BUYER01 | False | | pocohAddCode | header | Ship-to address code | String | 8 | ADDR01 | False | | pocohShplneCode | header | Shipping line code | String | 3 | UPS | False | | pocohShpmetCode | header | Shipping method code | String | 5 | GRND | False | | pocohTxt1Code | header | Text code 1 | String | 8 | TXT01 | False | | pocohTxt2Code | header | Text code 2 | String | 8 | TXT02 | False | | pocohShpinstDesc | header | Shipping instructions | String | 2000 | Deliver to loading dock | False | | pocohDesc1 | header | Description line 1 | String | 2000 | Revised material order | False | | pocohDesc2 | header | Description line 2 | String | 2000 | Adds 2 items | False | | pocohAdjPrice | header | Adjusted price total | Number(18,4) | 18,4 | 1250.0000 | False | | pocohUnadjPrice | header | Unadjusted price total | Number(18,4) | 18,4 | 1200.0000 | False | | pocohCurrConvNum | header | Currency conversion rate | Number(16,8) | 16,8 | 1.00000000 | False | | pocohCostedCode | header | Costed flag | String | 1 | Y | False | | pocohRefNum | header | Reference number | String | 11 | REF001 | False | | pocohRefDate | header | Reference date | Date | — | 2026-08-15 | False | | pocohReqCode | header | Requisition code | String | 30 | RQ000003 | False | | pocohRecCode | header | Receiving code | String | 30 | REC001 | False | | pocohReprintDate | header | Reprint date | Date | — | 2026-08-22 | False | | pocohWipAccCode | header | WIP account code | String | 16 | WIP-01 | False | | pocohWipAccName | header | WIP account name (lookup) | String | 30 | Work In Progress 01 | System Generated | | pocohWipDeptCode | header | WIP department code | String | 6 | WIPD01 | False | | pocohWipDeptName | header | WIP department name (lookup) | String | 30 | WIP Department 01 | System Generated | | pocohShipinstTxt1Code..5Code | header | Shipping instruction text codes 1-5 | String | 8 each | TXT01 | False | | pocohReleaseNum | header | PO release number this change order belongs to | Number(11) | 11 | 1 | Key | | pocohBilltoAddCode | header | Bill-to address code | String | 8 | BILL01 | False | | pocohReqReason | header | Requisition reason | String | 255 | Scope change | False | | pocohInvTypeCode | header | Invoice type code | String | 1 | S | False | | pocohImageFilename | header | Attached image filename | String | 255 | co_scan.pdf | False | | pocohInvSerCode | header | Invoice series code | String | 4 | 2026 | False | | pocohVendOrderAddCode | header | Vendor order address code | String | 5 | VOA01 | False | | pocohComplianceFlag | header | Compliance flag (Y/N) | String | 1 | Y | False | | pocohJobCompCode | header | Job company code | String | 8 | ALT | False | | pocohJobCompName | header | Job company name (lookup) | String | 30 | ALT Company | System Generated | | pocohJobCode | header | Job code | String | 10 | JOB001 | False | | pocohJobName | header | Job name (lookup) | String | 60 | Office Renovation | System Generated | | pocohContactCode | header | Contact code | String | 10 | CONT01 | False | | pocohAddCompCode | header | Ship-to address company code | String | 8 | ALT | False | | pocohAddCompName | header | Ship-to address company name (lookup) | String | 30 | ALT Company | System Generated | | pocohPrintDate | header | Print date | Date | — | 2026-08-21 | False | | pocohDefaultRecCode | header | Default receiving code | String | 1 | A | False | | pocohDate | header | Change order date | Date | — | 2026-08-20 | False | | pocohPoTotal | header | Total PO amount (calculated) | Number | — | 12500.00 | System Generated | | pocohIuCreateDate | header | Record creation timestamp (ISO-8601) | Timestamp | — | 2026-08-20T10:15:00-04:00 | System Generated | | pocohIuCreateUser | header | User who created the record | String | 30 | DA | System Generated | | pocohIuUpdateDate | header | Record last update timestamp (ISO-8601) | Timestamp | — | 2026-08-21T09:00:00-04:00 | System Generated | | pocohIuUpdateUser | header | User who last updated the record | String | 30 | DA | System Generated | | pocohAcctDescription | header | Account description (lookup) | String | 500 | General WIP Account | System Generated | | pocohDiscountPct | header | Discount percentage | Number(16,3) | 16,3 | 2.500 | False | | pocohAddName | header | Ship-to address name (lookup) | String | 195 | Main Warehouse | System Generated | ### Response body — `lines[]` items | Name | Object | Description | Type | Data Length | Example | Mandatory | | --- | --- | --- | --- | --- | --- | --- | | pocsVUuid | line | Virtual UUID, unique row identifier | String | 64 | 57583E9AF08B542CE0630B811DACCB66 | System Generated | | pocsCompCode | line | Company code | String | 8 | ALT | Key | | pocsPoNum | line | Parent PO number | String | 11 | PO000004 | Key | | pocsNum | line | Change order number | String | 11 | 1 | Key | | pocsReleaseNum | line | Release number | Number(11) | 11 | 1 | Key | | pocsLineNum | line | Summary line number | Number(6) | 6 | 1 | Key | | pocsCiitemtypCode | line | item type code | String | 2 | MA | False | | pocsClassCode | line | Item class code | String | 4 | OFF1 | False | | pocsDesc | line | Line description | String | 4000 | Revised paper order | False | | pocsDiscountPct | line | Discount percentage | Number | — | 2.500 | False | | pocsExptdPriceAmt | line | Expected unit price | Number | — | 12.5000 | False | | pocsExtdAmt | line | Extended amount (calculated) | Number | — | 1250.00 | System Generated | | pocsItemLocCode | line | Item location code | String | 7 | ILOC01 | False | | pocsItmCode | line | Item/product code | String | 16 | PAPER-A4 | False | | pocsItmName | line | Item/product name (lookup) | String | 4000 | A4 Copy Paper | System Generated | | pocsJobName | line | Job name (lookup) | String | 60 | Office Renovation | System Generated | | pocsPhsName | line | Phase name (lookup) | String | 50 | Phase 1 | System Generated | | pocsCatName | line | Category name (lookup) | String | 30 | Supplies | System Generated | | pocsLumpSumPoFlag | line | Lump-sum PO flag (Y/N, calculated) | String | 1 | N | System Generated | | pocsOrdQty | line | Quantity ordered | Number | — | 100.0000 | False | | pocsOvrdExptdPriceFlag | line | Override expected price flag (Y/N) | String | 1 | Y | False | | pocsPoItemType | line | PO item type (I=Inventory, N=Non-stock, F=Free-form) | String | 1 | N | False | | pocsPoOrdQty | line | PO ordered quantity (calculated) | Number | — | 80.0000 | System Generated | | pocsPoOrderedQty | line | PO ordered quantity, alt calculation (calculated) | Number | — | 80.0000 | System Generated | | pocsPoPriceAmt | line | PO price amount (calculated) | Number | — | 12.5000 | System Generated | | pocsPobldLineNum | line | Source PO build line number (calculated) | Number(6) | 6 | 1 | System Generated | | pocsRecIntoInvFlag | line | Receive into inventory flag (Y/N) | String | 1 | Y | False | | pocsSuggestedPrice | line | Suggested price (calculated) | Number | — | 12.5000 | System Generated | | pocsTax1Code / Tax2Code / Tax3Code | line | Tax codes 1-3 | String | 11 each | HST | False | | pocsTax1TaxableFlag / Tax2.../Tax3... | line | Taxable flags for tax 1-3 (Y/N) | String | 1 each | Y | False | | pocsTaxAmt | line | Tax amount (calculated) | Number | — | 150.00 | System Generated | | pocsTotAmt | line | Total amount (calculated) | Number | — | 1400.00 | System Generated | | pocsUserField1..8 | line | User-defined fields 1-8 | String | 60 each | — | False | | pocsUserTypeCode | line | User-defined type code | String | 3 | STD | False | | pocsWmCode | line | Unit of measure code | String | 2 | BX | False | | pocsTavCode1..4 | line | TAV codes 1-4 | String | 10 each | TAV01 | False | | pocsWbsvCode1..8 | line | WBS value codes 1-8 (always disabled in CMiC UI) | String | 60 each | — | System Generated | | pocsWbsvCode9..12 | line | WBS value codes 9-12 | String | 60 each | — | False | | pocsIuCreateDate | line | Record creation timestamp (ISO-8601) | Timestamp | — | 2026-08-20T10:15:00-04:00 | System Generated | | pocsIuUpdateDate | line | Record last update timestamp (ISO-8601) | Timestamp | — | 2026-08-21T09:00:00-04:00 | System Generated | ## Error Codes | HTTP | Error Code | Reason | | --- | --- | --- | | 400 | PO-000272-ERR | Request body is required | | 400 | PO-000264-ERR | `header` object is required in the request payload | | 400 | PO-000273-ERR | `header.pocohCompCode` is required | | 400 | PO-000274-ERR | `header.pocohPoNum` is required | | 400 | PO-000275-ERR | `header.pocohReleaseNum` is required | | 500 | PO-000033-ERR | An open Change Order already exists for this company/PO/release (`validate_rel_num`) | | 500 | PO-000179-ERR | The PO is not in an eligible status for a Change Order at that release (`validate_rel_num`) | | 500 | PO-000221-ERR | The change order could not be re-read immediately after creation (should not occur under normal operation) | | 500 | (unhandled exception) | Any other unexpected error; the transaction is rolled back | ## OpenAPI ````json POST /po-rest-api/jersey/v1/po-change-order { "openapi": "3.0.0", "info": { "title": "API Catalog", "description": "", "version": "1.0.0" }, "servers": [ { "url": "https://mobtest.cmiccloudr12.com/cmictestrti", "description": "CMIC API Server" } ], "security": [ { "cmicBasicAuth": [] } ], "tags": [ { "name": "Highlights" }, { "name": "Asset Management | Equipment" }, { "name": "Asset Management | Fixed Assets" }, { "name": "Asset Management | Purchase Order" }, { "name": "Asset Management | Inventory" }, { "name": "Asset Management | Requisition" }, { "name": "Asset Management | Purchase Change Order" }, { "name": "Bim Model" }, { "name": "Bim Model Revision" }, { "name": "Bim Tag Model" }, { "name": "Bim Tags" }, { "name": "Bim FileUpload Jersey" }, { "name": "Core System | Business Partners" }, { "name": "Core System | Business Partner Addresses" }, { "name": "Core System | Bank" }, { "name": "Core System | Currency" }, { "name": "Core System | Exchange Rates" }, { "name": "Core System | Global Table Text Codes" }, { "name": "Core System | Global Table Regions" }, { "name": "Core System | Terms" }, { "name": "Core System | System Contact" }, { "name": "Core System | Weight Measures" }, { "name": "Core System | Field User Defined Classifiers" }, { "name": "Core System | User Defined Classifiers by Object" }, { "name": "Core System | User Extension Definitions by Object" }, { "name": "Core System | User Extention Field Data Value" }, { "name": "Core System | User Extension Values by Object" }, { "name": "Core System | User System Role" }, { "name": "Core System | User Project Role" }, { "name": "Core System | Documents by Object" }, { "name": "Core System | Audit Status Log by Object" }, { "name": "Core System | Licensed Users" }, { "name": "Core System | Company Access" }, { "name": "Core System | Copy User Settings" }, { "name": "Core System | User Maintenance" }, { "name": "Core System | User Roles" }, { "name": "Core System | Security Groups" }, { "name": "Core System | Job/Project Security" }, { "name": "Core System | Weight Measure with Conversions Code" }, { "name": "Core System | Weight Measure Conversions Code" }, { "name": "Core System | User-defined-fields" }, { "name": "Core System | User-extension" }, { "name": "ECM and Workflow | Image Manager" }, { "name": "Financials | General Ledger" }, { "name": "Financials | Accounts Payable" }, { "name": "Financials | Accounts Receivable" }, { "name": "Preventative Maintenance | Issue Work Orders" }, { "name": "Preventative Maintenance | Issue Work Items" }, { "name": "Preventative Maintenance | Issue Work Budgets" }, { "name": "Preventative Maintenance | Issue Priorities" }, { "name": "Preventative Maintenance | Issue Status" }, { "name": "Preventative Maintenance | Issue Types" }, { "name": "Preventative Maintenance | Accumulative Equipment" }, { "name": "Preventative Maintenance | Work Orders" }, { "name": "Preventative Maintenance | Work Items" }, { "name": "Preventative Maintenance | Work Budgets" }, { "name": "Preventative Maintenance | Priorities" }, { "name": "Preventative Maintenance | Tasks" }, { "name": "HCM | UKG Pay Deductions" }, { "name": "HCM | UKG Pay Earnings" }, { "name": "HCM | UKG Pay Headers" }, { "name": "HCM | UKG Pay Taxes" }, { "name": "HCM | Payroll Geographical States" }, { "name": "HCM | Payroll Trades" }, { "name": "HCM | Payroll Union" }, { "name": "HCM | Payroll Pay Runs" }, { "name": "HCM | Payroll Pay Groups" }, { "name": "HCM | Payroll Tax" }, { "name": "HCM | Payroll Worker Compensation" }, { "name": "HCM | Payroll Work Locations" }, { "name": "HCM | Payroll Trade Pay Rates" }, { "name": "HCM | Payroll Union Pay Rates" }, { "name": "HCM | Payroll Job Pay Rates" }, { "name": "HCM | Payroll Master Benefits" }, { "name": "HCM | Payroll Master Deductions" }, { "name": "HCM | Payroll Ben/Ded/Leave Base Codes" }, { "name": "HCM | Payroll Ben/Ded Plans" }, { "name": "HCM | Payroll Ben/Ded Plan Options" }, { "name": "HCM | Payroll Company Benefits" }, { "name": "HCM | Payroll Company Deductions" }, { "name": "HCM | Payroll Vertex Geographic Locations" }, { "name": "HCM | Payroll Checks" }, { "name": "HCM | Payroll Timesheets" }, { "name": "HCM | Employee" }, { "name": "HCM | Employee (Minimum payload)" }, { "name": "HCM | Employee History" }, { "name": "HCM | Tax Exemptions" }, { "name": "HCM | Employee Tax Overrides" }, { "name": "HCM | Employee Pay Splits" }, { "name": "HCM | Employee Benefits" }, { "name": "HCM | Employee Clock In and Out" }, { "name": "HCM | Employee Deductions" }, { "name": "HCM | Employee Leaves" }, { "name": "HCM | Employee Leave History" }, { "name": "HCM | Employee Hour Types" }, { "name": "HCM | Employee Pay History" }, { "name": "HCM | Employee Work Statuses" }, { "name": "HCM | Employee Security Group" }, { "name": "HCM | Crewtime Crew" }, { "name": "HCM | Crewtime Employee Timesheet" }, { "name": "HCM | Crewtime Equipment Timesheet" }, { "name": "HCM | Crew Maintenance Activity Assignment" }, { "name": "HCM | Crew Maintenance Member Assignment" }, { "name": "HCM | Crew Maintenance Member Trade and Union Assignment" }, { "name": "HCM | Crew Maintenance Equipment Assignment" }, { "name": "HCM | Crew Maintenance Equipment Detail Assignment" }, { "name": "HCM | HR Requisitions" }, { "name": "HCM | HR Relations" }, { "name": "HCM | HR Employee Skills" }, { "name": "HCM | HR Incident" }, { "name": "HCM | HR Employee Relatives / Dependents" }, { "name": "HCM | HR Employee Positions" }, { "name": "HCM | HR Applicants" }, { "name": "HCM | HR Applications" }, { "name": "HCM | Vertex Location City" }, { "name": "HCM | HR Application History" }, { "name": "HCM | HR Dependent Benefits" }, { "name": "HCM | HR Dependent Deductions" }, { "name": "HCM | HR Employee Elected Plans" }, { "name": "HCM | HR Employee Training Certifications" }, { "name": "HCM | HR Trainings" }, { "name": "HCM | E-Timesheets" }, { "name": "HCM | System Contacts" }, { "name": "HCM | System User Payroll Security Group" }, { "name": "HCM | Payroll Timesheet Posting" }, { "name": "HCM | CrewTimesheet Posting" }, { "name": "HCM | HR Positions Master" }, { "name": "HCM | Payroll Pay Periods" }, { "name": "HCM | Payroll Rate Codes" }, { "name": "HCM | Payroll Overhead Codes and Rates" }, { "name": "HCM | Payroll Assigned Overhead to Jobs" }, { "name": "Materials Management | Material Sale Orders" }, { "name": "Materials Management | Material Sale Orders Details" }, { "name": "Materials Management | Truck Rate Detail" }, { "name": "Opportunity Management | Competitors" }, { "name": "Opportunity Management | Opportunities" }, { "name": "Opportunity Management | Revenue Details" }, { "name": "Opportunity Management | Opportunity History" }, { "name": "Opportunity Management | Organization" }, { "name": "Project Controls | Job Billing" }, { "name": "Project Controls | Job Cost" }, { "name": "Project Controls | PCI Details" }, { "name": "Project Controls | Unposted PCI Details" }, { "name": "Project Controls | PCI Headers" }, { "name": "Project Controls | Owner Change Orders" }, { "name": "Project Controls | CM Statuses" }, { "name": "Project Controls | CM Types" }, { "name": "Project Controls | CM Vendor Details" }, { "name": "Project Controls | Post PCI" }, { "name": "Project Management | Uploading Documents" }, { "name": "Project Management | Downloading Documents" }, { "name": "Project Management | Foreign Bid Item Imports" }, { "name": "Project Management | Communications" }, { "name": "Project Management | Daily Journals" }, { "name": "Project Management | Communications Types" }, { "name": "Project Management | Daily Journal Daily Work Plans" }, { "name": "Project Management | Daily Journal Field Forces" }, { "name": "Project Management | Daily Journal Labour" }, { "name": "Project Management | Daily Journal Materials" }, { "name": "Project Management | Daily Journal Owner Equipment" }, { "name": "Project Management | Daily Journal Quality Control" }, { "name": "Project Management | Daily Journal Tasks" }, { "name": "Project Management | Daily Journal Trade Equipment" }, { "name": "Project Management | Daily Journal Transactions" }, { "name": "Project Management | Daily Journal User Defined Data" }, { "name": "Project Management | Daily Journal Visitors" }, { "name": "Project Management | Daily Journal Bill Details" }, { "name": "Project Management | Field Work Directives" }, { "name": "Project Management | Contract Types" }, { "name": "Project Management | Company Contacts" }, { "name": "Project Management | Distribution BCC" }, { "name": "Project Management | Distribution CC" }, { "name": "Project Management | Field Work Directive Statuses" }, { "name": "Project Management | Issues" }, { "name": "Project Management | Key Players" }, { "name": "Project Management | Meetings" }, { "name": "Project Management | Meeting Attendees" }, { "name": "Project Management | Meeting Item Statuses" }, { "name": "Project Management | Meeting Tracks" }, { "name": "Project Management | Notes" }, { "name": "Project Management | Projects" }, { "name": "Project Management | Project Items" }, { "name": "Project Management | Project Item Phase Segment Sums" }, { "name": "Project Management | Project Partners" }, { "name": "Project Management | Notices" }, { "name": "Project Management | Notice Statuses" }, { "name": "Project Management | Owner JS Query" }, { "name": "Project Management | PCI Real Locations" }, { "name": "Project Management | Project Contacts" }, { "name": "Project Management | RFIs (Requests for Information)" }, { "name": "Project Management | RFI Statuses" }, { "name": "Project Management | Submittal Packages" }, { "name": "Project Management | Submittal Package Details" }, { "name": "Project Management | Submittal Package Status" }, { "name": "Project Management | Submittals" }, { "name": "Project Management | Submittal Status" }, { "name": "Project Management | Transmittals" }, { "name": "Project Management | Subcontract Headers" }, { "name": "Project Management | Subcontract Schedules" }, { "name": "Project Management | Subcontract Sechedule Phase Segment Sums" }, { "name": "Project Management | User Roles" }, { "name": "Project Management | Punchlists" }, { "name": "Project Management | Punchlist Details" }, { "name": "Project Management | Punchlist Statuses" }, { "name": "Project Management | Meeting Items" }, { "name": "Project Management | Self Perform Vendor" }, { "name": "Project Management | Submittal Types" }, { "name": "Project Management | Assign contact and partner to project" }, { "name": "Project Management | Subcontract Prequal" }, { "name": "Project Management | Bid Item Package" } ], "paths": { "/po-rest-api/jersey/v1/po-change-order": { "post": { "tags": [ "Asset Management | Purchase Change Order" ], "summary": "Create Purchase Change Order", "description": "# PO Change Order — Create from Purchase Order\n\n## Overview\n\nCreates a new change order header from its parent purchase order and automatically generates \nall of its summary lines. The caller only identifies which purchase order and release to base \nthe change order on — the change order number, every header value, and the summary lines are \nall generated automatically.\n\n## Notes\n\n- The whole operation — release validation, header build, line population — runs inside a \n single transaction. If any step fails the transaction is rolled back and nothing is \n persisted.\n \n- `header.pocohNum` is ignored if supplied by the client (a warning is logged) — the change \n order number is always generated by the database from the PO/release.\n \n- Database routines invoked (no business logic reimplemented in Java):\n \n - `da.dbk_po_comst.validate_rel_num` — rejects if an open CO already exists for the release \n (`PO-000033-ERR`), or the PO is not in an eligible status for a Change Order at that release \n (`PO-000179-ERR`, requires status `O`/`A`, or `C` with default receiving code `A`).\n \n - `da.dbk_po_comst.create_co_from_po` — generates the CO number and copies the header from \n the PO.\n \n - `da.dbk_po_comst.populate_co_details` — generates the summary lines.\n \n- The header's virtual UUID (`pocohVUuid`) is generated on the Java side via `sys_guid()` \n (`Utility.generateVuuid`), available before the row is even posted.\n \n- On success, the response is built by re-reading the created change order the same way as \n `GET /{vuuid}` — header from `PO_COMAST_API_V`, lines from `PO_COSUMMARY_API_V`.\n \n\n## UI Navigation\n\nAsset Management → Purchase Order → Change Orders → Enter Change Order\n\n## Finders\n\nNot applicable — this is a create operation.\n\n## HTTP Method & Endpoint\n\n```\nPOST {base_url}/po-rest-api/jersey/v1/po-change-order\nContent-Type: application/json\n\n ```\n\n## Path Parameters\n\nNone.\n\n## Query Parameters\n\nNone.\n\n## Example Request\n\n```\ncurl -X POST \"{base_url}/po-rest-api/jersey/v1/po-change-order\" \\\n -H \"Authorization: Basic {credentials}\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"header\": {\n \"pocohCompCode\": \"ALT\",\n \"pocohPoNum\": \"PO000004\",\n \"pocohReleaseNum\": 1\n }\n }'\n\n ```\n\n## Example Response (201 Created)\n\n``` json\n{\n \"header\": {\n \"pocohVUuid\": \"57583E9AF08A542CE0630B811DACCB66\",\n \"pocohCompCode\": \"ALT\",\n \"pocohPoNum\": \"PO000004\",\n \"pocohNum\": \"2\",\n \"pocohReleaseNum\": 1,\n \"pocohStatCode\": \"O\"\n },\n \"lines\": [\n { \"pocsVUuid\": \"...\", \"pocsLineNum\": 1, \"pocsItmCode\": \"PAPER-A4\" }\n ]\n}\n\n ```\n\n## Attributes\n\n### Request body — `header` object\n\n| Name | Description | Type | Required | Notes |\n| --- | --- | --- | --- | --- |\n| pocohCompCode | Company code of the parent PO | String(8) | True | Uppercased before use |\n| pocohPoNum | Parent Purchase Order number | String(11) | True | Uppercased before use |\n| pocohReleaseNum | PO release number the change order is created against | Number(11) | True | Must resolve via `validate_rel_num` |\n| pocohNum | Change order number | String(11) | Ignored if supplied | Always generated by `create_co_from_po`; a client-supplied value is logged and discarded |\n\nNo other header fields are read from the request body on create — every other attribute on the \nresponse `header` is copied from the parent PO by `create_co_from_po`.\n\n### Response body — `header` object\n\n| Name | Object | Description | Type | Data Length | Example | Mandatory |\n| --- | --- | --- | --- | --- | --- | --- |\n| pocohVUuid | header | Virtual UUID, unique row identifier | String | 64 | 57583E9AF08A542CE0630B811DACCB66 | System Generated |\n| pocohCompCode | header | Company code | String | 8 | ALT | Key |\n| pocohCompName | header | Company name (lookup) | String | 30 | ALT Company | System Generated |\n| pocohPoNum | header | Parent Purchase Order number | String | 11 | PO000004 | Key |\n| pocohNum | header | Change order number | String | 11 | 1 | Key |\n| pocohBchNum | header | Posting batch number | Number(11) | 11 | 42 | System Assigned |\n| pocohVenCode | header | Vendor code | String | 8 | V0001 | False |\n| pocohVenName | header | Vendor name (lookup) | String | 50 | ACME Supplies | System Generated |\n| pocohDeptCode | header | Department code | String | 6 | ADMIN | False |\n| pocohDeptName | header | Department name (lookup) | String | 30 | Administration | System Generated |\n| pocohExptdDate | header | Expected date | Date | — | 2026-09-01 | False |\n| pocohOrdDate | header | Order date | Date | — | 2026-08-20 | False |\n| pocohRecDate | header | Receipt date | Date | — | 2026-09-05 | False |\n| pocohTypeCode | header | Change order type code | String | 1 | S | False |\n| pocohAdjCode | header | Adjustment code | String | 1 | A | False |\n| pocohStatCode | header | Status code | String | 1 | O | System Assigned |\n| pocohChgCode | header | Change code | String | 1 | C | False |\n| pocohTermCode | header | Payment terms code | String | 6 | NET30 | False |\n| pocohTermName | header | Payment terms name (lookup) | String | 30 | Net 30 Days | System Generated |\n| pocohInvCode | header | Invoice code | String | 20 | INV001 | False |\n| pocohInvDate | header | Invoice date | Date | — | 2026-09-10 | False |\n| pocohInvDueDate | header | Invoice due date | Date | — | 2026-10-10 | False |\n| pocohInvDiscDate | header | Invoice discount date | Date | — | 2026-09-20 | False |\n| pocohInvDiscAmt | header | Invoice discount amount | Number(18,2) | 18,2 | 25.00 | False |\n| pocohCurrCode | header | Currency code | String | 3 | USD | False |\n| pocohCurrName | header | Currency name (lookup) | String | 30 | US Dollar | System Generated |\n| pocohFobCode | header | FOB code | String | 2 | FO | False |\n| pocohBuyCode | header | Buyer code | String | 30 | BUYER01 | False |\n| pocohAddCode | header | Ship-to address code | String | 8 | ADDR01 | False |\n| pocohShplneCode | header | Shipping line code | String | 3 | UPS | False |\n| pocohShpmetCode | header | Shipping method code | String | 5 | GRND | False |\n| pocohTxt1Code | header | Text code 1 | String | 8 | TXT01 | False |\n| pocohTxt2Code | header | Text code 2 | String | 8 | TXT02 | False |\n| pocohShpinstDesc | header | Shipping instructions | String | 2000 | Deliver to loading dock | False |\n| pocohDesc1 | header | Description line 1 | String | 2000 | Revised material order | False |\n| pocohDesc2 | header | Description line 2 | String | 2000 | Adds 2 items | False |\n| pocohAdjPrice | header | Adjusted price total | Number(18,4) | 18,4 | 1250.0000 | False |\n| pocohUnadjPrice | header | Unadjusted price total | Number(18,4) | 18,4 | 1200.0000 | False |\n| pocohCurrConvNum | header | Currency conversion rate | Number(16,8) | 16,8 | 1.00000000 | False |\n| pocohCostedCode | header | Costed flag | String | 1 | Y | False |\n| pocohRefNum | header | Reference number | String | 11 | REF001 | False |\n| pocohRefDate | header | Reference date | Date | — | 2026-08-15 | False |\n| pocohReqCode | header | Requisition code | String | 30 | RQ000003 | False |\n| pocohRecCode | header | Receiving code | String | 30 | REC001 | False |\n| pocohReprintDate | header | Reprint date | Date | — | 2026-08-22 | False |\n| pocohWipAccCode | header | WIP account code | String | 16 | WIP-01 | False |\n| pocohWipAccName | header | WIP account name (lookup) | String | 30 | Work In Progress 01 | System Generated |\n| pocohWipDeptCode | header | WIP department code | String | 6 | WIPD01 | False |\n| pocohWipDeptName | header | WIP department name (lookup) | String | 30 | WIP Department 01 | System Generated |\n| pocohShipinstTxt1Code..5Code | header | Shipping instruction text codes 1-5 | String | 8 each | TXT01 | False |\n| pocohReleaseNum | header | PO release number this change order belongs to | Number(11) | 11 | 1 | Key |\n| pocohBilltoAddCode | header | Bill-to address code | String | 8 | BILL01 | False |\n| pocohReqReason | header | Requisition reason | String | 255 | Scope change | False |\n| pocohInvTypeCode | header | Invoice type code | String | 1 | S | False |\n| pocohImageFilename | header | Attached image filename | String | 255 | co_scan.pdf | False |\n| pocohInvSerCode | header | Invoice series code | String | 4 | 2026 | False |\n| pocohVendOrderAddCode | header | Vendor order address code | String | 5 | VOA01 | False |\n| pocohComplianceFlag | header | Compliance flag (Y/N) | String | 1 | Y | False |\n| pocohJobCompCode | header | Job company code | String | 8 | ALT | False |\n| pocohJobCompName | header | Job company name (lookup) | String | 30 | ALT Company | System Generated |\n| pocohJobCode | header | Job code | String | 10 | JOB001 | False |\n| pocohJobName | header | Job name (lookup) | String | 60 | Office Renovation | System Generated |\n| pocohContactCode | header | Contact code | String | 10 | CONT01 | False |\n| pocohAddCompCode | header | Ship-to address company code | String | 8 | ALT | False |\n| pocohAddCompName | header | Ship-to address company name (lookup) | String | 30 | ALT Company | System Generated |\n| pocohPrintDate | header | Print date | Date | — | 2026-08-21 | False |\n| pocohDefaultRecCode | header | Default receiving code | String | 1 | A | False |\n| pocohDate | header | Change order date | Date | — | 2026-08-20 | False |\n| pocohPoTotal | header | Total PO amount (calculated) | Number | — | 12500.00 | System Generated |\n| pocohIuCreateDate | header | Record creation timestamp (ISO-8601) | Timestamp | — | 2026-08-20T10:15:00-04:00 | System Generated |\n| pocohIuCreateUser | header | User who created the record | String | 30 | DA | System Generated |\n| pocohIuUpdateDate | header | Record last update timestamp (ISO-8601) | Timestamp | — | 2026-08-21T09:00:00-04:00 | System Generated |\n| pocohIuUpdateUser | header | User who last updated the record | String | 30 | DA | System Generated |\n| pocohAcctDescription | header | Account description (lookup) | String | 500 | General WIP Account | System Generated |\n| pocohDiscountPct | header | Discount percentage | Number(16,3) | 16,3 | 2.500 | False |\n| pocohAddName | header | Ship-to address name (lookup) | String | 195 | Main Warehouse | System Generated |\n\n### Response body — `lines[]` items\n\n| Name | Object | Description | Type | Data Length | Example | Mandatory |\n| --- | --- | --- | --- | --- | --- | --- |\n| pocsVUuid | line | Virtual UUID, unique row identifier | String | 64 | 57583E9AF08B542CE0630B811DACCB66 | System Generated |\n| pocsCompCode | line | Company code | String | 8 | ALT | Key |\n| pocsPoNum | line | Parent PO number | String | 11 | PO000004 | Key |\n| pocsNum | line | Change order number | String | 11 | 1 | Key |\n| pocsReleaseNum | line | Release number | Number(11) | 11 | 1 | Key |\n| pocsLineNum | line | Summary line number | Number(6) | 6 | 1 | Key |\n| pocsCiitemtypCode | line | item type code | String | 2 | MA | False |\n| pocsClassCode | line | Item class code | String | 4 | OFF1 | False |\n| pocsDesc | line | Line description | String | 4000 | Revised paper order | False |\n| pocsDiscountPct | line | Discount percentage | Number | — | 2.500 | False |\n| pocsExptdPriceAmt | line | Expected unit price | Number | — | 12.5000 | False |\n| pocsExtdAmt | line | Extended amount (calculated) | Number | — | 1250.00 | System Generated |\n| pocsItemLocCode | line | Item location code | String | 7 | ILOC01 | False |\n| pocsItmCode | line | Item/product code | String | 16 | PAPER-A4 | False |\n| pocsItmName | line | Item/product name (lookup) | String | 4000 | A4 Copy Paper | System Generated |\n| pocsJobName | line | Job name (lookup) | String | 60 | Office Renovation | System Generated |\n| pocsPhsName | line | Phase name (lookup) | String | 50 | Phase 1 | System Generated |\n| pocsCatName | line | Category name (lookup) | String | 30 | Supplies | System Generated |\n| pocsLumpSumPoFlag | line | Lump-sum PO flag (Y/N, calculated) | String | 1 | N | System Generated |\n| pocsOrdQty | line | Quantity ordered | Number | — | 100.0000 | False |\n| pocsOvrdExptdPriceFlag | line | Override expected price flag (Y/N) | String | 1 | Y | False |\n| pocsPoItemType | line | PO item type (I=Inventory, N=Non-stock, F=Free-form) | String | 1 | N | False |\n| pocsPoOrdQty | line | PO ordered quantity (calculated) | Number | — | 80.0000 | System Generated |\n| pocsPoOrderedQty | line | PO ordered quantity, alt calculation (calculated) | Number | — | 80.0000 | System Generated |\n| pocsPoPriceAmt | line | PO price amount (calculated) | Number | — | 12.5000 | System Generated |\n| pocsPobldLineNum | line | Source PO build line number (calculated) | Number(6) | 6 | 1 | System Generated |\n| pocsRecIntoInvFlag | line | Receive into inventory flag (Y/N) | String | 1 | Y | False |\n| pocsSuggestedPrice | line | Suggested price (calculated) | Number | — | 12.5000 | System Generated |\n| pocsTax1Code / Tax2Code / Tax3Code | line | Tax codes 1-3 | String | 11 each | HST | False |\n| pocsTax1TaxableFlag / Tax2.../Tax3... | line | Taxable flags for tax 1-3 (Y/N) | String | 1 each | Y | False |\n| pocsTaxAmt | line | Tax amount (calculated) | Number | — | 150.00 | System Generated |\n| pocsTotAmt | line | Total amount (calculated) | Number | — | 1400.00 | System Generated |\n| pocsUserField1..8 | line | User-defined fields 1-8 | String | 60 each | — | False |\n| pocsUserTypeCode | line | User-defined type code | String | 3 | STD | False |\n| pocsWmCode | line | Unit of measure code | String | 2 | BX | False |\n| pocsTavCode1..4 | line | TAV codes 1-4 | String | 10 each | TAV01 | False |\n| pocsWbsvCode1..8 | line | WBS value codes 1-8 (always disabled in CMiC UI) | String | 60 each | — | System Generated |\n| pocsWbsvCode9..12 | line | WBS value codes 9-12 | String | 60 each | — | False |\n| pocsIuCreateDate | line | Record creation timestamp (ISO-8601) | Timestamp | — | 2026-08-20T10:15:00-04:00 | System Generated |\n| pocsIuUpdateDate | line | Record last update timestamp (ISO-8601) | Timestamp | — | 2026-08-21T09:00:00-04:00 | System Generated |\n\n## Error Codes\n\n| HTTP | Error Code | Reason |\n| --- | --- | --- |\n| 400 | PO-000272-ERR | Request body is required |\n| 400 | PO-000264-ERR | `header` object is required in the request payload |\n| 400 | PO-000273-ERR | `header.pocohCompCode` is required |\n| 400 | PO-000274-ERR | `header.pocohPoNum` is required |\n| 400 | PO-000275-ERR | `header.pocohReleaseNum` is required |\n| 500 | PO-000033-ERR | An open Change Order already exists for this company/PO/release (`validate_rel_num`) |\n| 500 | PO-000179-ERR | The PO is not in an eligible status for a Change Order at that release (`validate_rel_num`) |\n| 500 | PO-000221-ERR | The change order could not be re-read immediately after creation (should not occur under normal operation) |\n| 500 | (unhandled exception) | Any other unexpected error; the transaction is rolled back |", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "example": { "header": { "pocohCompCode": "ZZ", "pocohPoNum": "8933", "pocohReleaseNum": "1" } } } } } }, "parameters": [ { "name": "Content-Type", "in": "header", "schema": { "type": "string" }, "example": "application/json" }, { "name": "cmic-debug-token", "in": "header", "schema": { "type": "string" }, "example": "59E49DF371288944E06327261DACB907" } ], "responses": { "201": { "description": "Created", "headers": { "Content-Type": { "schema": { "type": "string", "example": "application/json" } } }, "content": { "text/plain": { "schema": { "type": "string" }, "example": "{\n \"header\": {\n \"pocohVUuid\": \"596EF33010A84F19E0630B811DACF02D\",\n \"pocohCompCode\": \"ZZ\",\n \"pocohCompName\": \"CMiC-ZZ Test Company Incorp\",\n \"pocohPoNum\": \"987943\",\n \"pocohNum\": \"2\",\n \"pocohBchNum\": null,\n \"pocohVenCode\": \"ZZ-ACME\",\n \"pocohVenName\": \"ZZ-Acme & Supply\",\n \"pocohDeptCode\": null,\n \"pocohDeptName\": null,\n \"pocohExptdDate\": null,\n \"pocohOrdDate\": \"2021-01-28\",\n \"pocohRecDate\": null,\n \"pocohTypeCode\": \"S\",\n \"pocohAdjCode\": null,\n \"pocohStatCode\": \"N\",\n \"pocohChgCode\": \"O\",\n \"pocohTermCode\": \"NET30\",\n \"pocohTermName\": \"Net 30\",\n \"pocohInvCode\": null,\n \"pocohInvDate\": null,\n \"pocohInvDueDate\": null,\n \"pocohInvDiscDate\": null,\n \"pocohInvDiscAmt\": null,\n \"pocohCurrCode\": \"US\",\n \"pocohCurrName\": \"US Dollars\",\n \"pocohFobCode\": null,\n \"pocohBuyCode\": null,\n \"pocohAddCode\": null,\n \"pocohShplneCode\": null,\n \"pocohShpmetCode\": null,\n \"pocohTxt1Code\": null,\n \"pocohTxt2Code\": null,\n \"pocohShpinstDesc\": null,\n \"pocohDesc1\": null,\n \"pocohDesc2\": null,\n \"pocohAdjPrice\": null,\n \"pocohUnadjPrice\": null,\n \"pocohCurrConvNum\": 1,\n \"pocohCostedCode\": null,\n \"pocohRefNum\": null,\n \"pocohRefDate\": null,\n \"pocohReqCode\": null,\n \"pocohRecCode\": null,\n \"pocohReprintDate\": null,\n \"pocohWipAccCode\": null,\n \"pocohWipAccName\": null,\n \"pocohWipDeptCode\": null,\n \"pocohWipDeptName\": null,\n \"pocohShipinstTxt1Code\": null,\n \"pocohShipinstTxt2Code\": null,\n \"pocohShipinstTxt3Code\": null,\n \"pocohShipinstTxt4Code\": null,\n \"pocohShipinstTxt5Code\": null,\n \"pocohReleaseNum\": 1,\n \"pocohBilltoAddCode\": null,\n \"pocohReqReason\": null,\n \"pocohInvTypeCode\": null,\n \"pocohImageFilename\": null,\n \"pocohInvSerCode\": null,\n \"pocohVendOrderAddCode\": null,\n \"pocohComplianceFlag\": \"N\",\n \"pocohJobCompCode\": \"ZZ\",\n \"pocohJobCompName\": \"CMiC-ZZ Test Company Incorp\",\n \"pocohJobCode\": null,\n \"pocohJobName\": null,\n \"pocohContactCode\": null,\n \"pocohAddCompCode\": \"ZZ\",\n \"pocohAddCompName\": \"CMiC-ZZ Test Company Incorp\",\n \"pocohPrintDate\": null,\n \"pocohDefaultRecCode\": \"A\",\n \"pocohDate\": null,\n \"pocohPoTotal\": 46,\n \"pocohIuCreateDate\": \"2026-08-19T18:57:08-04:00\",\n \"pocohIuCreateUser\": \"YASHB\",\n \"pocohIuUpdateDate\": null,\n \"pocohIuUpdateUser\": null,\n \"pocohAcctDescription\": null,\n \"pocohDiscountPct\": 0,\n \"pocohAddName\": null\n },\n \"lines\": [\n {\n \"pocsVUuid\": \"596EF33010A94F19E0630B811DACF02D\",\n \"pocsCompCode\": \"ZZ\",\n \"pocsPoNum\": \"987943\",\n \"pocsNum\": \"2\",\n \"pocsReleaseNum\": 1,\n \"pocsLineNum\": 1,\n \"pocsCiitemtypCode\": null,\n \"pocsClassCode\": null,\n \"pocsDesc\": null,\n \"pocsDiscountPct\": 0,\n \"pocsExptdPriceAmt\": 2,\n \"pocsExtdAmt\": 0,\n \"pocsItemLocCode\": null,\n \"pocsItmCode\": \"ITEM 77\",\n \"pocsItmName\": \"77\",\n \"pocsJobName\": null,\n \"pocsPhsName\": null,\n \"pocsCatName\": null,\n \"pocsLumpSumPoFlag\": null,\n \"pocsOrdQty\": 0,\n \"pocsOvrdExptdPriceFlag\": null,\n \"pocsPoItemType\": \"F\",\n \"pocsPoOrdQty\": 23,\n \"pocsPoOrderedQty\": 23,\n \"pocsPoPriceAmt\": 2,\n \"pocsPobldLineNum\": null,\n \"pocsRecIntoInvFlag\": \"N\",\n \"pocsSuggestedPrice\": null,\n \"pocsTax1Code\": null,\n \"pocsTax1TaxableFlag\": \"Y\",\n \"pocsTax2Code\": null,\n \"pocsTax2TaxableFlag\": \"Y\",\n \"pocsTax3Code\": null,\n \"pocsTax3TaxableFlag\": \"Y\",\n \"pocsTaxAmt\": 0,\n \"pocsTotAmt\": 0,\n \"pocsUserField1\": \"ZZ\",\n \"pocsUserField2\": \"00\",\n \"pocsUserField3\": \"1000.100\",\n \"pocsUserField4\": null,\n \"pocsUserField5\": null,\n \"pocsUserField6\": null,\n \"pocsUserField7\": null,\n \"pocsUserField8\": null,\n \"pocsUserTypeCode\": \"G\",\n \"pocsWmCode\": \"EA\",\n \"pocsTavCode1\": null,\n \"pocsTavCode2\": null,\n \"pocsTavCode3\": null,\n \"pocsTavCode4\": null,\n \"pocsWbsvCode1\": null,\n \"pocsWbsvCode2\": null,\n \"pocsWbsvCode3\": null,\n \"pocsWbsvCode4\": null,\n \"pocsWbsvCode5\": null,\n \"pocsWbsvCode6\": null,\n \"pocsWbsvCode7\": null,\n \"pocsWbsvCode8\": null,\n \"pocsWbsvCode9\": null,\n \"pocsWbsvCode10\": null,\n \"pocsWbsvCode11\": null,\n \"pocsWbsvCode12\": null,\n \"pocsIuCreateDate\": \"2026-08-19T18:57:08-04:00\",\n \"pocsIuUpdateDate\": null\n }\n ]\n}" } } } } } } }, "components": { "securitySchemes": { "cmicBasicAuth": { "type": "http", "scheme": "basic", "description": "Basic authentication" } } } } ````