Submit Large Volume of Sales Orders with Filter Criteria as Customer and Order Status

Let's say you want to submit all orders that match a specific search criteria. For example, you may want to submit all orders with the filter criteria of a specific customer "FOM-Customer-001" and order status as Draft (DOO_DRAFT).

Here's a typical application processing flow for the scenario:

  1. You want to submit all orders for the customer "FOM-Customer-001" with the order status as Draft (DOO_DRAFT).

  2. You send a request POST payload using the Sales Order Action Requests REST API to submit with the filter criteria of customer name and order status.

  3. The response payload includes details of the batch process that's submitted to submit all orders matching with the filter criteria. As this is an offline process, so the immediate response is always shown as “PRE_PROCESSING’.

  4. You can get the summarized status of the order submission request by calling the GET service of Sales Order Action Requests REST API for the request.

  5. The GET service of Sales Order Action Requests REST API for the request also provides the unique request identifiers which are spawned for each order that is submitted matching the filter criteria. You can get the status of order submission and error or warning details if any for each order using the request identifier of each order number.

    In the example, there three orders that match the search criteria for order submission. All the three result 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 matching with search criteria customer "FOM-Customer-001" and order status "DOO_DRAFT". Use ActionCode "ORA_FOM_SUBMIT_ORDER" for submitting orders.

{
    "ActionCode": "ORA_FOM_SUBMIT_ORDER",
    "FilterCriteria": "{\"query\":{\"filters\":[{\"name\":\"Customer\",\"terms\":[\"FOM-Customer-001\"]},{\"name\":\"OrderStatus\",\"terms\":[\"DOO_DRAFT\"]}]}}"
}

In the response, ActionRequestId 300100606659960, which is the master action request ID, is returned.

Example Response

Here's an example of the response body in JSON format:
{
  "ActionCode" : "ORA_FOM_SUBMIT_ORDER",
  "ActionRequestId" : 300100606659960,
  "ActionRequestTrackingId" : 399727,
  "CreatedBy" : "ORDER_MGR_OPERATIONS",
  "CreationDate" : "2024-01-05T05:35:40.001+00:00",
  "FulfillLineId" : null,
  "HeaderId" : -1,
  "LastUpdateDate" : "2024-01-05T05:35:40.012+00:00",
  "MassActionFlag" : true,
  "OutcomeCode" : null,
  "StatusCode" : "PRE_PROCESSING",
  "Action" : null,
  "ProcessId" : 389040,
  "TotalRecords" : 3,
  "TotalFailed" : 0,
  "TotalPassed" : 0,
  "ProcessStatus" : "IN_QUEUE",
  "FilterCriteria" : "{\"query\":{\"filters\":[{\"name\":\"Customer\",\"terms\":[\"FOM-Customer-001\"]},{\"name\":\"OrderStatus\",\"terms\":[\"DOO_DRAFT\"]}]}}",
  "Comments" : null,
  "CancelReasonCode" : null,
  "links" : [ {
    "rel" : "self",
    "href" : "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100606659960",
    "name" : "salesOrderActionRequests",
    "kind" : "item",
    "properties" : {
      "changeIndicator" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
    }
  }, {
    "rel" : "canonical",
    "href" : "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100606659960",
    "name" : "salesOrderActionRequests",
    "kind" : "item"
  }, {
    "rel" : "child",
    "href" : "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100606659960/child/requests",
    "name" : "requests",
    "kind" : "collection"
  } ]
}

Use the GET operation using 300100606659960 to get the details of 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/salesOrderActionRequests/300100606659960/child/requests?onlyData=true"

Example Response

Here's an example of the response body in JSON format:

{
  "items" : [ {
    "ActionCode" : "ORA_FOM_SUBMIT_ORDER",
    "ActionRequestId" : 300100606659962,
    "ActionRequestTrackingId" : 399727,
    "FulfillLineId" : null,
    "HeaderId" : 300100606203988,
    "MassActionFlag" : false,
    "OutcomeCode" : "ERROR",
    "StatusCode" : "COMPLETE",
    "SummaryMessageText" : "Didn't pass validation. Open the order to review issues.",
    "RequestStatus" : "FAILED",
    "@context" : {
      "key" : "300100606659962",
      "headers" : {
        "ETag" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
      }
    }
  }, {
    "ActionCode" : "ORA_FOM_SUBMIT_ORDER",
    "ActionRequestId" : 300100606659963,
    "ActionRequestTrackingId" : 399727,
    "FulfillLineId" : null,
    "HeaderId" : 300100606535145,
    "MassActionFlag" : false,
    "OutcomeCode" : "ERROR",
    "StatusCode" : "COMPLETE",
    "SummaryMessageText" : "Didn't pass validation. Open the order to review issues.",
    "RequestStatus" : "FAILED",
    "@context" : {
      "key" : "300100606659963",
      "headers" : {
        "ETag" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
      }
    }
  }, {
    "ActionCode" : "ORA_FOM_SUBMIT_ORDER",
    "ActionRequestId" : 300100606659964,
    "ActionRequestTrackingId" : 399727,
    "FulfillLineId" : null,
    "HeaderId" : 300100606539139,
    "MassActionFlag" : false,
    "OutcomeCode" : "ERROR",
    "StatusCode" : "COMPLETE",
    "SummaryMessageText" : "Didn't pass validation. Open the order to review issues.",
    "RequestStatus" : "FAILED",
    "@context" : {
      "key" : "300100606659964",
      "headers" : {
        "ETag" : "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
      }
    }
  } ],
  "count" : 3,
  "hasMore" : false,
  "limit" : 25,
  "offset" : 0,
  "links" : [ {
    "rel" : "self",
    "href" : "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100606659960/child/requests",
    "name" : "requests",
    "kind" : "collection"
  } ]
}

Note that in the response three child action requests ( 300100606659962, 300100606659963, 300100606659964) are created for each order number. In this case each child action request is completed (StatusCode= COMPLETE) but order submission failed (OutcomeCode: ERROR). In the response three child action requests ( 300100606659962, 300100606659963, 300100606659964) are created for each order number. In this case each the child action request is complete (StatusCode= COMPLETE) but order submission failed (OutcomeCode: ERROR).