Cancel Purchase Order Line Items

Start Cancel Purchase Order Line Items Process

POST /api/.../workflow

This method starts the process to cancel multiple purchase order line items.

Permissions

This call requires the following:

  • CR_AccessAcquisitions_Allow
  • CR_PurchaseOrders_ReleaseReceiveCancelClosePO
  • CR_CreateAndDeleteItemRecordFromAcquisitionsAndSerials_Allow

Workflow Steps

  • Start procedure
  • Confirm cancel
  • Check for validity of the data
  • Check for the invalid poline item status that are in request object
  • Check if any poline items are locked
  • Check for linked items for each purchase order line item
  • Check for attached holds for each poline item and if user needs to be prompted
  • Check for fund status for each poli item
  • Check for linked items

Request Information

Parameters
Name Type Required Description
WorkflowRequest DtoWorkflowRequest Yes Define this parameter in the request body.
DtoWorkflowRequest
Property Type Nullable Description
WorkflowRequestType Int No Required. To cancel purchase order line items, this must be set to 34.
TxnBranchID Int No Transacting branch ID.
TxnUserID Int No Transacting Polaris user ID.
TxnWorkstationID Int No Transacting workstation ID.
RequestExtension DtoWorkflowRequestExtension No
WorkflowReplies List of DtoWorkflowReply Yes In the future, it may be possible to pass in a list of replies for automated processing.
DtoPOLineItemExtensionData
Property Type Nullable Description
WorkflowRequestExtensionType Int No To cancel purchase order line items, the extension type must be a 31.
Data Object No This must be an extension data object of type DtoCancelPOLineItemExtensionData
DtoCancelPOLineItemExtensionData
Property Type Nullable Description
POLineItemIDs List of Integers No Primary key. List of purchaser order line items.

Purchase order line items body

application/json, text/json
{
    "WorkflowRequestType":34,
    "TxnBranchID":"3",
    "TxnUserID":"1",
    "TxnWorkstationID":"1237",
    "WorkflowReplies":null,
    "RequestExtension":
    {
        "WorkflowRequestExtensionType":31,
        "Data":
        {
            "POLineItemIDs":[156622,156623,156629]
        }
    }
}

Response Information

