Submit Large Volume of Sales Orders Using Filter Criteria Matching with the Order Numbers

Let's say you have a list of sales orders numbers that you plan to submit.

Oracle Order Management Fusion Cloud provides the ability to submit large volume of sales orders using a REST API. You can use the REST API to request submission of multiple sales orders and get the status of the request. Orders created in Oracle Order Management in draft status so that they can be reviewed before submission. After reviewing them, you may want to bulk submit the list of sales orders. You have the list of order numbers that you plan to submit. In this example, you have three orders numbers.

Here's a typical application processing flow for the scenario:
  1. You have a list of order numbers of the orders that you want to submit.
  2. You can send a request payload using the Sales Order Action Requests REST API to submit the list of order numbers.
  3. The response payload includes details of the batch process that's submitted to submit the list of order numbers. As this is an offline process, the response is always PRE_PROCESSING.
  4. You can get the summarized status of the order submission request by calling the Get action of the Sales Order Action Requests REST API.
  5. The Get action of the Sales Order Action Requests REST API also provides the unique request identifiers for each order number that you submit. You can get the status of the order submission and error or warning details, if any, for each order using the request identifier of each order number.
  6. In this example, there are three order numbers submitted for order submission. One results in success and two in error.

Example URL

Use this resource URL format:

POST

curl -u username:password -X POST -H "Content-Type:application/vnd.oracle.adf.resourceitem+json" -d 'request payload' 
"https://servername/fscmRestApi/resources/version/salesOrderActionRequests"

Example Request

Here's an example of the request body in JSON format. You plan to submit these orders 528315, 528264, and 528274. Use ActionCode "ORA_FOM_SUBMIT_ORDER" for submitting orders.

{
    "ActionCode": "ORA_FOM_SUBMIT_ORDER",
    "FilterCriteria": "{\"query\":{\"filters\":[{\"name\":\"OrderNumber\",\"term\":\"528315 528264 528274\"}]}}"
}

Example Response

In the response, ActionRequestId 300100606661617 is returned, which is the master action request ID.
{
  "ActionCode" : "ORA_FOM_SUBMIT_ORDER",
  "ActionRequestId" : 300100606661617,
  "ActionRequestTrackingId" : 398124,
  "CreatedBy" : "ORDER_MGR_OPERATIONS",
  "CreationDate" : "2024-01-05T05:42:46.001+00:00",
  "FulfillLineId" : null,
  "HeaderId" : -1,
  "LastUpdateDate" : "2024-01-05T05:42:46.138+00:00",
  "MassActionFlag" : true,
  "OutcomeCode" : null,
  "StatusCode" : "PRE_PROCESSING",
  "Action" : null,
  "ProcessId" : 389116,
  "TotalRecords" : 3,
  "TotalFailed" : 0,
  "TotalPassed" : 0,
  "ProcessStatus" : "IN_QUEUE",
  "FilterCriteria" : "{\"query\":{\"filters\":[{\"name\":\"OrderNumber\",\"term\":\"528315 528264 528274\"}]}}",
  "Comments" : null,
  "CancelReasonCode" : null,
  "links" : [ {
    "rel" : "self",
    "href" : "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100606661617",
    "name" : "salesOrderActionRequests",
    "kind" : "item",
    "properties" : {
      "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
    }
  }, {
    "rel" : "canonical",
    "href" : "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100606661617",
    "name" : "salesOrderActionRequests",
    "kind" : "item"
  }, {
    "rel" : "child",
    "href" : "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100606661617/child/requests",
    "name" : "requests",
    "kind" : "collection"
  } ]
}

Use GET operation using 300100606661617 to get the details of the child action requests.

curl -u username:password "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/{ActionRequestId}/child/requests"

For example:

curl -u username:password "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100606661617/child/requests?onlyData=true"

Example Response

Here's an example of the response body in JSON format:
{
  "items" : [ {
    "ActionCode" : "ORA_FOM_SUBMIT_ORDER",
    "ActionRequestId" : 300100606661619,
    "ActionRequestTrackingId" : 398124,
    "FulfillLineId" : null,
    "HeaderId" : 300100605929518,
    "MassActionFlag" : false,
    "OutcomeCode" : "ERROR",
    "StatusCode" : "COMPLETE",
    "SummaryMessageText" : "Order isn't in Draft status.",
    "RequestStatus" : "FAILED",
    "@context" : {
      "key" : "300100606661619",
      "headers" : {
        "ETag" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
      }
    }
  }, {
    "ActionCode" : "ORA_FOM_SUBMIT_ORDER",
    "ActionRequestId" : 300100606661620,
    "ActionRequestTrackingId" : 398124,
    "FulfillLineId" : null,
    "HeaderId" : 300100605933959,
    "MassActionFlag" : false,
    "OutcomeCode" : "ERROR",
    "StatusCode" : "COMPLETE",
    "SummaryMessageText" : "Order isn't in Draft status.",
    "RequestStatus" : "FAILED",
    "@context" : {
      "key" : "300100606661620",
      "headers" : {
        "ETag" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
      }
    }
  }, {
    "ActionCode" : "ORA_FOM_SUBMIT_ORDER",
    "ActionRequestId" : 300100606661621,
    "ActionRequestTrackingId" : 398124,
    "FulfillLineId" : null,
    "HeaderId" : 300100605934488,
    "MassActionFlag" : false,
    "OutcomeCode" : "ERROR",
    "StatusCode" : "COMPLETE",
    "SummaryMessageText" : "Order isn't in Draft status.",
    "RequestStatus" : "FAILED",
    "@context" : {
      "key" : "300100606661621",
      "headers" : {
        "ETag" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
      }
    }
  } ],
  "count" : 3,
  "hasMore" : false,
  "limit" : 25,
  "offset" : 0,
  "links" : [ {
    "rel" : "self",
    "href" : "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100606661617/child/requests",
    "name" : "requests",
    "kind" : "collection"
  } ]
}

Note that in the response three child action requests, 300100606661619, 300100606661620, and 300100606661621 are created for each order number. In this case, each child action request is completed (StatusCode= COMPLETE) but order submission fails (OutcomeCode: ERROR).