Apply hold

post

/fscmRestApi/resources/11.13.18.05/salesOrdersForOrderHub/action/applyHold

This service can be used to apply holds on the sales order resource at the order header and fulfillment line levels.

Request

Header Parameters
  • If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
  • The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
Supported Media Types
Request Body - application/vnd.oracle.adf.action+json ()
Root Schema : schema
Type: object
Show Source
  • holdRequests
    Required attributes for Apply hold request include SourceTransactionSystem, HoldCode or HoldName.
    - For header holds, either SourceTransactionId or OrderNumber are mandatory along with SourceTransactionSystem and HoldCode or HoldName.
    - For fulfillment line holds, FulfillLineId is mandatory along with SourceTransactionSystem and HoldCode or HoldName. When SourceTransactionLineId is used to apply holds, either SourceTransactionId or OrderNumber are mandatory along with SourceTransactionSystem and HoldCode or HoldName.
    - HoldComments is an optional attribute.

    Although SourceTransactionLineId is an input in the Apply hold request, the hold will only be applied on the fulfillment lines corresponding to that line. The hold will NOT be applied on the order line entity itself.
  • Time, in seconds, after which the control is passed back to the calling client and the apply hold request continues in the background.
Nested Schema : holdRequests
Type: array
Required attributes for Apply hold request include SourceTransactionSystem, HoldCode or HoldName.
- For header holds, either SourceTransactionId or OrderNumber are mandatory along with SourceTransactionSystem and HoldCode or HoldName.
- For fulfillment line holds, FulfillLineId is mandatory along with SourceTransactionSystem and HoldCode or HoldName. When SourceTransactionLineId is used to apply holds, either SourceTransactionId or OrderNumber are mandatory along with SourceTransactionSystem and HoldCode or HoldName.
- HoldComments is an optional attribute.

Although SourceTransactionLineId is an input in the Apply hold request, the hold will only be applied on the fulfillment lines corresponding to that line. The hold will NOT be applied on the order line entity itself.
Show Source
Nested Schema : items
Type: object
Additional Properties Allowed
Show Source
Back to Top

Response

Supported Media Types

Default Response

The following table describes the default response for this task.
Body ()
Root Schema : schema
Type: object
Show Source
  • result
    The RequestStatus attribute in the Apply hold response contains the status of the Apply hold request. It can have two values: SUCCESS or ERROR. In case of an ERROR, the Message attribute contains the actual error message.

    In addition to the RequestStatus and Message attributes, the Apply hold response also contains the SourceTransactionSystem, SourceTransactionId, OrderNumber, SourceTransactionLineId, FulfillLineId and HoldCode attributes.
Nested Schema : result
Type: array
The RequestStatus attribute in the Apply hold response contains the status of the Apply hold request. It can have two values: SUCCESS or ERROR. In case of an ERROR, the Message attribute contains the actual error message.

In addition to the RequestStatus and Message attributes, the Apply hold response also contains the SourceTransactionSystem, SourceTransactionId, OrderNumber, SourceTransactionLineId, FulfillLineId and HoldCode attributes.
Show Source
Nested Schema : items
Type: object
Additional Properties Allowed
Show Source
Back to Top

Examples

These examples describe how to apply holds on sales orders.

Example Number Description
Example 1 Apply a header hold on a single order.
Example 2 Apply a header hold on multiple orders in a single request.
Example 3 Apply a hold on multiple fulfillment lines in a single order.
Example 4 Apply a hold on fulfillment lines belonging to multiple orders in a single request.
Example 5 Apply a hold on fulfillment lines in a single order using the SourceTransactionLineId attribute. The hold is only applied on the fulfillment lines corresponding to the SourceTransactionLineId attribute.
Example 6 Apply a hold on fulfillment lines belonging to multiple orders using the SourceTransactionLineId attribute. The hold is only applied on the fulfillment lines corresponding to the SourceTransactionLineId attribute.
Example 7 Apply a header hold on a single order using the HoldName attribute.
Example 8 Apply a fulfillment line hold on multiple fulfillment lines with the processRequestOfflineAfter attribute set to a non-default value.
Example 9 Demonstrates an exception scenario in which a duplicate hold is applied on an order header.
Example 10 Demonstrates an exception scenario in which the required attributes are not passed in the apply hold request, and an error is returned with RequestStatus.

Example cURL Command

Use the following cURL command to submit a request on the REST resource.

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

Example 1

This example describes how to apply a header hold on a single order.

Example 1 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
  "processRequestOfflineAfter": 240,
  "holdRequests": [
     {
      "HoldCode": "DOO_SHIP_ALL",
      "HoldComments": "Order On Hold",
      "SourceTransactionId": "AASHIP190404",
      "SourceTransactionSystem" : "GPR"
    }
  ]
}

