Submit Large Volume of Sales Orders Using List of Header IDs

Fusion Order Management Cloud provides the ability to submit large volume of sales orders using a REST API. You can use it to request submission of multiple sales orders and get the status of the request. Orders are 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.

Here's a typical application processing flow for the scenario:
  1. You have a list of header IDs of the orders that you want to submit. You can use the get action of the Sales Orders for Order Hub resource to get the header IDs of the order numbers 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 header IDs.
  3. The response payload includes details of the batch process that's submitted to submit the header IDs. As this is an offline process, so 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 for the request.
  5. The get action of the Sales Order Action Requests REST API for the request also provides the unique request identifiers for each header ID 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 header ID.
  6. In this example, there are three header IDs 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.vision.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. Three sales orders with Header IDs 300100608434819, 300100608434932, 300100608434934 are to be submitted. Specify ActionCode ORA_FOM_SUBMIT_ORDER for submitting the orders.
{
    "ActionCode": "ORA_FOM_SUBMIT_ORDER",
    "requests": [
        {
            "HeaderId": 300100608434819
        },
        {
            "HeaderId": 300100608434932
        },
        {
            "HeaderId": 300100608434934
        }
    ]
}

Example Response

Here's an example of the response body in JSON format.
{
    "ActionCode": "ORA_FOM_SUBMIT_ORDER",
    "ActionRequestId": 300100608436027,
    "ActionRequestTrackingId": 427736,
    "CreatedBy": "SCMOPERATIONS",
    "CreationDate": "2023-10-20T06:19:28.001+00:00",
    "FulfillLineId": null,
    "HeaderId": -1,
    "LastUpdateDate": "2023-10-20T06:19:28.102+00:00",
    "MassActionFlag": true,
    "OutcomeCode": null,
    "StatusCode": "PRE_PROCESSING",
    "Action": null,
    "ProcessId": 474122,
    "TotalRecords": 3,
    "TotalFailed": 0,
    "TotalPassed": 0,
    "ProcessStatus": "IN_QUEUE",
    "FilterCriteria": null,
    "requests": [
        {
            "ActionCode": "ORA_FOM_SUBMIT_ORDER",
            "ActionRequestId": 300100608436028,
            "ActionRequestTrackingId": 427736,
            "FulfillLineId": null,
            "HeaderId": 300100608434819,
            "MassActionFlag": false,
            "OutcomeCode": null,
            "StatusCode": "PRE_PROCESSING",
            "SummaryMessageText": null,
            "RequestStatus": "IN_QUEUE",
            "links": [
                {
                    "rel": "self",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests/300100608436028",
                    "name": "requests",
                    "kind": "item",
                    "properties": {
                        "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
                    }
                },
                {
                    "rel": "canonical",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests/300100608436028",
                    "name": "requests",
                    "kind": "item"
                },
                {
                    "rel": "parent",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027",
                    "name": "salesOrderActionRequests",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests/300100608436028/child/orderDetails",
                    "name": "orderDetails",
                    "kind": "collection"
                }
            ]
        },
        {
            "ActionCode": "ORA_FOM_SUBMIT_ORDER",
            "ActionRequestId": 300100608436029,
            "ActionRequestTrackingId": 427736,
            "FulfillLineId": null,
            "HeaderId": 300100608434932,
            "MassActionFlag": false,
            "OutcomeCode": null,
            "StatusCode": "PRE_PROCESSING",
            "SummaryMessageText": null,
            "RequestStatus": "IN_QUEUE",
            "links": [
                {
                    "rel": "self",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests/300100608436029",
                    "name": "requests",
                    "kind": "item",
                    "properties": {
                        "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
                    }
                },
                {
                    "rel": "canonical",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests/300100608436029",
                    "name": "requests",
                    "kind": "item"
                },
                {
                    "rel": "parent",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027",
                    "name": "salesOrderActionRequests",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests/300100608436029/child/orderDetails",
                    "name": "orderDetails",
                    "kind": "collection"
                }
            ]
        },
        {
            "ActionCode": "ORA_FOM_SUBMIT_ORDER",
            "ActionRequestId": 300100608436030,
            "ActionRequestTrackingId": 427736,
            "FulfillLineId": null,
            "HeaderId": 300100608434934,
            "MassActionFlag": false,
            "OutcomeCode": null,
            "StatusCode": "PRE_PROCESSING",
            "SummaryMessageText": null,
            "RequestStatus": "IN_QUEUE",
            "links": [
                {
                    "rel": "self",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests/300100608436030",
                    "name": "requests",
                    "kind": "item",
                    "properties": {
                        "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
                    }
                },
                {
                    "rel": "canonical",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests/300100608436030",
                    "name": "requests",
                    "kind": "item"
                },
                {
                    "rel": "parent",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027",
                    "name": "salesOrderActionRequests",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests/300100608436030/child/orderDetails",
                    "name": "orderDetails",
                    "kind": "collection"
                }
            ]
        }
    ],
    "links": [
        {
            "rel": "self",
            "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027",
            "name": "salesOrderActionRequests",
            "kind": "item",
            "properties": {
                "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
            }
        },
        {
            "rel": "canonical",
            "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027",
            "name": "salesOrderActionRequests",
            "kind": "item"
        },
        {
            "rel": "child",
            "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests",
            "name": "requests",
            "kind": "collection"
        }
    ]
}