Example - Are you sure message response
application/json, text/json
{
    "WorkflowRequestGuid":"ea8307b6-9974-41cf-9a1b-c532ff0783d9",
    "WorkflowRequestType":34,
    "WorkflowStatus":-3,
    "Prompt":
    {
        "WorkflowPromptID":137,
        "Name":null,
        "Description":null,
        "WorkflowPromptType":51,
        "WorkflowPromptOptions":6,
        "DefaultPromptOption":5,
        "Title":"Cancel PO line items",
        "Message":"Are you sure you want to cancel 3 selected PO line item(s)?",
        "AlternateMessage":"","AlternateYesText":"",
        "AlternateNoText":"","AlternateCancelText":"",
        "AlternateContinueText":"",
        "PromptExtension":null},
        "InformationMessages":[],
        "AnswerExtension":null,
        "CircTranType":0,
        "ReceiptType":0,
        "ReceiptUrl":"",
        "FineEReceiptSent":false
    }
}
Example - Invalid data information returned in response
application/json, text/json
{
   
  "WorkflowRequestGuid": "00000000-0000-0000-0000-000000000000",
  "WorkflowRequestType": 34,
  "WorkflowStatus": -2,
  "Prompt": null,
  "InformationMessages": [
    {
      "Type": 2,
      "Title": "",
      "Message": "You cannot perform this operation on any of the selected lines / segments. Check the status of the lines / segments."
    }
  ],
  "AnswerExtension": null,
  "CircTranType": 0,
  "ReceiptType": 0,
  "ReceiptUrl": "",
  "FineEReceiptSent": false
    }
}
Example - Some of the poli items have invalid status information returned in response
application/json, text/json
{
   
 "WorkflowRequestGuid": "6e1910fa-30e0-4839-9266-e29c2a811b84",
  "WorkflowRequestType": 34,
  "WorkflowStatus": -3,
  "Prompt": {
    "WorkflowPromptID": 138,
    "Name": null,
    "Description": null,
    "WorkflowPromptType": 50,
    "WorkflowPromptOptions": 6,
    "DefaultPromptOption": 4,
    "Title": "Line item canceling error(s)",
    "Message": "The following line items cannot be canceled. Do you want to continue?",
    "AlternateMessage": "",
    "AlternateYesText": "",
    "AlternateNoText": "",
    "AlternateCancelText": "",
    "AlternateContinueText": "",
    "PromptExtension": {
      "WorkflowPromptExtensionType": 44,
      "Data": {
        "ShowCheckbox": false,
        "CheckboxText": null,
        "IsChecked": false,
        "Columns": [
          {
            "Name": "Line Number",
            "Key": "LineNumber",
            "Type": "Text"
          }
        ],
        "Data": [
          23,
          17,
          16
        ],
        "ObjectType": 0,
        "ObjectIDPropertyName": null
      }
    }
  },
  "InformationMessages": [],
  "AnswerExtension": null,
  "CircTranType": 0,
  "ReceiptType": 0,
  "ReceiptUrl": "",
  "FineEReceiptSent": false
}
Example - Linked items
application/json, text/json
    {
        "WorkflowRequestGuid": "b4da1ab9-bdc6-4788-9f3e-2c857572bda8",
      "WorkflowRequestType": 34,
      "WorkflowStatus": 0,
      "Prompt": {
        "WorkflowPromptID": 138,
        "Name": null,
        "Description": null,
        "WorkflowPromptType": 50,
        "WorkflowPromptOptions": 6,
        "DefaultPromptOption": 4,
        "Title": "Linked item(s)",
        "Message": "The following lines/ segments cannot be canceled because their linked items are in use:",
        "AlternateMessage": "",
        "AlternateYesText": "",
        "AlternateNoText": "",
        "AlternateCancelText": "",
        "AlternateContinueText": "",
        "PromptExtension": {
          "WorkflowPromptExtensionType": 44,
          "Data": {
            "ShowCheckbox": false,
            "CheckboxText": null,
            "IsChecked": false,
            "Columns": [
              {
                "Name": "Line#",
                "Key": "LineNumber",
                "Type": "Text"
              },
              {
                "Name": "Segment#",
                "Key": "POLISegmentNumber",
                "Type": "Text"
              }
            ],
            "Data": [
              {
                "POLineItemID": 156607,
                "LineNumber": 1,
                "POLISegmentNumber": 1
              }
            ],
            "ObjectType": 0,
            "ObjectIDPropertyName": null
          }
        }
  },
  "InformationMessages": [],
  "AnswerExtension": null,
  "CircTranType": 0,
  "ReceiptType": 0,
  "ReceiptUrl": "",
  "FineEReceiptSent": false}
        
Example - Success
application/json, text/json
{
 
  "WorkflowRequestGuid": "0a4dcdd3-dc90-4a0d-9165-13d877e7f3f7",
  "WorkflowRequestType": 34,
  "WorkflowStatus": 1,
  "Prompt": null,
  "InformationMessages": [
    {
      "Type": 1,
      "Title": "",
      "Message": "1 purchase order line item(s) are canceled"
    }
  ],
  "AnswerExtension": null,
  "CircTranType": 0,
  "ReceiptType": 0,
  "ReceiptUrl": "",
  "FineEReceiptSent": false
}
        

HTTP Response Codes

Code Description
200 OK. Success

Required Permissions

Permission IDs found here.

    CR_AccessAcquisitions_Allow
    CR_PurchaseOrders_ReleaseReceiveCancelClosePO(based on owner ID)
    CR_CreateAndDeleteItemRecordFromAcquisitionsAndSerials_Allow