Example 1 Response Body

The following example includes contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

Example 2

The following example describes how to apply a header hold on multiple orders in a single request.

Example 2 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
  "processRequestOfflineAfter": 60,
  "holdRequests": [
     {
      "HoldCode": "DOO_SHIP_ALL",
      "HoldComments": "Order On Hold",
      "OrderNumber": "531257",
      "SourceTransactionSystem" : "GPR"
    },
    {
      "HoldCode": "DOO_SHIP_ALL",
      "HoldComments": "Order On Hold",
      "OrderNumber": "531258",
      "SourceTransactionSystem" : "GPR"
    }
  ]
}

Example 2 Response Body

The following example includes the contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190405",
            "OrderNumber": "531258",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

Example 3

This example describes how to to apply a hold on multiple fulfillment lines in a single order.

Example 3 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
    "processRequestOfflineAfter": 60,
    "holdRequests": [
        {
            "FulfillLineId": 300100592623973,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        },
        {
            "FulfillLineId": 300100592623975,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        }
    ]
}

Example 3 Response Body

The following example includes the contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": "1",
            "FulfillLineId": "300100592623973",
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": "2",
            "FulfillLineId": "300100592623975",
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

Example 4

This example describes how to apply a hold on fulfillment lines belonging to multiple orders in a single request.

Example 4 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
    "processRequestOfflineAfter": 60,
    "holdRequests": [
        {
            "FulfillLineId": 300100592623973,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        },
        {
            "FulfillLineId": 300100592623975,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        },
        {
            "FulfillLineId": 300100592625199,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        },
        {
            "FulfillLineId": 300100592625201,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        }
    ]
}

Example 4 Response Body

The following example includes the contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": "1",
            "FulfillLineId": "300100592623973",
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": "2",
            "FulfillLineId": "300100592623975",
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190405",
            "OrderNumber": "531258",
            "SourceTransactionLineId": "1",
            "FulfillLineId": "300100592625199",
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190405",
            "OrderNumber": "531258",
            "SourceTransactionLineId": "2",
            "FulfillLineId": "300100592625201",
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

Example 5

This example describes how to apply a hold on fulfillment lines in a single order using the SourceTransactionLineId attribute. The hold is only applied on the fulfillment lines corresponding to the SourceTransactionLineId attribute.

Example 5 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
  "processRequestOfflineAfter": 20,
  "holdRequests": [
     {
      "SourceTransactionLineId": 2,
      "HoldCode": "DOO_SHIP_ALL",
      "HoldComments": "Order line hold",
      "SourceTransactionId": "AASHIP190406",
      "SourceTransactionSystem": "GPR"
    }
  ]
}

Example 5 Response Body

The following example includes the contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190406",
            "OrderNumber": "531274",
            "SourceTransactionLineId": "2",
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

Example 6

This example describes how to apply a hold on fulfillment lines belonging to multiple orders using the SourceTransactionLineId attribute. The hold is only applied on the fulfillment lines corresponding to the SourceTransactionLineId attribute.

Example 6 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
  "processRequestOfflineAfter": 20,
  "holdRequests": [
     {
      "SourceTransactionLineId": 2,
      "HoldCode": "DOO_SHIP_ALL",
      "HoldComments": "Order line hold",
      "SourceTransactionId": "AASHIP190406",
      "SourceTransactionSystem": "GPR"
    },
    {
      "SourceTransactionLineId": 1,
      "HoldCode": "DOO_SHIP_ALL",
      "HoldComments": "Order line hold",
      "SourceTransactionId": "AASHIP190407",
      "SourceTransactionSystem": "GPR"
    }
  ]
}

Example 6 Response Body

The following example includes the contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190406",
            "OrderNumber": "531274",
            "SourceTransactionLineId": "2",
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190407",
            "OrderNumber": "531275",
            "SourceTransactionLineId": "1",
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

Example 7

This example describes how to apply a header hold on a single order using the HoldName attribute.

Example 7 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
  "processRequestOfflineAfter": 20,
  "holdRequests": [
     {
      "HoldName": "SHIP_ALL",
      "HoldComments": "Order On Hold",
      "OrderNumber": "531257",
      "SourceTransactionSystem" : "GPR"
    },
    {
      "HoldName": "SHIP_ALL",
      "HoldComments": "Order On Hold",
      "OrderNumber": "531258",
      "SourceTransactionSystem" : "GPR"
    }
  ]
}

Example 7 Response Body

The following example includes the contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "SUCCESS",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190405",
            "OrderNumber": "531258",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

Example 8