In the response of the POST operation of the batch process, you get the master ActionRequestId 300100608436027. Status PRE_PROCESSING and Request status is IN_QUEUE. The master action 300100608436027 spawns three child request to handle the processing of three individual header IDs.

Note that:

TotalRecords": 3,
    TotalFailed: 0,
    TotalPassed: 0,

ActionRequestId 300100608436028 for HeaderId 300100608434819

ActionRequestId 300100608436029 for HeaderId 300100608434932

ActionRequestId 300100608436030 for HeaderId 300100608434934

You can use master ActionRequestId 300100608436027 in the following Get REST API to get the status of all the individual child action requests.

Use this resource URL format:

GET

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

Example Response

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

{
    "items": [
        {
            "ActionCode": "ORA_FOM_SUBMIT_ORDER",
            "ActionRequestId": 300100608436028,
            "ActionRequestTrackingId": 427736,
            "FulfillLineId": null,
            "HeaderId": 300100608434819,
            "MassActionFlag": false,
            "OutcomeCode": "SUCCESS",
            "StatusCode": "COMPLETE",
            "SummaryMessageText": null,
            "RequestStatus": "COMPLETED"
        },
        {
            "ActionCode": "ORA_FOM_SUBMIT_ORDER",
            "ActionRequestId": 300100608436029,
            "ActionRequestTrackingId": 427736,
            "FulfillLineId": null,
            "HeaderId": 300100608434932,
            "MassActionFlag": false,
            "OutcomeCode": "ERROR",
            "StatusCode": "COMPLETE",
            "SummaryMessageText": "Order isn't in Draft status.",
            "RequestStatus": "FAILED"
        },
        {
            "ActionCode": "ORA_FOM_SUBMIT_ORDER",
            "ActionRequestId": 300100608436030,
            "ActionRequestTrackingId": 427736,
            "FulfillLineId": null,
            "HeaderId": 300100608434934,
            "MassActionFlag": false,
            "OutcomeCode": "ERROR",
            "StatusCode": "COMPLETE",
            "SummaryMessageText": "Didn't pass validation. Open the order to review issues.",
            "RequestStatus": "FAILED"
        }
    ],
    "count": 3,
    "hasMore": false,
    "limit": 25,
    "offset": 0,
    "links": [
        {
            "rel": "self",
            "href": "https://servername/fscmRestApi/resources/version/salesOrderActionRequests/300100608436027/child/requests",
            "name": "requests",
            "kind": "collection"
        }
    ]
}
StatusCode indicates the status of the order submission request for the header ID. It can be COMPLETE, PRE_PROCESSING, or PROCESSING. Unless StatusCode is COMPLETE, the request is still being processed. Keep checking the status till the StatusCode is marked COMPLETE.

OutcomeCode indicates the outcome of the order submission request. It can be SUCCESS or ERROR.

You can see that for the first HeaderId, 300100608434819, associated with ActionRequestId 300100608436028 StatusCode = COMPLETE and OutcomeCode = SUCCESS, which means the order has been submitted successfully.

For HeaderId 300100608434932 associated with ActionRequestId 300100608436029, StatusCode = COMPLETE and OutcomeCode = ERROR. This means the request is completed but the order hasn't been submitted. You see that SummaryMessageText = Order isn't in Draft status. This indicates the order was not eligible for submission, so it didn't get submitted.

For HeaderId 00100608434934 associated with ActionRequestId 300100608436030, StatusCode = COMPLETE and OutcomeCode = ERROR. This means the request is completed but the order hasn't been submitted. You see that SummaryMessageText = Didn't pass validation. Open the order to review issues. This indicates there were errors while submitting the orders. You can open an order to see the errors. You need to resolve the errors before submitting the order.