This example describes how to apply a fulfillment line hold on multiple fulfillment lines with the processRequestOfflineAfter attribute set to a non-default value. The default value for this attribute is 240 seconds.

Example 8 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
    "processRequestOfflineAfter": 10,
    "holdRequests": [
        {
            "FulfillLineId": 300100592623973,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        },
        {
            "FulfillLineId": 300100592623975,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        },
        {
            "FulfillLineId": 300100592625199,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        },
        {
            "FulfillLineId": 300100592625201,
            "HoldCode": "DOO_SHIP_ALL",
            "HoldComments": "Apply Fulfillment line Hold"
        }
    ]
}

Example 8 Response Body

The following example includes the contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "PROCESSING",
            "Message": "Order management is processing your request to apply a hold on the sales order. Query for order 531257 to monitor your request.",
            "SourceTransactionSystem": null,
            "SourceTransactionId": null,
            "OrderNumber": null,
            "SourceTransactionLineId": null,
            "FulfillLineId": "300100592623973",
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "PROCESSING",
            "Message": "Order management is processing your request to apply a hold on the sales order. Query for order 531257 to monitor your request.",
            "SourceTransactionSystem": null,
            "SourceTransactionId": null,
            "OrderNumber": null,
            "SourceTransactionLineId": null,
            "FulfillLineId": "300100592623975",
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "PROCESSING",
            "Message": "Order management is processing your request to apply a hold on the sales order. Query for order 531258 to monitor your request.",
            "SourceTransactionSystem": null,
            "SourceTransactionId": null,
            "OrderNumber": null,
            "SourceTransactionLineId": null,
            "FulfillLineId": "300100592625199",
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "PROCESSING",
            "Message": "Order management is processing your request to apply a hold on the sales order. Query for order 531258 to monitor your request.",
            "SourceTransactionSystem": null,
            "SourceTransactionId": null,
            "OrderNumber": null,
            "SourceTransactionLineId": null,
            "FulfillLineId": "300100592625201",
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

Example 9

This example demonstrates an exception scenario in which a duplicate hold is applied on an order header. Since the hold applied on the order already exists, an error is returned with RequestStatus.

Example 9 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
  "processRequestOfflineAfter": 20,
  "holdRequests": [
     {
      "HoldCode": "DOO_SHIP_ALL",
      "HoldComments": "Order On Hold",
      "OrderNumber": "531257",
      "SourceTransactionSystem" : "GPR"
    },
    {
      "HoldCode": "DOO_SHIP_ALL",
      "HoldComments": "Order On Hold",
      "OrderNumber": "531258",
      "SourceTransactionSystem" : "GPR"
    }
  ]
}

Example 9 Response Body

The following example includes the contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "ERROR",
            "Message": "You can't apply the DOO_SHIP_ALL hold on the order header or the order line because the order or line is already on hold. (FOM-4515576)",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        },
        {
            "RequestStatus": "ERROR",
            "Message": "You can't apply the DOO_SHIP_ALL hold on the order header or the order line because the order or line is already on hold. (FOM-4515576)",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190405",
            "OrderNumber": "531258",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": "DOO_SHIP_ALL"
        }
    ]
}

Example 10

This example demonstrates an exception scenario in which the required attributes are not passed in the apply hold request, and an error is returned with RequestStatus.

Example 10 Request Body

The following example includes the contents of the request body in JSON format. You replace the request payload in the cURL command with the contents of the Example Request Body. The request payload specifies attribute values that the command will use in the record that it updates.

{
  "processRequestOfflineAfter": 20,
  "holdRequests": [
     {
      "HoldComments": "Order On Hold",
      "OrderNumber": "531257",
      "SourceTransactionSystem" : "GPR"
    },
    {
      "HoldComments": "Order On Hold",
      "OrderNumber": "531258",
      "SourceTransactionSystem" : "GPR"
    }
  ]
}

Example 10 Response Body

The following example includes the contents of the response body in JSON format:

{
    "result": [
        {
            "RequestStatus": "ERROR",
            "Message": "Your payload for the APPLY_HOLD service is missing the HoldCode attribute. (FOM-4515571) Details: Include the HoldCode attribute in your payload.",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190404",
            "OrderNumber": "531257",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": null
        },
        {
            "RequestStatus": "ERROR",
            "Message": "Your payload for the APPLY_HOLD service is missing the HoldCode attribute. (FOM-4515571) Details: Include the HoldCode attribute in your payload.",
            "SourceTransactionSystem": "GPR",
            "SourceTransactionId": "AASHIP190405",
            "OrderNumber": "531258",
            "SourceTransactionLineId": null,
            "FulfillLineId": null,
            "HoldCode": null
        }
    ]
}
Back to Top